move activate-devpay to amanda-server, add a skeletal man page for it
[debian/amanda] / debian / rules
1 #!/usr/bin/make -f
2 # Copyright 1998-2011 by Bdale Garbee.  License GPL v2
3
4 export DH_VERBOSE=1
5
6 r=$(shell pwd)/debian/amanda-common
7 s=$(shell pwd)/debian/amanda-server
8 c=$(shell pwd)/debian/amanda-client
9
10 configure: configure-stamp
11 configure-stamp:
12         dh_testdir
13         # pick up latest config files provided by autotools-dev
14         cp -f /usr/share/misc/config.sub config/config.sub
15         cp -f /usr/share/misc/config.guess config/config.guess
16         # do we need --{htmldir,dvidir,pdfdir,psdir} to force subdirectories?
17         # should we re-craft this to use --without-server and --without-client,
18         #       and lose the amanda-common package?
19         MAILER=/usr/bin/mail \
20         SSH=/usr/bin/ssh \
21         ./configure \
22                 --prefix=/usr \
23                 --bindir=/usr/sbin \
24                 --libexecdir=/usr/lib/amanda \
25                 --without-amlibexecdir \
26                 --without-amperldir \
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-gnutar-listdir=/var/lib/amanda/gnutar-lists \
36                 --with-index-server=localhost \
37                 --with-bsd-security \
38                 --with-smbclient=/usr/bin/smbclient \
39                 --with-amandahosts \
40                 --with-ssh-security \
41                 --with-bsdtcp-security \
42                 --with-bsdudp-security \
43                 --without-ipv6 \
44                 --enable-s3-device
45
46         touch missing
47         touch configure-stamp
48
49 build: build-arch build-indep
50 build-arch: build-stamp
51 build-indep: build-stamp
52 build-stamp: configure-stamp
53         dh_testdir
54         MAILER=/usr/bin/mail $(MAKE) CFLAGS="-O2 -g -Wall \
55                 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
56                 -DIGNORE_TAR_ERRORS "
57         touch build-stamp
58
59 clean:
60         dh_testdir
61         dh_testroot
62         [ ! -f Makefile ] || make clean
63         [ ! -f Makefile ] || make distclean
64         -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
65         -find . -type d -name .deps -exec rm -rf {} \;
66         dh_clean
67
68 # call this before packaging for upload when updating template English text
69 updatepo:
70         -rm -f debian/po/templates.pot
71         debconf-updatepo
72         
73 binary-indep: build
74
75 binary-arch: build
76         dh_testdir
77         dh_testroot
78         dh_clean -k
79         dh_installdirs -a
80         make install DESTDIR=$(r)
81         sed -i "/dependency_libs/ s/'.*'/''/" `find $(r)/usr/lib/amanda/ -name '*.la'`
82         install -m 644 debian/amandahosts $(r)/etc/amandahosts
83         dh_installdocs -a
84         dh_installexamples -a
85         ln -s /usr/share/amanda/example $(r)/usr/share/doc/examples
86         cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
87         cp example/xinetd.amandaserver $(r)/etc/xinetd.d/amanda
88         dh_installmenu -a
89         dh_installcron -a
90         dh_installchangelogs -a
91         dh_installdebconf -a
92         dh_installman -a
93         dh_strip -a
94         dh_compress -a
95         dh_movefiles -a --sourcedir=debian/amanda-common
96         rm -r $(r)/usr/share/amanda
97         dh_fixperms -av
98         # fix perms manually
99         chown -R backup:backup debian/*/var/lib/*
100         chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
101         chown -R backup:backup $(s)/var/log/amanda
102         chmod -R u=rwX,g=rwX,o-rwx $(s)/var/log/amanda
103         chown -R backup:backup $(s)/etc/amanda
104         chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
105         chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
106         chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
107         # .. setuid
108         chown root:backup \
109                 $(c)/usr/lib/amanda/application/amgtar \
110                 $(c)/usr/lib/amanda/application/amstar \
111                 $(c)/usr/lib/amanda/calcsize \
112                 $(c)/usr/lib/amanda/killpgrp \
113                 $(c)/usr/lib/amanda/rundump \
114                 $(c)/usr/lib/amanda/runtar \
115                 $(s)/usr/lib/amanda/dumper \
116                 $(s)/usr/lib/amanda/planner \
117                 $(s)/usr/sbin/amcheck
118         chmod u=srwx,g=rx,o=r \
119                 $(c)/usr/lib/amanda/application/amgtar \
120                 $(c)/usr/lib/amanda/application/amstar \
121                 $(c)/usr/lib/amanda/calcsize \
122                 $(c)/usr/lib/amanda/killpgrp \
123                 $(c)/usr/lib/amanda/rundump \
124                 $(c)/usr/lib/amanda/runtar \
125                 $(s)/usr/lib/amanda/dumper \
126                 $(s)/usr/lib/amanda/planner \
127                 $(s)/usr/sbin/amcheck
128         install -o root -g root -m 0644 debian/amanda-client.lintian \
129                 $(c)/usr/share/lintian/overrides/amanda-client
130         install -o root -g root -m 0644 debian/amanda-common.lintian \
131                 $(r)/usr/share/lintian/overrides/amanda-common
132         install -o root -g root -m 0644 debian/amanda-server.lintian \
133                 $(s)/usr/share/lintian/overrides/amanda-server
134         dh_makeshlibs -pamanda-common --noscripts
135         dh_installdeb -a
136         dh_perl -a usr/lib/amanda/perl
137         dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
138         # strip out the non-versioned amanda-common references, we need
139         # the versioned ones in the control file and dupes are ugly...
140         sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
141         mv debian/blah debian/amanda-server.substvars
142         sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
143         mv debian/blah debian/amanda-client.substvars
144         dh_gencontrol -a
145         dh_md5sums -a
146         dh_builddeb -a
147
148 source diff:                                                                  
149         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
150
151 binary: binary-indep binary-arch
152 .PHONY: configure build-indep build-arch build clean binary-indep binary-arch binary