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