]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Rename and modernize the build-recursor script
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 13 Apr 2015 10:09:04 +0000 (12:09 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 10 Jun 2015 07:44:01 +0000 (09:44 +0200)
build-scripts/build-recursor-semistatic [moved from build-scripts/build-recursor with 61% similarity]
build-scripts/dist-recursor

similarity index 61%
rename from build-scripts/build-recursor
rename to build-scripts/build-recursor-semistatic
index 27208bbd8999fcde2ed08b4e06b8deb83e2af754..9c56bc735c3161484d7745bb1c96d7ab270951fd 100755 (executable)
@@ -1,34 +1,53 @@
 #!/bin/sh
-set -e
-set -x
+if [ "$0" != "./build-scripts/build-recursor-semistatic" ]; then
+  echo "Please run me from the root checkout dir" >&2
+  exit 1
+fi
 
 if [ -z "$VERSION" ]; then
-  VERSION=$(git describe --always --dirty=+ 2>/dev/null || true)
-  if [ -z "$VERSION" ]; then
-    VERSION="UNKNOWN"
-  else
-    VERSION="git-"$VERSION
-  fi
-else
-  VERSION=$1
+  echo 'Please set $VERSION' >&2
+  exit 1
+fi
+
+if [ -z "$RELEASE" ];then
+  echo 'Please set $RELEASE' >&2
+  exit 1
 fi
 
-DIST_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)"
+if [ -z "$DISTDIR" ]; then
+  DISTDIR=pdns
+fi
+
+set -e
+set -x
 
 export DEBFULLNAME="PowerDNS.COM BV"
 export DEBEMAIL="noreply@powerdns.com"
 DEBPKGNAME=pdns-recursor_$VERSION
 
+cd $DISTDIR
+
 dh_make -s -f ../pdns-recursor-$VERSION.tar.bz2 -p $DEBPKGNAME < /dev/null
 cp pdns-recursor.init.d debian/init.d
 #[ -e debian/control ] || dh_make -e powerdns.support@powerdns.com -s -r cdbs  -f ../pdns-recursor-$VERSION.tar.bz2  < /dev/null
 perl -i -pe 's/Description: <.*>/Description: extremely powerful and versatile recursing nameserver/' debian/control
 # only to be nice to people usind the generated .dsc
 perl -i -pe 's/(Build-Depends: .*)/$1, libboost-dev, libboost-serialization-dev, liblua5.2-0-dev/' debian/control
+
+cat > debian/changelog << EOF
+pdns-recursor (${VERSION}-${RELEASE}) unstable; urgency=medium
+
+  * Automatic build
+
+ -- PowerDNS.COM AutoBuilder <noreply@powerdns.com>  $(date -R)
+
+EOF
+
 # Fix the rpm version number
 perl -i -pe "s/Version: .*/Version: ${VERSION}/" pdns-recursor.spec
+perl -i -pe "s/Release: .*/Release: ${RELEASE}/" pdns-recursor.spec
 export LUA=1
 export STATIC=semi
-./configure
 fakeroot debian/rules binary
+./configure
 fakeroot rpmbuild -bb pdns-recursor.spec
index e719e41df4e3498f93b1532e9b02f4e8c177def2..dc61002667ca3e7834fe2255cebcb37c0c05791b 100755 (executable)
@@ -7,6 +7,15 @@ if [ "$0" != "./build-scripts/dist-recursor" ]; then
   exit 1
 fi
 
+if [ -z "$VERSION" ]; then
+  VERSION=$(./build-aux/gen-version)
+  if [ -z "$VERSION" ]; then
+    VERSION="UNKNOWN"
+  fi
+fi
+
+set -x
+
 cd pdns
 
 ragel dnslabeltext.rl -o dnslabeltext.cc
@@ -16,15 +25,6 @@ pandoc -s -t man manpages/pdns_recursor.1.md -o pdns_recursor.1
 pandoc -s -t man manpages/rec_control.1.md -o rec_control.1
 cd -
 
-if [ -z "$VERSION" ]; then
-  VERSION=$(git describe --always --dirty=+ 2>/dev/null || true)
-  if [ -z "$VERSION" ]; then
-    VERSION="UNKNOWN"
-  else
-    VERSION="git-"$VERSION
-  fi
-fi
-
 DIST_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)"
 
 INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
@@ -81,7 +81,7 @@ cp powerdns-example-script.lua $DIRNAME
 mkdir -p $DIRNAME/contrib
 cp ../contrib/systemd-pdns-recursor.service $DIRNAME/contrib
 mkdir -p $DIRNAME/build-scripts/redhat
-cp ../build-scripts/build-recursor $DIRNAME/build-scripts
+cp ../build-scripts/build-recursor-semistatic $DIRNAME/build-scripts
 cp ../build-scripts/redhat/pdns-recursor-test.spec $DIRNAME/build-scripts/redhat
 cp pdns-recursor.spec $DIRNAME