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