3 #### Configure variables. Feel free to change these, but be careful!
5 # You can pass your own temp directory as an environment variable.
6 # This prefix is prepended to all directories during "make install"
7 FAKEROOT="${SRCDIR}/froot"
8 # Configure and Compilation directory.
9 BUILDDIR="${SRCDIR}/build"
10 # Config variables to mirror those in RPM .spec file
11 amanda_user=amandabackup
15 BINDIR="${EPREFIX}/bin"
16 SBINDIR="${EPREFIX}/sbin"
17 LIBEXECDIR="${EPREFIX}/lib/amanda"
18 DATADIR="${PREFIX}/share"
21 AMANDAHOMEDIR="${LOCALSTATEDIR}/lib/amanda"
22 LIBDIR="${EPREFIX}/lib"
23 INCLUDEDIR="${PREFIX}/include"
24 INFODIR="${PREFIX}/info"
25 MANDIR="${DATADIR}/man"
26 LOGDIR="${LOCALSTATEDIR}/log/amanda"
30 if [ ! -f common-src/amanda.h ]
32 echo "'buildpkg' must be run from the root of an otherwise unused amanda source directory." >&2
38 echo "The source directory has not been autogen'd -- please download a source distribution tarball or run ./autogen."
39 echo "You will need autoconf, automake, and libtool to run autogen (but not to compile from a distribution tarball)."
43 # Until we get package revisioning in community.
44 [ -f "PKG_REV" ] || echo "1" > PKG_REV
49 # We need to edit packaging/deb/changelog to reflect our current distro
50 # and release. This can't be done within the debian packaging system;
51 # dpkg assumes that packages will have the same name on all releases and
52 # that apt will prevent users from downloading the wrong build. We want
53 # this information helpfully obvious since we can't rely on apt.
54 file_list="packaging/deb/changelog \
55 packaging/deb/postinst \
56 packaging/deb/postrm \
57 packaging/deb/preinst"
58 for file in ${file_list}; do
59 /usr/bin/perl packaging/common/substitute.pl \
60 ${file}.src ${file} || exit 1
65 # Setup directories and files as dpkg-buildpkg expects.
66 if [ -d debian ]; then
69 cp -Rf packaging/deb debian
70 if [ -d $BUILDDIR ]; then
79 echo "Building package"
81 # Create unsigned packages
82 dpkg-buildpackage -rfakeroot -uc -us