Re: perl module packages: why do they exist?
Hi,
I had not considered modifying ExtUtils, firstly, because I
didn't think I could get a patch in (it would be presumtuous of me to
think otherwise, don't you think?), and secondly, it is not
necessary. I already package CGI-modules, and have come up with a
Debian specific packagin infrastructure that is almost mechanical --
except that there are a few things that need be specified by hand
Specifically, the Debian control file information; which has
things like which section (devel/libs/net/x11 etc), whether it is
meant for the stable or the development Debian tree, whether it is
part of the main distribution, or it is contrib or non-free,
description, dependencies on toher debian packages, debian-revision,
and a package name that meets debian Policy.
I am including a live rules file (Andreas, this is a simple
make file) that shows how I do it; and given a control file, or the
data therin, I can autogenrate a customized rules file for any
package.
This could, of course, be done up as a MakeMaker rule, with
proper defaults and all, but I think it would need work on someone's
part; and I hesitate to impose on the authors.
My proposal is (and I have it partially implemented) that
there be a package that; given a control file, optionally downloads
the package using cpan.pm, (giving us the pristine upstream source
required by the new Debian source archive policy), unpacks it,
creates a subdirectory debian, copies the control file there,
generates the rules, menu, pre-and-post inst files, creaters debian
Changelog file, and a Debian README, and a initial copyright file in
that directory.
Optionally, the script can do a build, and create the Debian
.deb package. The user can then check the copyright and the rest of
the package for correctness so far. Installation is then very simple
(dpkg -i ../*.deb).
What I'm trying to say is that a Debian package requires
information that is Debian specific, and it seems unfair to ask
authors to include it in the package (even if they were conversant
with Debian policy).
I'll try and make it as painless for the user as possible,
# generate the control file
% make-ppkg --generate --package libcgi-perl --module CGI-modules > control
% vi control # make sure things look ok (espescially version numbers)
% make-ppkg -d my-packaging-directory control
% dpkg -I my-packaging-directory/libcgi-perl*.deb # check
% dpkg -BGiE my-packaging-directory/libcgi-perl*.deb # install
How does this sound? Is it still worth trying to modify
ExtUtils (still feels presumtuous of me to have that modified for
Debian -- after all, even the Linux kernel is not modified for us, we
just roll our own make-kpkg)?
manoj
--
Faith in a holy cause is to a considerable extent a substitute for
lost faith in ourselves. -- Eric Hoffer
Manoj Srivastava <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
______________________________________________________________________
#! /usr/bin/make -f
############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author : Manoj Srivastava ( srivasta@tiamat.datasync.com )
## Created On : Wed Nov 20 16:07:20 1996
## Created On Node : tiamat.datasync.com
## Last Modified By : Manoj Srivastava
## Last Modified On : Wed Nov 5 11:46:00 1997
## Last Machine Used: tiamat.datasync.com
## Update Count : 29
## Status : Unknown, Use with caution!
## HISTORY :
## Description :
##
###############################################################################
FILES_TO_CLEAN = debian/files debian/buildinfo debian/substvars
STAMPS_TO_CLEAN = stamp-configure stamp-build stamp-binary
DIRS_TO_CLEAN = debian/tmp
thisdir=$(shell pwd)
install_file= install -p -o root -g root -m 644
install_program= install -p -o root -g root -m 755
make_directory= install -p -d -o root -g root -m 755
deb_rule = $(MAKE) -f $(thisdir)/debian/rules
package = $(shell grep Source debian/control | sed 's/^Source: //')
version= $(shell head -1 debian/changelog | \
perl -nle 'm/\S+\s+\((\S+)\)/ && print $$1')
PRIVLIB := $(shell perl -e 'use Config; print "$$Config{'privlibexp'}\n";')
ARCHLIB := $(shell perl -e 'use Config; print "$$Config{'archlibexp'}\n";')
DOCDIR := debian/tmp/usr/doc/$(package)
FILES_TO_COMPRESS= $(DOCDIR)/README.* $(DOCDIR)/changelog.debian
all build: configure stamp-build
stamp-build:
# Builds the binary package.
$(checkdir)
-test ! -f stamp-configure && $(MAKE) -f debian/rules configure
$(MAKE)
dpkg -l perl 'libc*' make dpkg-dev | \
awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > \
debian/buildinfo
touch stamp-build
configure: stamp-configure Makefile
stamp-configure Makefile:
$(checkdir)
-test ! -f stamp-configure && \
perl Makefile.PL && touch stamp-configure
clean:
# Undoes the effect of `make -f debian/rules build'.
$(checkdir)
rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
rm -rf $(DIRS_TO_CLEAN)
-test -f Makefile && $(MAKE) realclean
rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o \
-name '*~' -o -name '*.bak' -o -name '#*#' -o \
-name '.*.orig' -o -name '.*.rej' -o -name '.SUMS' -o \
-size 0 \) -print` TAGS
binary: binary-arch binary-indep
binary-arch: build
binary-indep: build stamp-binary
stamp-binary:
# Makes a binary package.
test root = "`whoami`" || (echo need root priviledges; exit 1)
$(checkdir)
test -f stamp-build || $(deb_rule) build
rm -rf debian/tmp
$(make_directory) debian/tmp
chmod g-s debian/tmp
$(make_directory) debian/tmp/DEBIAN
$(make_directory) debian/tmp/$(PRIVLIB)
$(make_directory) debian/tmp/$(ARCHLIB)
$(make_directory) debian/tmp/usr/man/man3
$(make_directory) debian/tmp/usr/lib/menu
$(make_directory) $(DOCDIR)
$(install_file) debian/changelog $(DOCDIR)/changelog.debian
$(install_file) README $(DOCDIR)/README
$(install_file) debian/README $(DOCDIR)/README.debian
$(install_file) debian/buildinfo $(DOCDIR)/buildinfo.Debian
$(install_file) debian/doc.html $(DOCDIR)/index.html
$(install_file) debian/menuentry debian/tmp/usr/lib/menu/$(package)
(cd doc; tar cf - .) | ( cd $(DOCDIR)/; tar xf - )
-gzip -9qfr $(FILES_TO_COMPRESS)
# Make sure the copyright file is not compressed
$(install_file) debian/copyright $(DOCDIR)/copyright
$(MAKE) PREFIX=$(thisdir)/debian/tmp/usr \
INSTALLDIRS=perl \
INSTALLMAN1DIR=$(thisdir)/debian/tmp/usr/man/man1 \
INSTALLMAN3DIR=$(thisdir)/debian/tmp/usr/man/man3 \
pure_install
-gzip -9qf debian/tmp/usr/man/man3/*
-rm -rf debian/tmp/usr/lib/perl5/i386-linux
$(install_program) debian/preinst debian/tmp/DEBIAN/preinst
$(install_program) debian/postinst debian/tmp/DEBIAN/postinst
$(install_program) debian/postrm debian/tmp/DEBIAN/postrm
dpkg-gencontrol
chmod -R u+w debian/tmp/usr/
chown -R root.root debian/tmp/
dpkg-deb --build debian/tmp ..
touch stamp-binary
define checkdir
test -f CGI/BasePlus.pm -a -f debian/rules
endef
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
.PHONY: binary binary-arch binary-indep clean
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: