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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
package=shellutils
d=debian/tmp
b=builddir
CFLAGS = -O2
LDFLAGS = -s
BIN_PROGS = date echo false pwd sleep stty su true uname
build: build-stamp
build-stamp:
dh_testdir src/date.c
mkdir $(b) || true
cd $(b) && CC=cc CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) \
../configure --prefix=/usr
sed -e 's/putenv\.o//g' $(b)/lib/Makefile > $(b)/lib/Makefile.new \
&& mv $(b)/lib/Makefile.new $(b)/lib/Makefile
$(MAKE) -C $(b)
touch build-stamp
clean:
dh_testdir src/date.c
dh_testroot
rm -f build-stamp install-stamp
rm -rf $(b)
rm -f po/*.gmo
dh_clean
install: install-stamp
install-stamp: build-stamp
dh_testdir src/date.c
dh_testroot
dh_clean -k
dh_installdirs -p$(package) \
bin usr/doc/$(package)
$(MAKE) -C $(b) prefix=`pwd`/$(d)/usr install
: # Remove stuff which is in other packages
rm -f $(d)/usr/bin/hostname $(d)/usr/man/man1/hostname.1
rm -f $(d)/usr/bin/uptime $(d)/usr/man/man1/uptime.1
: # Move certain binaries to /bin according to FSSTND and posix
for f in $(BIN_PROGS); do \
mv $(d)/usr/bin/$$f $(d)/bin/$$f; \
done
: # Link for archaic shells
ln -f $(d)/usr/bin/test $(d)/usr/bin/[
ln -s test.1 $(d)/usr/man/man1/[.1
: # GNU thinks chroot is in bin, Debian thinks chroot is in sbin
install -d $(d)/usr/sbin $(d)/usr/man/man8
mv $(d)/usr/bin/chroot $(d)/usr/sbin/.
sed s/1L/8L/1 $(d)/usr/man/man1/chroot.1 > $(d)/usr/man/man8/chroot.8
rm $(d)/usr/man/man1/chroot.1
: # Two missing manpages
cp debian/factor.1 debian/seq.1 $(d)/usr/man/man1/.
touch install-stamp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testversion 1.1
dh_testdir src/date.c
dh_testroot
dh_installdocs
# dh_installexamples
# dh_installmenu
# dh_installemacsen
# dh_installinit
# dh_installcron
# dh_installmanpages
# dh_undocumented
dh_installchangelogs
: # We only want back to Version 1.14
head -n 272 ChangeLog > $(d)/usr/doc/$(package)/changelog
dh_strip
dh_compress
dh_fixperms
# dh_suidregister
dh_installdeb
dh_shlibdeps
dh_gencontrol
# dh_makeshlibs
dh_md5sums
dh_builddeb
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
x:
# Standard boilerplate
dpkg-shlibdeps $(d)/usr/bin/nice
dpkg-gencontrol
chown -R root.root $(d)
chmod -R g-ws $(d)
dpkg --build $(d) ..
|