1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#! /usr/bin/make -f
.PHONY: build clean binary binary-indep binary-arch checkdir checkroot
d = ./debian/tmp
python = $(d)/python
perl = $(d)/perl
build: checkdir
clean: checkdir
$(RM) -r debian/{files,substvars,tmp}
find . -name \*~ -print0 | xargs -0 $(RM)
binary: binary-arch binary-indep
binary-arch:
binary-indep: checkdir build checkroot
$(RM) -r debian/{files,substvars,tmp}
install -d $(python)/DEBIAN
# install -d $(python)/usr/lib/site-python/dpkg
install -d $(python)/usr/lib/python/dpkg
install -d $(python)/usr/doc/dpkg-python
install -c debian/changelog $(python)/usr/doc/dpkg-python/changelog.Debian
gzip -9vf $(python)/usr/doc/dpkg-python/*
install -c debian/copyright $(python)/usr/doc/dpkg-python/copyright
# cp python/dpkg/*.py $(python)/usr/lib/site-python/dpkg/
cp python/dpkg/*.py $(python)/usr/lib/python/dpkg/
install -c debian/dpkg-python.postinst $(python)/DEBIAN/postinst
install -c debian/dpkg-python.prerm $(python)/DEBIAN/prerm
install -d $(perl)/DEBIAN
install -d $(perl)/usr/lib/perl5/Dpkg
install -d $(perl)/usr/doc/dpkg-perl
install -c debian/changelog $(perl)/usr/doc/dpkg-perl/changelog.Debian
gzip -9vf $(perl)/usr/doc/dpkg-perl/*
install -c debian/copyright $(perl)/usr/doc/dpkg-perl/copyright
cp -rp perl5/Dpkg/* $(perl)/usr/lib/perl5/Dpkg/
find $(perl)/usr/lib/perl5 -type f \! -name \*.pm -print0 | xargs -0 $(RM)
chown -R root.root $(d)
find $(d) -type f -print0 | xargs -0 chmod 644
find $(d) -type d -print0 | xargs -0 chmod 755
chmod a+x $(d)/*/DEBIAN/{postinst,prerm}
dpkg-gencontrol -pdpkg-python -P$(python)
dpkg --build $(python) ..
dpkg-gencontrol -pdpkg-perl -P$(perl)
dpkg --build $(perl) ..
checkdir:
test -f perl5/Dpkg/Archive/FTP.pm
checkroot:
test "`whoami`" = "root"
|