| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #!/usr/bin/make -f
- DIR:=$(shell pwd)
- arch=$(shell dpkg --print-architecture)
- cidir=debian/tmp/DEBIAN
- build:
- $(checkdir)
- ./configure --prefix=/usr
- $(MAKE)
- touch build
- clean:
- $(checkdir)
- -rm -f build
- -$(MAKE) -i distclean || $(MAKE) -f Makefile.in -i distclean
- -rm -rf debian/tmp* *~ *.orig ./#*# tmp.* debian/files*
- -rm -f config.cache config.status config.h install config.log
- find -name '*~' -print0 | xargs -r0 rm --
- binary: binary-arch binary-indep
- binary-indep:
- $(checkdir)
- binary-arch: checkroot build
- $(checkdir)
- -rm -rf debian/tmp
- install -d debian/tmp debian/tmp/DEBIAN debian/tmp/etc/dpkg
- install -d debian/tmp/usr/doc/{copyright,dpkg}
- set -e; if [ $(arch) = i386 ]; then \
- sed -e 's/^# i386elf: //' <debian/preinst >$(cidir)/preinst ; \
- else \
- sed -e '/^# i386elf: /d' debian/preinst >$(cidir)/preinst ; \
- fi
- set -e; if [ -f debian/shlibs.default.$(arch) ]; then \
- echo /etc/dpkg/shlibs.default >$(cidir)/conffiles ; \
- cp debian/shlibs.default.$(arch) debian/tmp/etc/dpkg/shlibs.default ; \
- fi
- cp debian/{prerm,postinst} $(cidir)/.
- chmod +x $(cidir)/{postinst,prerm,preinst}
- $(MAKE) prefix=$(DIR)/debian/tmp/usr \
- datadir=$(DIR)/debian/tmp/var/lib/dpkg \
- etcdir=$(DIR)/debian/tmp/etc \
- install
- find debian/tmp/usr/man -type f | xargs gzip -9v
- set -e; for f in dpkg-buildpackage dpkg-gencontrol dpkg-distaddfile \
- dpkg-parsechangelog dpkg-genchanges dpkg-shlibdeps; do \
- rm debian/tmp/usr/man/man1/$$f.1; \
- ln -s dpkg-source.1.gz debian/tmp/usr/man/man1/$$f.1.gz ; \
- done
- gzip -9v debian/tmp/usr/doc/dpkg/changelog.*
- cp debian/copyright debian/tmp/usr/doc/dpkg/copyright
- cp TODO debian/tmp/usr/doc/dpkg/WISHLIST
- touch debian/tmp/var/lib/dpkg/{status,available}
- dpkg-shlibdeps -dPre-Depends main/dpkg dselect/dselect
- dpkg-gencontrol
- chown -R root.root debian/tmp
- chmod -R g-ws,a+r,u+w debian/tmp
- set -e; cd debian/tmp; \
- version=`sed -n 's/^Version: //p' DEBIAN/control`; \
- file=dpkg_$${version}_$(arch).nondebbin.tar; \
- tar cf ../../../$${file} usr var && gzip -9vf ../../../$${file}; \
- cd ../..; dpkg-distaddfile $${file}.gz byhand -
- mv debian/tmp/usr/bin/dpkg-deb{,.dist}
- rm debian/tmp/var/lib/dpkg/{status,available}
- dpkg-deb --build debian/tmp ..
- define checkdir
- test -f include/dpkg.h
- endef
- checkroot:
- $(checkdir)
- test root = "`whoami`"
- .PHONY: binary source diff clean checkroot
|