5 subdirs_build_arch= cprogs
6 subdirs_nobuild=backup sync-accounts scripts fishdescriptor
8 packages_indep= chiark-backup chiark-scripts
9 packages_arch= chiark-rwbuffer chiark-really chiark-utils-bin
10 packages= $(packages_indep) $(packages_arch)
16 makebuildargs := OPTIMISE= DEBUG= \
17 CMDLINE_CFLAGS="$(shell dpkg-buildflags --get CFLAGS)" \
18 CMDLINE_CPPFLAGS="$(shell dpkg-buildflags --get CPPFLAGS)" \
19 CMDLINE_LDFLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
23 set -e; for s in $(subdirs_build_arch); do \
24 $(MAKE) -C $$s all $(makebuildargs); \
34 set -e; for s in $(subdirs_build_arch); do \
35 $(MAKE) -C $$s -i distclean || \
36 $(MAKE) -C $$s -f Makefile.in distclean; \
38 rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
39 rm -rf debian/sv-* debian/*.debhelper.log
45 set -e; for s in $(subdirs_build_arch) $(subdirs_nobuild); do \
46 $(MAKE) -C $$s install install-docs install-examples \
49 varlib=$t/$$s/var/lib \
50 mandir=$t/$$s/usr/share/man; \
53 mv $t/cprogs $t/chiark-utils-bin
55 cp -a debian/tmp/fishdescriptor/* debian/tmp/scripts/.
56 cp -a debian/tmp/sync-accounts/* debian/tmp/scripts/.
57 rm -r debian/tmp/sync-accounts
58 mv debian/tmp/scripts debian/tmp/chiark-scripts
59 mv debian/tmp/backup debian/tmp/chiark-backup
61 set -e; for p in $(packages); do \
62 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
63 cp debian/copyright debian/changelog \
64 $t/$$p/usr/share/doc/$$p/; \
66 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
67 gzip -9vn $t/$$p/usr/share/doc/$$p/changelog; \
70 install -d $t/chiark-rwbuffer/usr/bin
71 install -d $t/chiark-rwbuffer/usr/share/man/man1
72 cd $t/chiark-utils-bin/usr/bin && \
73 mv readbuffer writebuffer $t/chiark-rwbuffer/usr/bin/
74 cd $t/chiark-utils-bin/usr/share/man/man1 && \
75 mv readbuffer.1 writebuffer.1 $t/chiark-rwbuffer/usr/share/man/man1/
77 install -d $t/chiark-backup/usr/share/man/man1
78 cp backup/man/*.1 $t/chiark-backup/usr/share/man/man1/
79 cd $t/chiark-backup/usr/share/man/man1 && \
81 mv "$$m" backup-"$$m"; \
84 $t/chiark-backup/usr/share/doc/chiark-backup/examples/chiark/settings.sh \
85 $t/chiark-backup/etc/chiark-backup/settings.sh
87 install -d $t/chiark-really/usr/sbin
88 install -d $t/chiark-really/usr/share/man/man8
89 cd $t/chiark-utils-bin/usr/sbin && \
90 mv really $t/chiark-really/usr/sbin/
91 cd $t/chiark-utils-bin/usr/share/man/man8 && \
92 mv really.8 $t/chiark-really/usr/share/man/man8/
93 rm $t/chiark-utils-bin/usr/sbin/trivsoundd \
94 $t/chiark-utils-bin/usr/share/man/man8/trivsoundd.8
95 rmdir $t/chiark-utils-bin/usr/sbin
97 gzip -9fn $t/*/usr/share/man/man*/*
99 binary-hook-chiark-backup:
100 binary-hook-chiark-rwbuffer:
101 binary-hook-sync-accounts:
102 binary-hook-chiark-scripts:
103 binary-hook-chiark-really:
104 binary-hook-chiark-utils-bin:
107 set -e; for f in preinst postinst prerm postrm conffiles; do \
108 test -f debian/$p/$$f || continue; \
109 cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
110 chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
112 dh_link -p$p -Pdebian/tmp/$p
113 dpkg-gencontrol -p$p -P$t/$p -Tdebian/sv-$p
114 chown -R root.root debian/tmp
115 chmod -R g-ws debian/tmp
116 debian/rules binary-hook-$p
117 dpkg --build $t/$p ..
119 binary-indep: checkroot build binary-prep
120 set -e; for p in $(packages_indep); do \
121 debian/rules binary-one p=$$p; done
123 binary-arch: checkroot build binary-prep
125 set -ex; for p in chiark-really chiark-utils-bin chiark-rwbuffer; do \
126 dh_strip -p$$p -Pdebian/tmp/$$p; done
127 dpkg-shlibdeps -Tdebian/sv-chiark-rwbuffer \
128 $t/chiark-rwbuffer/usr/bin/*
129 dpkg-shlibdeps -Tdebian/sv-chiark-really \
130 $t/chiark-really/usr/sbin/*
131 set -e; for f in $t/chiark-utils-bin/usr/bin/*; do \
133 */xbatmon-simple|*/xduplic-copier) \
135 */watershed|*/summer|*/cgi-fcgi-interp|*/prefork-interp) \
141 dpkg-shlibdeps -Tdebian/sv-chiark-utils-bin $$a
142 set -e; for p in $(packages_arch); \
143 do debian/rules binary-one p=$$p; done
146 test -f cprogs/writebuffer.c
149 # Below here is fairly generic really
151 binary: binary-indep binary-arch
154 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
158 test root = "`whoami`"
160 .PHONY: binary binary-arch binary-indep clean checkroot