5 subdirs_build_arch= cprogs
6 subdirs_nobuild=backup sync-accounts scripts
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); \
38 set -e; for s in $(subdirs_build_arch); do \
39 $(MAKE) -C $$s -i distclean || \
40 $(MAKE) -C $$s -f Makefile.in distclean; \
42 rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
43 rm -rf debian/sv-* debian/*.debhelper.log
49 set -e; for s in $(subdirs_build_arch) $(subdirs_nobuild); do \
50 $(MAKE) -C $$s install install-docs install-examples \
53 varlib=$t/$$s/var/lib \
54 mandir=$t/$$s/usr/share/man; \
57 mv $t/cprogs $t/chiark-utils-bin
59 cp -a debian/tmp/sync-accounts/* debian/tmp/scripts/.
60 rm -r debian/tmp/sync-accounts
61 mv debian/tmp/scripts debian/tmp/chiark-scripts
62 mv debian/tmp/backup debian/tmp/chiark-backup
64 set -e; for p in $(packages); do \
65 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
66 cp debian/copyright debian/changelog \
67 $t/$$p/usr/share/doc/$$p/; \
69 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
70 gzip -9vn $t/$$p/usr/share/doc/$$p/changelog; \
73 install -d $t/chiark-rwbuffer/usr/bin
74 install -d $t/chiark-rwbuffer/usr/share/man/man1
75 cd $t/chiark-utils-bin/usr/bin && \
76 mv readbuffer writebuffer $t/chiark-rwbuffer/usr/bin/
77 cd $t/chiark-utils-bin/usr/share/man/man1 && \
78 mv readbuffer.1 writebuffer.1 $t/chiark-rwbuffer/usr/share/man/man1/
80 install -d $t/chiark-backup/usr/share/man/man1
81 cp backup/man/*.1 $t/chiark-backup/usr/share/man/man1/
82 cd $t/chiark-backup/usr/share/man/man1 && \
84 mv "$$m" backup-"$$m"; \
87 $t/chiark-backup/usr/share/doc/chiark-backup/examples/chiark/settings.sh \
88 $t/chiark-backup/etc/chiark-backup/settings.sh
90 install -d $t/chiark-really/usr/sbin
91 install -d $t/chiark-really/usr/share/man/man8
92 cd $t/chiark-utils-bin/usr/sbin && \
93 mv really $t/chiark-really/usr/sbin/
94 cd $t/chiark-utils-bin/usr/share/man/man8 && \
95 mv really.8 $t/chiark-really/usr/share/man/man8/
96 rm $t/chiark-utils-bin/usr/sbin/trivsoundd \
97 $t/chiark-utils-bin/usr/share/man/man8/trivsoundd.8
98 rmdir $t/chiark-utils-bin/usr/sbin
100 gzip -9fn $t/*/usr/share/man/man*/*
102 binary-hook-chiark-backup:
103 binary-hook-chiark-rwbuffer:
104 binary-hook-sync-accounts:
105 binary-hook-chiark-scripts:
106 binary-hook-chiark-really:
107 binary-hook-chiark-utils-bin:
110 set -e; for f in preinst postinst prerm postrm conffiles; do \
111 test -f debian/$p/$$f || continue; \
112 cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
113 chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
115 dh_link -p$p -Pdebian/tmp/$p
116 dpkg-gencontrol -p$p -P$t/$p -Tdebian/sv-$p
117 chown -R root.root debian/tmp
118 chmod -R g-ws debian/tmp
119 debian/rules binary-hook-$p
120 dpkg --build $t/$p ..
122 binary-indep: checkroot build binary-prep
123 set -e; for p in $(packages_indep); do \
124 debian/rules binary-one p=$$p; done
126 binary-arch: checkroot build binary-prep
128 set -ex; for p in chiark-really chiark-utils-bin chiark-rwbuffer; do \
129 dh_strip -p$$p -Pdebian/tmp/$$p; done
130 dpkg-shlibdeps -Tdebian/sv-chiark-rwbuffer \
131 $t/chiark-rwbuffer/usr/bin/*
132 dpkg-shlibdeps -Tdebian/sv-chiark-really \
133 $t/chiark-really/usr/sbin/*
134 set -e; for f in $t/chiark-utils-bin/usr/bin/*; do \
136 */xbatmon-simple|*/xduplic-copier) \
138 */watershed|*/summer|*/cgi-fcgi-interp) \
144 dpkg-shlibdeps -Tdebian/sv-chiark-utils-bin $$a
145 set -e; for p in $(packages_arch); \
146 do debian/rules binary-one p=$$p; done
149 test -f cprogs/writebuffer.c
152 # Below here is fairly generic really
154 binary: binary-indep binary-arch
157 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
161 test root = "`whoami`"
163 .PHONY: binary binary-arch binary-indep clean checkroot