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); \
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/sync-accounts/* debian/tmp/scripts/.
56 rm -r debian/tmp/sync-accounts
57 mv debian/tmp/scripts debian/tmp/chiark-scripts
58 mv debian/tmp/backup debian/tmp/chiark-backup
60 set -e; for p in $(packages); do \
61 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
62 cp debian/copyright debian/changelog \
63 $t/$$p/usr/share/doc/$$p/; \
65 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
66 gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \
69 install -d $t/chiark-rwbuffer/usr/bin
70 install -d $t/chiark-rwbuffer/usr/share/man/man1
71 cd $t/chiark-utils-bin/usr/bin && \
72 mv readbuffer writebuffer $t/chiark-rwbuffer/usr/bin/
73 cd $t/chiark-utils-bin/usr/share/man/man1 && \
74 mv readbuffer.1 writebuffer.1 $t/chiark-rwbuffer/usr/share/man/man1/
76 install -d $t/chiark-backup/usr/share/man/man1
77 cp backup/man/*.1 $t/chiark-backup/usr/share/man/man1/
78 cd $t/chiark-backup/usr/share/man/man1 && \
80 mv "$$m" backup-"$$m"; \
83 $t/chiark-backup/usr/share/doc/chiark-backup/examples/chiark/settings.sh \
84 $t/chiark-backup/etc/chiark-backup/settings.sh
86 install -d $t/chiark-really/usr/sbin
87 install -d $t/chiark-really/usr/share/man/man8
88 cd $t/chiark-utils-bin/usr/sbin && \
89 mv really $t/chiark-really/usr/sbin/
90 cd $t/chiark-utils-bin/usr/share/man/man8 && \
91 mv really.8 $t/chiark-really/usr/share/man/man8/
92 rm $t/chiark-utils-bin/usr/sbin/trivsoundd \
93 $t/chiark-utils-bin/usr/share/man/man8/trivsoundd.8
94 rmdir $t/chiark-utils-bin/usr/sbin
96 gzip -9f $t/*/usr/share/man/man*/*
98 binary-hook-chiark-backup:
99 binary-hook-chiark-rwbuffer:
100 binary-hook-sync-accounts:
101 binary-hook-chiark-scripts:
102 binary-hook-chiark-really:
103 binary-hook-chiark-utils-bin:
106 set -e; for f in preinst postinst prerm postrm conffiles; do \
107 test -f debian/$p/$$f || continue; \
108 cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
109 chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
111 dh_link -p$p -Pdebian/tmp/$p
112 dpkg-gencontrol -isp -p$p -P$t/$p -Tdebian/sv-$p
113 chown -R root.root debian/tmp
114 chmod -R g-ws debian/tmp
115 debian/rules binary-hook-$p
116 dpkg --build $t/$p ..
118 binary-indep: checkroot build binary-prep
119 set -e; for p in $(packages_indep); do \
120 debian/rules binary-one p=$$p; done
122 binary-arch: checkroot build binary-prep
124 set -ex; for p in chiark-really chiark-utils-bin chiark-rwbuffer; do \
125 dh_strip -p$$p -Pdebian/tmp/$$p; done
126 dpkg-shlibdeps -Tdebian/sv-chiark-rwbuffer \
127 $t/chiark-rwbuffer/usr/bin/*
128 dpkg-shlibdeps -Tdebian/sv-chiark-really \
129 $t/chiark-really/usr/sbin/*
130 set -e; for f in $t/chiark-utils-bin/usr/bin/*; do \
132 */xbatmon-simple|*/xduplic-copier) \
134 */watershed|*/summer) d=Recommends ;; \
139 dpkg-shlibdeps -Tdebian/sv-chiark-utils-bin $$a
141 -e' next unless m/^shlibs:/; '\
142 -e' s/$$/,/; s/=/=, /; '\
143 -e' s/, libgmp3(?:c2)?,/, libgmp3 | libgmp3c2,/; '\
144 -e' s/=, /=/; s/,$$//; '\
146 set -e; for p in $(packages_arch); \
147 do debian/rules binary-one p=$$p; done
150 test -f cprogs/writebuffer.c
153 # Below here is fairly generic really
155 binary: binary-indep binary-arch
158 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
162 test root = "`whoami`"
164 .PHONY: binary binary-arch binary-indep clean checkroot