]> granicus.if.org Git - pdns/commitdiff
Build release packages properly
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 23 Dec 2015 08:23:36 +0000 (09:23 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 23 Dec 2015 13:13:47 +0000 (14:13 +0100)
build-aux/gen-version
build-scripts/build-auth-rpm
build-scripts/build-dnsdist-rpm
build-scripts/build-recursor-rpm

index cec0e70049d17d483c2e2bb57ce27dfefd57e229..5994683faa24ba33f504572d80abd6048c363317 100755 (executable)
@@ -10,7 +10,7 @@ if [ "${IS_RELEASE}" = "YES" ]; then
   TAG="$(git describe --tags --exact-match 2> /dev/null | cut -d- -f 2-)"
   if [ -n "${TAG}" ]; then
     # We're on a tag
-    echo "${TAG}${DIRTY}"
+    echo "${TAG}${DIRTY}" | tee .version
     exit 0
   fi
   echo 'This is not a tag, either tag this commit or do not set $IS_RELEASE' >&2
index d33ef89b94fab48cee9ea027d52d00b35d58b010..55409ba99d0302da5075a022255f431511c0c5f3 100755 (executable)
@@ -10,6 +10,10 @@ if [ -z "$VERSION" ]; then
   exit 1
 fi
 
+if [ -z "$TARBALLVERSION" ]; then
+  TARBALLVERSION=$VERSION
+fi
+
 if [ -z "$RELEASE" ];then
   echo 'Please set $RELEASE' >&2
   exit 1
@@ -22,10 +26,10 @@ set -x
 rpmdev-setuptree
 
 # This is somethat ugly...
-if [ -f pdns-${VERSION}.tar.bz2 ]; then
-  mv pdns-${VERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
+if [ -f pdns-${TARBALLVERSION}.tar.bz2 ]; then
+  mv pdns-${TARBALLVERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
 else
-  echo "pdns-${VERSION}.tar.bz2 not found" >&2
+  echo "pdns-${TARBALLVERSION}.tar.bz2 not found" >&2
   exit 1
 fi
 
@@ -49,7 +53,7 @@ Summary: A modern, advanced and high performance authoritative-only nameserver
 Group: System Environment/Daemons
 License: GPLv2
 URL: http://powerdns.com
-Source: ../%{name}-%{version}.tar.bz2
+Source: ../%{name}-${TARBALLVERSION}.tar.bz2
 
 Requires(pre): shadow-utils
 Requires(post): /sbin/chkconfig
@@ -144,7 +148,7 @@ BuildRequires: sqlite-devel
 This package contains the SQLite backend for %{name}
 
 %prep
-%setup -q
+%setup -q -n %{name}-${TARBALLVERSION}
 
 %build
 export CPPFLAGS="-DLDAP_DEPRECATED"
@@ -287,7 +291,7 @@ Summary: A modern, advanced and high performance authoritative-only nameserver
 Group: System Environment/Daemons
 License: GPLv2
 URL: http://powerdns.com
-Source: ../pdns-%{version}.tar.bz2
+Source: ../pdns-${TARBALLVERSION}.tar.bz2
 
 Requires(pre): shadow-utils
 Requires(post): systemd-sysv
@@ -408,7 +412,7 @@ BuildRequires: sqlite-devel
 This package contains the SQLite backend for %{name}
 
 %prep
-%setup -q
+%setup -q -n %{name}-${TARBALLVERSION}
 
 %build
 export CPPFLAGS="-DLDAP_DEPRECATED"
index aded5f533b7190d751a04662f8fb9f02df5f5195..843b0f37bd11e36701a9d5235f937c922250a2a0 100755 (executable)
@@ -10,6 +10,10 @@ if [ -z "$VERSION" ]; then
   exit 1
 fi
 
+if [ -z "$TARBALLVERSION" ]; then
+  TARBALLVERSION=${VERSION}
+fi
+
 if [ -z "$RELEASE" ];then
   echo 'Please set $RELEASE' >&2
   exit 1
@@ -22,10 +26,10 @@ set -x
 rpmdev-setuptree
 
 # This is somethat ugly...
-if [ -f dnsdist-${VERSION}.tar.bz2 ]; then
-  mv dnsdist-${VERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
+if [ -f dnsdist-${TARBALLVERSION}.tar.bz2 ]; then
+  mv dnsdist-${TARBALLVERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
 else
-  echo "dnsdist-${VERSION}.tar.bz2 not found" >&2
+  echo "dnsdist-${TARBALLVERSION}.tar.bz2 not found" >&2
   exit 1
 fi
 
@@ -44,7 +48,7 @@ DEFAULTS_INSTALL=''
 DEFAULTS_FILES=''
 
 # On some older distro's *cough* centos 6 *cough* autosetup fails
-SETUP='%autosetup -n %{name}-%{version}'
+SETUP="%autosetup -n %{name}-${TARBALLVERSION}"
 
 # Some setups need rpmbuild in a 'special' env
 RPMBUILD_COMMAND='rpmbuild -bb dnsdist.spec'
@@ -60,7 +64,7 @@ if [ -f /etc/redhat-release ]; then
       INIT_BUILDREQUIRES=''
       INIT_INSTALL='install -d -m 755 %{buildroot}/%{_initrddir} && install -m 755 contrib/dnsdist.init.centos6 %{buildroot}/%{_initrddir}/dnsdist'
       INIT_FILES='%{_initrddir}/dnsdist'
-      SETUP='%setup -n %{name}-%{version}'
+      SETUP="%setup -n %{name}-${TARBALLVERSION}"
       RPMBUILD_COMMAND="scl enable devtoolset-2 -- ${RPMBUILD_COMMAND}"
       ;;
     CentOS\ Linux\ *\ 7*)
@@ -81,7 +85,7 @@ Summary: Powerful and scriptable DNS loadbalancer
 License: GPLv2
 Vendor: PowerDNS.COM BV
 Group: System/DNS
-Source: dnsdist-${VERSION}.tar.bz2
+Source: dnsdist-${TARBALLVERSION}.tar.bz2
 BuildRequires: readline-devel
 BuildRequires: boost-devel
 BuildRequires: lua-devel
index 8d6c2dbbbdd1a727476a31fe350379c8f90049d9..07dd7193d66e2e1858d2772617caecf960148ad0 100755 (executable)
@@ -10,6 +10,10 @@ if [ -z "$VERSION" ]; then
   exit 1
 fi
 
+if [ -z "$TARBALLVERSION" ]; then
+  TARBALLVERSION=${VERSION}
+fi
+
 if [ -z "$RELEASE" ];then
   echo 'Please set $RELEASE' >&2
   exit 1
@@ -22,10 +26,10 @@ set -x
 rpmdev-setuptree
 
 # This is somethat ugly...
-if [ -f pdns-recursor-${VERSION}.tar.bz2 ]; then
-  mv pdns-recursor-${VERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
+if [ -f pdns-recursor-${TARBALLVERSION}.tar.bz2 ]; then
+  mv pdns-recursor-${TARBALLVERSION}.tar.bz2 $HOME/rpmbuild/SOURCES
 else
-  echo "pdns-recursor-${VERSION}.tar.bz2 not found" >&2
+  echo "pdns-recursor-${TARBALLVERSION}.tar.bz2 not found" >&2
   exit 1
 fi
 
@@ -112,7 +116,7 @@ Summary: Modern, advanced and high performance recursing/non authoritative name
 Group: System Environment/Daemons
 License: GPLv2
 URL: http://powerdns.com
-Source0: ../%{name}-%{version}.tar.bz2
+Source0: ../%{name}-${TARBALLVERSION}.tar.bz2
 Source1: pdns-recursor.init
 
 Provides: powerdns-recursor = %{version}-%{release}
@@ -129,9 +133,9 @@ PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
 package if you need a dns cache for your network.
 
 %prep
-%setup -q
-sed -i -e 's!SYSCONFDIR=/etc/powerdns!SYSCONFDIR=/etc/pdns-recursor!' -e 's!STRIP_BINARIES?=1!STRIP_BINARIES?=0!' $HOME/rpmbuild/BUILD/pdns-recursor-${VERSION}/Makefile.in
-sed -i -e 's!OS_SPECIFIC_INSTALL=.*!OS_SPECIFIC_INSTALL=!' $HOME/rpmbuild/BUILD/pdns-recursor-${VERSION}/sysdeps/Linux.inc
+%setup -q -n pdns-recursor-${TARBALLVERSION}
+sed -i -e 's!SYSCONFDIR=/etc/powerdns!SYSCONFDIR=/etc/pdns-recursor!' -e 's!STRIP_BINARIES?=1!STRIP_BINARIES?=0!' $HOME/rpmbuild/BUILD/pdns-recursor-${TARBALLVERSION}/Makefile.in
+sed -i -e 's!OS_SPECIFIC_INSTALL=.*!OS_SPECIFIC_INSTALL=!' $HOME/rpmbuild/BUILD/pdns-recursor-${TARBALLVERSION}/sysdeps/Linux.inc
 
 %build
 %configure
@@ -197,7 +201,7 @@ Summary: Modern, advanced and high performance recursing/non authoritative name
 Group: System Environment/Daemons
 License: GPLv2
 URL: http://powerdns.com
-Source0: ../%{name}-%{version}.tar.bz2
+Source0: ../%{name}-${TARBALLVERSION}.tar.bz2
 
 Provides: powerdns-recursor = %{version}-%{release}
 BuildRequires: boost-devel
@@ -216,9 +220,9 @@ PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
 package if you need a dns cache for your network.
 
 %prep
-%setup -q
-sed -i -e 's!SYSCONFDIR=/etc/powerdns!SYSCONFDIR=/etc/pdns-recursor!' -e 's!STRIP_BINARIES?=1!STRIP_BINARIES?=0!' $HOME/rpmbuild/BUILD/pdns-recursor-${VERSION}/Makefile.in
-sed -i -e 's!OS_SPECIFIC_INSTALL=.*!OS_SPECIFIC_INSTALL=!' $HOME/rpmbuild/BUILD/pdns-recursor-${VERSION}/sysdeps/Linux.inc
+%setup -q -n pdns-recursor-${TARBALLVERSION}
+sed -i -e 's!SYSCONFDIR=/etc/powerdns!SYSCONFDIR=/etc/pdns-recursor!' -e 's!STRIP_BINARIES?=1!STRIP_BINARIES?=0!' $HOME/rpmbuild/BUILD/pdns-recursor-${TARBALLVERSION}/Makefile.in
+sed -i -e 's!OS_SPECIFIC_INSTALL=.*!OS_SPECIFIC_INSTALL=!' $HOME/rpmbuild/BUILD/pdns-recursor-${TARBALLVERSION}/sysdeps/Linux.inc
 
 %build
 %configure