Imported Debian patch 2.4.4p3-3
[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 # This is the debhelper compatability version to use.
12 export DH_COMPAT=4
13
14 r=$(shell pwd)/debian/amanda-common
15 server=$(shell pwd)/debian/amanda-server
16 client=$(shell pwd)/debian/amanda-client
17
18 build: build-stamp 
19 build-stamp: /sbin/dump /usr/bin/smbclient debian/po/templates.pot
20         dh_testdir
21 #       automake --foreign
22 #       autoconf -l config
23         MAILER=/usr/bin/mail \
24         ./configure --prefix=/usr --bindir=/usr/sbin --mandir=/usr/share/man \
25                 --libexecdir=/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-tcpportrange=50000,50100 --with-udpportrange=840,860
33         touch missing
34         make CFLAGS="-O2 -g -Wall \
35                 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
36                 -DIGNORE_TAR_ERRORS "
37         touch build-stamp
38
39 clean:
40         dh_testdir
41         dh_testroot
42         -make clean
43         -make distclean
44         -rm -f build-stamp missing config/config.h common-src/genversion
45         -find . -type d -name .deps -exec rm -rf {} \;
46
47         -test -r /usr/share/misc/config.sub && \
48                 cp -f /usr/share/misc/config.sub config/config.sub
49         -test -r /usr/share/misc/config.guess && \
50                 cp -f /usr/share/misc/config.guess config/config.guess
51
52         dh_clean
53
54 # Build architecture-independent files here.
55 binary-indep: build
56
57 # Build architecture-dependent files here.
58 binary-arch: build
59         dh_testdir
60         dh_testroot
61         dh_clean -k
62         dh_installdirs -a
63         make install prefix=$(r)/usr bindir=$(r)/usr/sbin \
64                 libexecdir=$(r)/usr/lib/amanda mandir=$(r)/usr/share/man
65         install -m 644 debian/amanda.conf.in \
66                 $(server)/etc/amanda/DailySet1/amanda.conf
67         install -m 644 debian/disklist $(server)/etc/amanda/DailySet1/disklist
68         install -m 644 debian/crontab.amanda $(server)/etc/amanda
69         install -m 644 debian/amandahosts $(r)/etc/amandahosts
70         dh_installdocs -a
71         install -d $(r)/usr/share/doc/amanda-common/examples
72         cp -a example/* $(r)/usr/share/doc/amanda-common/examples
73         cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
74         dh_installmenu -a
75         dh_installcron -a
76         dh_installchangelogs -a
77         dh_installdebconf -a
78         dh_strip -a
79         dh_compress -a
80         dh_movefiles -a --sourcedir=debian/amanda-common
81         rm $(server)/usr/lib/amanda/chg-mtx
82         dh_fixperms -av
83         # fix perms manually
84         chown -R backup:backup debian/*/var/lib/*
85         chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
86         chown -R backup:backup $(server)/var/log/amanda
87         chmod -R u=rwX,g=rwX,o-rwx $(server)/var/log/amanda
88         chown -R backup:backup $(server)/etc/amanda
89         chmod -R u=rwX,g=rwX,o-rwx $(server)/etc/amanda
90         chown -R backup:backup $(client)/var/lib/amanda/gnutar-lists
91         chmod -R u=rwX,g=rwX,o-rwx $(client)/var/lib/amanda/gnutar-lists
92         # .. setuid
93         chown root:backup \
94                 $(client)/usr/lib/amanda/killpgrp \
95                 $(client)/usr/lib/amanda/rundump \
96                 $(client)/usr/lib/amanda/runtar \
97                 $(server)/usr/lib/amanda/dumper \
98                 $(server)/usr/lib/amanda/planner \
99                 $(server)/usr/sbin/amcheck
100         chmod u=srwx,g=rx,o=r \
101                 $(client)/usr/lib/amanda/killpgrp \
102                 $(client)/usr/lib/amanda/rundump \
103                 $(client)/usr/lib/amanda/runtar \
104                 $(server)/usr/lib/amanda/dumper \
105                 $(server)/usr/lib/amanda/planner \
106                 $(server)/usr/sbin/amcheck
107         install -o root -g root -m 0644 debian/amanda-client.lintian \
108                 $(client)/usr/share/lintian/overrides/amanda-client
109         install -o root -g root -m 0644 debian/amanda-server.lintian \
110                 $(server)/usr/share/lintian/overrides/amanda-server
111         dh_makeshlibs -a
112         dh_installdeb -a
113         dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
114         # strip out the non-versioned amanda-common references, we need
115         # the versioned ones in the control file and dupes are ugly...
116         sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
117         mv debian/blah debian/amanda-server.substvars
118         sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
119         mv debian/blah debian/amanda-client.substvars
120         dh_gencontrol -a
121         dh_md5sums -a
122         dh_builddeb -a
123
124 source diff:                                                                  
125         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
126
127 debian/po/templates.pot:        debian/templates
128         @debconf-updatepo
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary