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
|
#!/bin/sh -e
tmp=`pwd`/debian/leave
if echo $DEB_BUILD_OPTIONS | grep -vq noopt; then
optflag="-O2"
fi
if echo $DEB_BUILD_OPTIONS | grep -vq nostrip; then
stripflag="-s"
fi
case "$1" in
build)
test -f leave.c || { echo not in the right dir\!; exit 1; }
test -f leave || { cc -g $optflag -Wall \
-D__COPYRIGHT\(x\)= -D__RCSID\(x\)= \
leave.c -o leave
}
# used to have 'pmake CFLAGS="..." leave' here, but why?
;;
clean)
test -f leave.c || { echo not in the right dir\!; exit 1; }
test `id -u` -eq 0 || { echo "don't have (pseudo-)root!"; exit 1; }
rm -f build-stamp leave leave.o leave.cat1 debian/files debian/substvars
rm -rf $tmp
;;
binary-arch|binary)
test -f leave || $0 build
test `id -u` -eq 0 || { echo "don't have (pseudo-)root!"; exit 1; }
rm -rf $tmp
install -d -m 755 $tmp/usr/bin $tmp/usr/share/man/man1 \
$tmp/DEBIAN $tmp/usr/share/doc/leave
install $stripflag -m 755 leave $tmp/usr/bin
gzip -c9 leave.1 > $tmp/usr/share/man/man1/leave.1.gz
gzip -c9 debian/changelog > $tmp/usr/share/doc/leave/changelog.Debian.gz
install -m 644 debian/copyright $tmp/usr/share/doc/leave
dpkg-shlibdeps $tmp/usr/bin/leave
dpkg-gencontrol -isp -P$tmp
chown -R root.root $tmp
chmod -R g-ws $tmp
dpkg --build $tmp ..
;;
*)
echo unknown option: $1
exit 1
;;
esac
|