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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
#! /usr/bin/make -f
# The name of the package (for example, `emacs').
p = ppd-gs
# The version of the package (for example, `19.28').
v = 1.1
# The Debian revision of the package (for example, `2').
d = 1
# The name of the copyright file.
c = $(p)
# The architecture of the package.
a = all
build:
# Builds the binary package.
./configure --prefix=/usr --bindir=/usr/sbin
$(MAKE) debian package="$p"
touch stamp-build
clean:
# Undoes the effect of `make -f debian.rules build'.
rm -f stamp-build
-$(MAKE) -i distclean
-rm -rf debian-tmp* *~ *.orig ./#*# tmp.*
-rm -f config.cache config.status config.h install config.log
find -name '*~' -print0 | xargs -r0 rm --
binary: checkroot
# Makes a binary package.
test -f stamp-build || make -f debian.rules build
rm -rf debian-tmp
install -d -g root -m 755 -o root debian-tmp
chmod g-s debian-tmp
install -d -g root -m 755 -o root debian-tmp/DEBIAN
make install prefix=`pwd`/debian-tmp/usr \
bindir=debian-tmp/usr/sbin package="$p"
install -d -g root -m 755 -o root debian-tmp/usr/doc/copyright
install -g root -m 644 -o root debian.README \
debian-tmp/usr/doc/copyright/$(c)
sed -e '1s/=P/$(p)/' -e '3s/=V/$(v)/' -e '3s/=D/$(d)/' \
-e '4s/=A/$(a)/' debian.control > debian-tmp/DEBIAN/control
chmod 644 debian-tmp/DEBIAN/control
install -g root -m 755 -o root debian.postinst \
debian-tmp/DEBIAN/postinst
install -g root -m 755 -o root debian.postrm \
debian-tmp/DEBIAN/postrm
dpkg --build debian-tmp
mv debian-tmp.deb ../$(p)_$(v)-$(d)_$(a).deb && \
dpkg-name --overwrite ../$(p)_$(v)-$(d)_$(a).deb
source:
# Makes a source package.
-test -f stamp-build && make -f debian.rules clean
( cd .. && tar cf - $(p)-$(v) | gzip -9f > $(p)_$(v)-$(d).tar.gz )
diff:
# Makes a context diff.
-test -f stamp-build && make -f debian.rules clean
-test -d ../$(p)-$(v).orig -o -f ../$(p)_$(v)-`expr $(d) - 1`.diff.gz \
|| ( echo "Original source package is not available." ; false )
-test -d ../$(p)-$(v).orig || make -f debian.rules orig
( cd .. && diff -cNr $(p)-$(v).orig $(p)-$(v) | gzip -9f \
> $(p)_$(v)-$(d).diff.gz )
-test -f stamp-orig \
&& rm -rf ../$(p)-$(v).orig && rm -f stamp-orig
dist: binary source diff
# Prepares the package for distribution.
orig:
# Prepares the original package from the previous
# Debian revision source package and context diff.
( cd .. \
&& mkdir $(p).orig \
&& cd $(p).orig \
&& tar xzf ../$(p)_$(v)-`expr $(d) - 1`.tar.gz \
&& cd $(p)-$(v) \
&& (gunzip -c ../../$(p)_$(v)-`expr $(d) - 1`.diff.gz \
| patch -sER -p1 ) \
&& find . -name "*.orig" -exec rm -f {} \; \
&& cd .. \
&& mv $(p)-$(v) ../$(p)-$(v).orig \
&& cd .. \
&& rmdir $(p).orig )
touch stamp-orig
checkroot:
test root = `whoami`
|