2 # debian/rules for amanda using debhelper
3 # Copyright 1998-2009 by Bdale Garbee. License GPL v2
5 # Uncomment this to turn on verbose mode.
8 r=$(shell pwd)/debian/amanda-common
9 s=$(shell pwd)/debian/amanda-server
10 c=$(shell pwd)/debian/amanda-client
12 configure: configure-stamp
15 # pick up latest config files provided by autotools-dev
16 cp -f /usr/share/misc/config.sub config/config.sub
17 cp -f /usr/share/misc/config.guess config/config.guess
18 # do we need --{htmldir,dvidir,pdfdir,psdir} to force subdirectories?
19 # should we re-craft this to use --without-server and --without-client,
20 # and lose the amanda-common package?
21 MAILER=/usr/bin/mail \
26 --libexecdir=/usr/lib/amanda \
27 --without-amlibexecdir \
30 --sharedstatedir=/var/lib \
31 --localstatedir=/var/lib \
34 --with-tcpportrange=50000,50100 \
35 --with-udpportrange=840,860 \
36 --with-debugging=/var/log/amanda \
37 --with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
38 --with-index-server=localhost \
40 --with-smbclient=/usr/bin/smbclient \
43 --with-bsdtcp-security \
44 --with-bsdudp-security \
51 build-stamp: configure-stamp
53 MAILER=/usr/bin/mail make CFLAGS="-O2 -g -Wall \
54 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
61 [ ! -f Makefile ] || make clean
62 [ ! -f Makefile ] || make distclean
63 -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
64 -find . -type d -name .deps -exec rm -rf {} \;
67 # call this before packaging for upload when updating template English text
69 -rm -f debian/po/templates.pot
79 make install DESTDIR=$(r)
80 install -m 644 debian/amandahosts $(r)/etc/amandahosts
83 cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
84 cp debian/xinetd.d/amandaidx $(s)/etc/xinetd.d
85 cp debian/xinetd.d/amidxtape $(s)/etc/xinetd.d
86 cp debian/xinetd.d/amanda $(r)/etc/xinetd.d
89 dh_installchangelogs -a
93 dh_movefiles -a --sourcedir=debian/amanda-common
94 rm $(s)/usr/lib/amanda/chg-mtx
97 chown -R backup:backup debian/*/var/lib/*
98 chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
99 chown -R backup:backup $(s)/var/log/amanda
100 chmod -R u=rwX,g=rwX,o-rwx $(s)/var/log/amanda
101 chown -R backup:backup $(s)/etc/amanda
102 chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
103 chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
104 chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
107 $(c)/usr/lib/amanda/killpgrp \
108 $(c)/usr/lib/amanda/rundump \
109 $(c)/usr/lib/amanda/runtar \
110 $(s)/usr/lib/amanda/dumper \
111 $(s)/usr/lib/amanda/planner \
112 $(s)/usr/sbin/amcheck
113 chmod u=srwx,g=rx,o=r \
114 $(c)/usr/lib/amanda/killpgrp \
115 $(c)/usr/lib/amanda/rundump \
116 $(c)/usr/lib/amanda/runtar \
117 $(s)/usr/lib/amanda/dumper \
118 $(s)/usr/lib/amanda/planner \
119 $(s)/usr/sbin/amcheck
120 install -o root -g root -m 0644 debian/amanda-client.lintian \
121 $(c)/usr/share/lintian/overrides/amanda-client
122 install -o root -g root -m 0644 debian/amanda-common.lintian \
123 $(r)/usr/share/lintian/overrides/amanda-common
124 install -o root -g root -m 0644 debian/amanda-server.lintian \
125 $(s)/usr/share/lintian/overrides/amanda-server
126 dh_makeshlibs -pamanda-common
128 dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
129 # strip out the non-versioned amanda-common references, we need
130 # the versioned ones in the control file and dupes are ugly...
131 sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
132 mv debian/blah debian/amanda-server.substvars
133 sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
134 mv debian/blah debian/amanda-client.substvars
140 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
142 binary: binary-indep binary-arch
143 .PHONY: build clean binary-indep binary-arch binary