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
|
#! /usr/bin/make -f
#
# Debian rules for building "dftp" package
package := dftp
version := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
tarfile := $(package)-$(version)-standalone.tar
sadir := debian/tmp-standalone/dftp
build:
$(checkdir)
touch build
clean:
$(checkdir)
-rm -f build
-rm -rf debian/files debian/substvars debian/tmp*
find . \( -name "#*" -o -name "*~" \) -print | xargs rm -f
binary-indep: checkroot build
$(checkdir)
-rm -rf debian/tmp
mkdir -p debian/tmp/DEBIAN debian/tmp/usr/doc/$(package)
mkdir -p debian/tmp/etc debian/tmp/usr/sbin debian/tmp/usr/man/man8
cp debian/conffiles debian/tmp/DEBIAN/conffiles
cp dftp.conf debian/tmp/etc
cp dftp debian/tmp/usr/sbin
cp dftp.8 debian/tmp/usr/man/man8
cp debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
gzip -9f debian/tmp/usr/man/man8/dftp.8 debian/tmp/usr/doc/$(package)/*
cp debian/copyright debian/tmp/usr/doc/$(package)/copyright
chown -R root.root debian/tmp
chmod -R go=rX debian/tmp
dpkg-gencontrol
dpkg --build debian/tmp ..
# build also standalone tar file
mkdir -p $(sadir)/Debian/Package
install -m755 dftp $(sadir)
# this depends on pkg-order being installed on the build system... not
# very nice, but who knows a better way?
install -m644 /usr/lib/perl5/Debian/Package/*.pm $(sadir)/Debian/Package
install -m644 debian/README.standalone $(sadir)/README
chown -R root.root $(sadir)
tar cf ../$(tarfile) -C debian/tmp-standalone dftp
gzip -9f ../$(tarfile)
dpkg-distaddfile $(tarfile).gz byhand -
binary-arch: checkroot build
$(checkdir)
define checkdir
test -e dftp.conf
endef
binary: binary-indep binary-arch
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
checkroot:
$(checkdir)
test root = "`whoami`"
.PHONY: binary binary-arch binary-indep clean checkroot
|