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