X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=packaging%2Fdeb%2Fbuildpkg;h=69889a9c7387aa6db6488fe333d800f7a6cb6464;hb=109540caa4e37a3663b3dcfb9a205b9609e3f561;hp=4cee2d6fa759b46ec5ba474f80262db7e365e565;hpb=6ba576375c19b829b2a13dbe6562eedd2716b9ea;p=debian%2Famanda diff --git a/packaging/deb/buildpkg b/packaging/deb/buildpkg index 4cee2d6..69889a9 100755 --- a/packaging/deb/buildpkg +++ b/packaging/deb/buildpkg @@ -1,22 +1,15 @@ #! /bin/bash set -x #### Configure variables. Feel free to change these, but be careful! -SRCDIR=$(pwd) +SRCDIR=$PWD # You can pass your own temp directory as an environment variable. -if [ -z $TMPDIR ] -then - TMPDIR="/tmp/buildpkg.deb" -fi # This prefix is prepended to all directories during "make install" -FAKEROOT="${TMPDIR}/froot" +FAKEROOT="${SRCDIR}/froot" # Configure and Compilation directory. -BUILDDIR="${TMPDIR}/build" +BUILDDIR="${SRCDIR}/build" # Config variables to mirror those in RPM .spec file amanda_user=amandabackup amanda_group=admin -udpportrange="700,740" -tcpportrange="11000,11040" -low_tcpportrange="700,710" PREFIX="/usr" EPREFIX="${PREFIX}" BINDIR="${EPREFIX}/bin" @@ -47,53 +40,25 @@ then exit 1 fi -if [ -z $AMVER ] -then - AMVER=amanda-2.6.0p2 -fi - -if [ -z $AMTARBALL ] -then - AMTARBALL=$AMVER.tar.gz -fi +# Until we get package revisioning in community. +[ -f "PKG_REV" ] || echo "1" > PKG_REV #### Build functions -do_build() { - - echo "Running configure" - ./configure --quiet \ - --prefix=${PREFIX} \ - --bindir=${BINDIR} \ - --sbindir=${SBINDIR} \ - --mandir=${MANDIR} \ - --libexecdir=${LIBEXECDIR} \ - --sysconfdir=${SYSCONFDIR} \ - --localstatedir=${LOCALSTATEDIR} \ - --with-star=/bin/star \ - --with-gnutar=/bin/tar \ - --with-gnutar-listdir=${AMANDAHOMEDIR}/gnutar-lists \ - --with-index-server=localhost \ - --with-tape-server=localhost \ - --with-user=${amanda_user} \ - --with-group=${amanda_group} \ - --with-owner=${amanda_user} \ - --with-fqdn \ - --with-bsd-security \ - --with-bsdtcp-security \ - --with-bsdudp-security \ - --with-amandahosts \ - --with-smbclient=/usr/bin/smbclient \ - --with-ssh-security \ - --with-udpportrange=${udpportrange} \ - --with-tcpportrange=${tcpportrange} \ - --with-low-tcpportrange=${low_tcpportrange} \ - --with-debugging=${LOGDIR} \ - --disable-installperms \ - --enable-s3-device \ - --with-assertions \ - || exit 1 - +do_substitute() { + # We need to edit packaging/deb/changelog to reflect our current distro + # and release. This can't be done within the debian packaging system; + # dpkg assumes that packages will have the same name on all releases and + # that apt will prevent users from downloading the wrong build. We want + # this information helpfully obvious since we can't rely on apt. + file_list="packaging/deb/changelog \ + packaging/deb/postinst \ + packaging/deb/postrm \ + packaging/deb/preinst" + for file in ${file_list}; do + /usr/bin/perl packaging/common/substitute.pl \ + ${file}.src ${file} || exit 1 + done } do_resources() { @@ -102,27 +67,21 @@ do_resources() { rm -rf debian fi cp -Rf packaging/deb debian - if [ -d $AMVER ]; then - rm -rf $AMVER + if [ -d $BUILDDIR ]; then + rm -rf $BUILDDIR fi - mkdir $AMVER - cp -Rfp * $AMVER + mkdir -p $BUILDDIR + cp -Rfp * $BUILDDIR } do_package() { echo "Building package" - cd $AMVER + cd $BUILDDIR # Create unsigned packages dpkg-buildpackage -rfakeroot -uc -us } - -do_all() { - do_build $1 - do_resources $1 - do_package $1 -} - +do_substitute do_resources do_package