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)
18 set -e; for s in $(subdirs_build_arch); do $(MAKE) -C $$s all; done
27 set -e; for s in $(subdirs_build_arch); do \
28 $(MAKE) -C $$s -i distclean || \
29 $(MAKE) -C $$s -f Makefile.in distclean; \
31 rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
32 rm -rf debian/sv-* debian/*.debhelper.log
38 set -e; for s in $(subdirs_build_arch) $(subdirs_nobuild); do \
39 $(MAKE) -C $$s install install-docs install-examples \
42 varlib=$t/$$s/var/lib \
43 mandir=$t/$$s/usr/share/man; \
46 mv $t/cprogs $t/chiark-utils-bin
48 cp -a debian/tmp/sync-accounts/* debian/tmp/scripts/.
49 rm -r debian/tmp/sync-accounts
50 mv debian/tmp/scripts debian/tmp/chiark-scripts
51 mv debian/tmp/backup debian/tmp/chiark-backup
53 set -e; for p in $(packages); do \
54 install -d $t/$$p/DEBIAN $t/$$p/usr/share/doc/$$p; \
55 cp debian/copyright debian/changelog \
56 $t/$$p/usr/share/doc/$$p/; \
58 $t/$$p/usr/share/doc/$$p/changelog.Debian.gz; \
59 gzip -9v $t/$$p/usr/share/doc/$$p/changelog; \
62 install -d $t/chiark-rwbuffer/usr/bin
63 install -d $t/chiark-rwbuffer/usr/share/man/man1
64 cd $t/chiark-utils-bin/usr/bin && \
65 mv readbuffer writebuffer $t/chiark-rwbuffer/usr/bin/
66 cd $t/chiark-utils-bin/usr/share/man/man1 && \
67 mv readbuffer.1 writebuffer.1 $t/chiark-rwbuffer/usr/share/man/man1/
69 install -d $t/chiark-backup/usr/share/man/man1
70 cp backup/man/*.1 $t/chiark-backup/usr/share/man/man1/
71 cd $t/chiark-backup/usr/share/man/man1 && \
73 mv "$$m" backup-"$$m"; \
76 $t/chiark-backup/usr/share/doc/chiark-backup/examples/chiark/settings.sh \
77 $t/chiark-backup/etc/chiark-backup/settings.sh
79 install -d $t/chiark-really/usr/sbin
80 install -d $t/chiark-really/usr/share/man/man8
81 cd $t/chiark-utils-bin/usr/sbin && \
82 mv really $t/chiark-really/usr/sbin/
83 cd $t/chiark-utils-bin/usr/share/man/man8 && \
84 mv really.8 $t/chiark-really/usr/share/man/man8/
85 rm $t/chiark-utils-bin/usr/sbin/trivsoundd \
86 $t/chiark-utils-bin/usr/share/man/man8/trivsoundd.8
87 rmdir $t/chiark-utils-bin/usr/sbin \
88 $t/chiark-utils-bin/usr/share/man/man8
90 gzip -9f $t/*/usr/share/man/man*/*
92 binary-hook-chiark-backup:
93 binary-hook-chiark-rwbuffer:
94 binary-hook-sync-accounts:
95 binary-hook-chiark-scripts:
96 binary-hook-chiark-really:
97 binary-hook-chiark-utils-bin:
100 set -e; for f in preinst postinst prerm postrm conffiles; do \
101 test -f debian/$p/$$f || continue; \
102 cp debian/$p/$$f $t/$p/DEBIAN/$$f; \
103 chmod u=rwX,go=rX $t/$p/DEBIAN/$$f; \
105 dh_link -p$p -Pdebian/tmp/$p
106 dpkg-gencontrol -isp -p$p -P$t/$p -Tdebian/sv-$p
107 chown -R root.root debian/tmp
108 chmod -R g-ws debian/tmp
109 debian/rules binary-hook-$p
110 dpkg --build $t/$p ..
112 binary-indep: checkroot build binary-prep
113 set -e; for p in $(packages_indep); do \
114 debian/rules binary-one p=$$p; done
116 binary-arch: checkroot build binary-prep
118 set -ex; for p in chiark-really chiark-utils-bin chiark-rwbuffer; do \
119 dh_strip -p$$p -Pdebian/tmp/$$p; done
120 dpkg-shlibdeps -Tdebian/sv-chiark-rwbuffer \
121 $t/chiark-rwbuffer/usr/bin/*
122 dpkg-shlibdeps -Tdebian/sv-chiark-really \
123 $t/chiark-really/usr/sbin/*
124 set -e; for f in $t/chiark-utils-bin/usr/bin/*; do \
126 */xbatmon-simple) d=Suggests ;; \
127 */watershed|*/summer) d=Recommends ;; \
132 dpkg-shlibdeps -Tdebian/sv-chiark-utils-bin $$a
134 -e' next unless m/^shlibs:/; '\
135 -e' s/$$/,/; s/=/=, /; '\
136 -e' s/, libgmp3(?:c2)?,/, libgmp3 | libgmp3c2,/; '\
137 -e' s/=, /=/; s/,$$//; '\
139 set -e; for p in $(packages_arch); \
140 do debian/rules binary-one p=$$p; done
143 test -f cprogs/writebuffer.c
146 # Below here is fairly generic really
148 binary: binary-indep binary-arch
151 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
155 test root = "`whoami`"
157 .PHONY: binary binary-arch binary-indep clean checkroot