tweak configure options based on feedback from build log, looks like more
[debian/amanda] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for amanda using debhelper. GNU copyright 1998 by Bdale Garbee.
3 # requires automake 1.2d (from experimental tree)
4
5 #       Warning - do *not* use -j on an SMP machine, or the build gets
6 #               confused... some sort of race condition in the makefiles?
7
8 # Uncomment this to turn on verbose mode.
9 #export DH_VERBOSE=1
10
11 r=$(shell pwd)/debian/amanda-common
12 s=$(shell pwd)/debian/amanda-server
13 c=$(shell pwd)/debian/amanda-client
14
15 configure: configure-stamp
16 configure-stamp:
17         dh_testdir
18         # pick up latest config files provided by autotools-dev
19         cp -f /usr/share/misc/config.sub config/config.sub
20         cp -f /usr/share/misc/config.guess config/config.guess
21 #       automake --foreign
22 #       autoconf -l config
23         MAILER=/usr/bin/mail \
24         ./configure --prefix=/usr --bindir=/usr/sbin --mandir=/usr/share/man \
25                 --with-amlibexecdir=/usr/lib/amanda --enable-shared \
26                 --sysconfdir=/etc --localstatedir=/var/lib \
27                 --with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
28                 --with-index-server=localhost \
29                 --with-user=backup --with-group=backup  \
30                 --with-bsd-security --with-amandahosts \
31                 --with-smbclient=/usr/bin/smbclient \
32                 --with-debugging=/var/log/amanda \
33                 --with-tcpportrange=50000,50100 --with-udpportrange=840,860 \
34                 --with-ssh-security \
35                 --with-bsdtcp-security --with-bsdudp-security
36         touch missing
37         touch configure-stamp
38
39 build: build-stamp 
40 build-stamp: configure-stamp
41         dh_testdir
42         MAILER=/usr/bin/mail make CFLAGS="-O2 -g -Wall \
43                 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
44                 -DIGNORE_TAR_ERRORS "
45         touch build-stamp
46
47 clean:
48         dh_testdir
49         dh_testroot
50         [ ! -f Makefile ] || make clean
51         [ ! -f Makefile ] || make distclean
52         -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
53         -find . -type d -name .deps -exec rm -rf {} \;
54         dh_clean
55
56 # call this before packaging for upload when updating template English text
57 updatepo:
58         -rm -f debian/po/templates.pot
59         debconf-updatepo
60         
61 binary-indep: build
62
63 binary-arch: build
64         dh_testdir
65         dh_testroot
66         dh_clean -k
67         dh_installdirs -a
68         make install DESTDIR=$(r)
69         install -m 644 debian/amandahosts $(r)/etc/amandahosts
70         dh_installdocs -a
71         dh_installexamples -a
72         cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
73         cp debian/xinetd.d/amandaidx $(s)/etc/xinetd.d
74         cp debian/xinetd.d/amidxtape $(s)/etc/xinetd.d
75         cp debian/xinetd.d/amanda $(r)/etc/xinetd.d                     
76         dh_installmenu -a
77         dh_installcron -a
78         dh_installchangelogs -a
79         dh_installdebconf -a
80         dh_strip -a
81         dh_compress -a
82         dh_movefiles -a --sourcedir=debian/amanda-common
83         rm $(s)/usr/lib/amanda/chg-mtx
84         dh_fixperms -av
85         # fix perms manually
86         chown -R backup:backup debian/*/var/lib/*
87         chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
88         chown -R backup:backup $(s)/var/log/amanda
89         chmod -R u=rwX,g=rwX,o-rwx $(s)/var/log/amanda
90         chown -R backup:backup $(s)/etc/amanda
91         chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
92         chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
93         chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
94         # .. setuid
95         chown root:backup \
96                 $(c)/usr/lib/amanda/killpgrp \
97                 $(c)/usr/lib/amanda/rundump \
98                 $(c)/usr/lib/amanda/runtar \
99                 $(s)/usr/lib/amanda/dumper \
100                 $(s)/usr/lib/amanda/planner \
101                 $(s)/usr/sbin/amcheck
102         chmod u=srwx,g=rx,o=r \
103                 $(c)/usr/lib/amanda/killpgrp \
104                 $(c)/usr/lib/amanda/rundump \
105                 $(c)/usr/lib/amanda/runtar \
106                 $(s)/usr/lib/amanda/dumper \
107                 $(s)/usr/lib/amanda/planner \
108                 $(s)/usr/sbin/amcheck
109         install -o root -g root -m 0644 debian/amanda-client.lintian \
110                 $(c)/usr/share/lintian/overrides/amanda-client
111         install -o root -g root -m 0644 debian/amanda-common.lintian \
112                 $(r)/usr/share/lintian/overrides/amanda-common
113         install -o root -g root -m 0644 debian/amanda-server.lintian \
114                 $(s)/usr/share/lintian/overrides/amanda-server
115         dh_makeshlibs -a
116         dh_installdeb -a
117         dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
118         # strip out the non-versioned amanda-common references, we need
119         # the versioned ones in the control file and dupes are ugly...
120         sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
121         mv debian/blah debian/amanda-server.substvars
122         sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
123         mv debian/blah debian/amanda-client.substvars
124         dh_gencontrol -a
125         dh_md5sums -a
126         dh_builddeb -a
127
128 source diff:                                                                  
129         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
130
131 binary: binary-indep binary-arch
132 .PHONY: build clean binary-indep binary-arch binary