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 cp ChangeLog $(r)/usr/share/doc/amanda-common/changelog
89 cp example/xinetd.amandaserver $(r)/etc/xinetd.d/amanda
92 dh_installchangelogs -a
97 dh_movefiles -a --sourcedir=debian/amanda-common
98 rm -r $(r)/usr/share/amanda
101 chown -R backup:backup debian/*/var/lib/*
102 chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/*
103 chown -R backup:backup $(s)/etc/amanda
104 chmod -R u=rwX,g=rwX,o-rwx $(s)/etc/amanda
105 chown -R backup:backup $(c)/var/lib/amanda/gnutar-lists
106 chmod -R u=rwX,g=rwX,o-rwx $(c)/var/lib/amanda/gnutar-lists
109 $(c)/usr/lib/amanda/application/amgtar \
110 $(c)/usr/lib/amanda/application/amstar \
111 $(c)/usr/lib/amanda/calcsize \
112 $(c)/usr/lib/amanda/killpgrp \
113 $(c)/usr/lib/amanda/rundump \
114 $(c)/usr/lib/amanda/runtar \
115 $(s)/usr/lib/amanda/dumper \
116 $(s)/usr/lib/amanda/planner \
117 $(s)/usr/sbin/amcheck
118 chmod u=srwx,g=rx,o=r \
119 $(c)/usr/lib/amanda/application/amgtar \
120 $(c)/usr/lib/amanda/application/amstar \
121 $(c)/usr/lib/amanda/calcsize \
122 $(c)/usr/lib/amanda/killpgrp \
123 $(c)/usr/lib/amanda/rundump \
124 $(c)/usr/lib/amanda/runtar \
125 $(s)/usr/lib/amanda/dumper \
126 $(s)/usr/lib/amanda/planner \
127 $(s)/usr/sbin/amcheck
128 install -o root -g root -m 0644 debian/amanda-client.lintian \
129 $(c)/usr/share/lintian/overrides/amanda-client
130 install -o root -g root -m 0644 debian/amanda-common.lintian \
131 $(r)/usr/share/lintian/overrides/amanda-common
132 install -o root -g root -m 0644 debian/amanda-server.lintian \
133 $(s)/usr/share/lintian/overrides/amanda-server
134 dh_makeshlibs -pamanda-common --noscripts
136 dh_perl -a usr/lib/amanda/perl
137 dh_shlibdeps -a -l"debian/amanda-common/usr/lib:debian/amanda-client/usr/lib:debian/amanda-server/usr/lib"
138 # strip out the non-versioned amanda-common references, we need
139 # the versioned ones in the control file and dupes are ugly...
140 sed -e 's/amanda-common, //' < debian/amanda-server.substvars > debian/blah
141 mv debian/blah debian/amanda-server.substvars
142 sed -e 's/amanda-common, //' < debian/amanda-client.substvars > debian/blah
143 mv debian/blah debian/amanda-client.substvars
149 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
151 binary: binary-indep binary-arch
152 .PHONY: configure build-indep build-arch build clean binary-indep binary-arch binary