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