oops, references to the server /var/log/amanda directory in rules, too
[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 DPKG_EXPORT_BUILDFLAGS = 1
7 -include /usr/share/dpkg/buildflags.mk
8
9 r=$(shell pwd)/debian/amanda-common
10 s=$(shell pwd)/debian/amanda-server
11 c=$(shell pwd)/debian/amanda-client
12
13 configure: configure-stamp
14 configure-stamp:
15         dh_testdir
16         # pick up latest config files provided by autotools-dev
17         cp -f /usr/share/misc/config.sub config/config.sub
18         cp -f /usr/share/misc/config.guess config/config.guess
19         # do we need --{htmldir,dvidir,pdfdir,psdir} to force subdirectories?
20         # should we re-craft this to use --without-server and --without-client,
21         #       and lose the amanda-common package?
22         MAILER=/usr/bin/mail \
23         SSH=/usr/bin/ssh \
24         ./configure \
25                 --prefix=/usr \
26                 --bindir=/usr/sbin \
27                 --libexecdir=/usr/lib/amanda \
28                 --without-amlibexecdir \
29                 --without-amperldir \
30                 --sysconfdir=/etc \
31                 --sharedstatedir=/var/lib \
32                 --localstatedir=/var/lib \
33                 --with-user=backup \
34                 --with-group=backup  \
35                 --with-tcpportrange=50000,50100 \
36                 --with-udpportrange=840,860 \
37                 --with-debugging=/var/log/amanda \
38                 --with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
39                 --with-index-server=localhost \
40                 --with-bsd-security \
41                 --with-smbclient=/usr/bin/smbclient \
42                 --with-amandahosts \
43                 --with-ssh-security \
44                 --with-bsdtcp-security \
45                 --with-bsdudp-security \
46                 --without-ipv6 \
47                 --enable-s3-device
48
49         touch missing
50         touch configure-stamp
51
52 build: build-arch build-indep
53 build-arch: build-stamp
54 build-indep: build-stamp
55 build-stamp: configure-stamp
56         dh_testdir
57         MAILER=/usr/bin/mail $(MAKE) CFLAGS="$(CFLAGS) -O2 -g -Wall \
58                 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
59                 -DIGNORE_TAR_ERRORS "
60         touch build-stamp
61
62 clean:
63         dh_testdir
64         dh_testroot
65         [ ! -f Makefile ] || make clean
66         [ ! -f Makefile ] || make distclean
67         -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
68         -find . -type d -name .deps -exec rm -rf {} \;
69         dh_clean
70
71 # call this before packaging for upload when updating template English text
72 updatepo:
73         -rm -f debian/po/templates.pot
74         debconf-updatepo
75         
76 binary-indep: build
77
78 binary-arch: build
79         dh_testdir
80         dh_testroot
81         dh_clean -k
82         dh_installdirs -a
83         make install DESTDIR=$(r)
84         sed -i "/dependency_libs/ s/'.*'/''/" `find $(r)/usr/lib/amanda/ -name '*.la'`
85         install -m 644 debian/amandahosts $(r)/etc/amandahosts
86         dh_installdocs -a
87         dh_installexamples -a
88         cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
89         cp example/xinetd.amandaserver $(r)/etc/xinetd.d/amanda
90         dh_installmenu -a
91         dh_installcron -a
92         dh_installchangelogs -a
93         dh_installdebconf -a
94         dh_installman -a
95         dh_strip -a
96         dh_compress -a
97         dh_movefiles -a --sourcedir=debian/amanda-common
98         rm -r $(r)/usr/share/amanda
99         dh_fixperms -av
100         # fix perms manually
101         chown -R backup:backup debian/*/var/lib/*
102         chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
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