2 # Copyright 1998-2011 by Bdale Garbee. License GPL v2
6 DPKG_EXPORT_BUILDFLAGS = 1
7 -include /usr/share/dpkg/buildflags.mk
9 r=$(shell pwd)/debian/amanda-common
10 s=$(shell pwd)/debian/amanda-server
11 c=$(shell pwd)/debian/amanda-client
13 configure: configure-stamp
16 # pick up latest config files provided by autotools-dev
17 cp -f /usr/share/misc/config.sub config/config.sub
18 cp -f /usr/share/misc/config.guess config/config.guess
19 # do we need --{htmldir,dvidir,pdfdir,psdir} to force subdirectories?
20 # should we re-craft this to use --without-server and --without-client,
21 # and lose the amanda-common package?
22 MAILER=/usr/bin/mail \
27 --libexecdir=/usr/lib/amanda \
28 --without-amlibexecdir \
31 --sharedstatedir=/var/lib \
32 --localstatedir=/var/lib \
35 --with-tcpportrange=50000,50100 \
36 --with-udpportrange=840,860 \
37 --with-debugging=/var/log/amanda \
38 --with-gnutar-listdir=/var/lib/amanda/gnutar-lists \
39 --with-index-server=localhost \
41 --with-smbclient=/usr/bin/smbclient \
44 --with-bsdtcp-security \
45 --with-bsdudp-security \
52 build: build-arch build-indep
53 build-arch: build-stamp
54 build-indep: build-stamp
55 build-stamp: configure-stamp
57 MAILER=/usr/bin/mail $(MAKE) CFLAGS="$(CFLAGS) -O2 -g -Wall \
58 -DAMANDATES_FILE='\"/var/lib/amanda/amandates\"' \
65 [ ! -f Makefile ] || make clean
66 [ ! -f Makefile ] || make distclean
67 -rm -f build-stamp configure-stamp missing config/config.h common-src/genversion
68 -find . -type d -name .deps -exec rm -rf {} \;
71 # call this before packaging for upload when updating template English text
73 -rm -f debian/po/templates.pot
83 make install DESTDIR=$(r)
84 sed -i "/dependency_libs/ s/'.*'/''/" `find $(r)/usr/lib/amanda/ -name '*.la'`
85 install -m 644 debian/amandahosts $(r)/etc/amandahosts
88 ln -s ../amanda/example $(r)/usr/share/doc/examples
89 cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
90 cp example/xinetd.amandaserver $(r)/etc/xinetd.d/amanda
93 dh_installchangelogs -a
98 dh_movefiles -a --sourcedir=debian/amanda-common
99 rm -r $(r)/usr/share/amanda
102 chown -R backup:backup debian/*/var/lib/*
103 chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
104 chown -R backup:backup $(s)/var/log/amanda
105 chmod -R u=rwX,g=rwX,o-rwx $(s)/var/log/amanda
106 chown -R backup:backup $(s)/etc/amanda
107 chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
108 chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
109 chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
112 $(c)/usr/lib/amanda/application/amgtar \
113 $(c)/usr/lib/amanda/application/amstar \
114 $(c)/usr/lib/amanda/calcsize \
115 $(c)/usr/lib/amanda/killpgrp \
116 $(c)/usr/lib/amanda/rundump \
117 $(c)/usr/lib/amanda/runtar \
118 $(s)/usr/lib/amanda/dumper \
119 $(s)/usr/lib/amanda/planner \
120 $(s)/usr/sbin/amcheck
121 chmod u=srwx,g=rx,o=r \
122 $(c)/usr/lib/amanda/application/amgtar \
123 $(c)/usr/lib/amanda/application/amstar \
124 $(c)/usr/lib/amanda/calcsize \
125 $(c)/usr/lib/amanda/killpgrp \
126 $(c)/usr/lib/amanda/rundump \
127 $(c)/usr/lib/amanda/runtar \
128 $(s)/usr/lib/amanda/dumper \
129 $(s)/usr/lib/amanda/planner \
130 $(s)/usr/sbin/amcheck
131 install -o root -g root -m 0644 debian/amanda-client.lintian \
132 $(c)/usr/share/lintian/overrides/amanda-client
133 install -o root -g root -m 0644 debian/amanda-common.lintian \
134 $(r)/usr/share/lintian/overrides/amanda-common
135 install -o root -g root -m 0644 debian/amanda-server.lintian \
136 $(s)/usr/share/lintian/overrides/amanda-server
137 dh_makeshlibs -pamanda-common --noscripts
139 dh_perl -a usr/lib/amanda/perl
140 dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
141 # strip out the non-versioned amanda-common references, we need
142 # the versioned ones in the control file and dupes are ugly...
143 sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
144 mv debian/blah debian/amanda-server.substvars
145 sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
146 mv debian/blah debian/amanda-client.substvars
152 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
154 binary: binary-indep binary-arch
155 .PHONY: configure build-indep build-arch build clean binary-indep binary-arch binary