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\"' \
56 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
57 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
66 [ ! -f Makefile ] || make clean
67 [ ! -f Makefile ] || make distclean
68 -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
69 -find . -type d -name .deps -exec rm -rf {} \;
72 # call this before packaging for upload when updating template English text
74 -rm -f debian/po/templates.pot
84 make install DESTDIR=$(r)
85 install -m 644 debian/amandahosts $(r)/etc/amandahosts
88 cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
89 cp debian/xinetd.d/amandaidx $(s)/etc/xinetd.d
90 cp debian/xinetd.d/amidxtape $(s)/etc/xinetd.d
91 cp debian/xinetd.d/amanda $(r)/etc/xinetd.d
94 dh_installchangelogs -a
98 dh_movefiles -a --sourcedir=debian/amanda-common
99 rm -r $(r)/usr/share/amanda
100 rm $(s)/usr/lib/amanda/chg-mtx
103 chown -R backup:backup debian/*/var/lib/*
104 chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
105 chown -R backup:backup $(s)/var/log/amanda
106 chmod -R u=rwX,g=rwX,o-rwx $(s)/var/log/amanda
107 chown -R backup:backup $(s)/etc/amanda
108 chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
109 chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
110 chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
113 $(c)/usr/lib/amanda/application/amgtar \
114 $(c)/usr/lib/amanda/application/amstar \
115 $(c)/usr/lib/amanda/calcsize \
116 $(c)/usr/lib/amanda/killpgrp \
117 $(c)/usr/lib/amanda/rundump \
118 $(c)/usr/lib/amanda/runtar \
119 $(s)/usr/lib/amanda/dumper \
120 $(s)/usr/lib/amanda/planner \
121 $(s)/usr/sbin/amcheck
122 chmod u=srwx,g=rx,o=r \
123 $(c)/usr/lib/amanda/application/amgtar \
124 $(c)/usr/lib/amanda/application/amstar \
125 $(c)/usr/lib/amanda/calcsize \
126 $(c)/usr/lib/amanda/killpgrp \
127 $(c)/usr/lib/amanda/rundump \
128 $(c)/usr/lib/amanda/runtar \
129 $(s)/usr/lib/amanda/dumper \
130 $(s)/usr/lib/amanda/planner \
131 $(s)/usr/sbin/amcheck
132 install -o root -g root -m 0644 debian/amanda-client.lintian \
133 $(c)/usr/share/lintian/overrides/amanda-client
134 # install -o root -g root -m 0644 debian/amanda-common.lintian \
135 # $(r)/usr/share/lintian/overrides/amanda-common
136 install -o root -g root -m 0644 debian/amanda-server.lintian \
137 $(s)/usr/share/lintian/overrides/amanda-server
138 dh_makeshlibs -pamanda-common --noscripts
141 dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
142 # strip out the non-versioned amanda-common references, we need
143 # the versioned ones in the control file and dupes are ugly...
144 sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
145 mv debian/blah debian/amanda-server.substvars
146 sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
147 mv debian/blah debian/amanda-client.substvars
153 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
155 binary: binary-indep binary-arch
156 .PHONY: build clean binary-indep binary-arch binary