]> git.proxmox.com Git - mirror_frr.git/commitdiff
tools: add a script for building a Debian package in one step.
authorDaniil Baturin <daniil@baturin.org>
Mon, 1 Oct 2018 18:38:44 +0000 (20:38 +0200)
committerDavid Lamparter <equinox@diac24.net>
Thu, 25 Oct 2018 15:30:21 +0000 (17:30 +0200)
The script simplifies the relatively lengthy procedure.
It should be invoked from the top level source directory, for example:
./tools/build-debian-package.sh

Signed-off-by: Daniil Baturin <daniil@baturin.org>
doc/developer/packaging-debian.rst
tools/build-debian-package.sh [new file with mode: 0755]
tools/subdir.am

index 66339b6d1f79d434b905e1a216e18e04b356ae7d..4ea784c0fcdf86196911f4869939d7481aa4470b 100644 (file)
@@ -130,6 +130,13 @@ If all worked correctly, then you should end up with the Debian packages under
 with the sources (``frr_*.orig.tar.gz``, ``frr_*.debian.tar.xz`` and
 ``frr_*.dsc``)
 
+The build procedure can also be executed automatically using the ``tools/build-debian-package.sh``
+script. For example:
+
+.. code-block:: shell
+
+   EXTRA_VERSION="-myversion" WANT_SNMP=1 WANT_CUMULUS_MODE=1 tools/build-debian-package.sh
+
 .. _deb-backports:
 
 Debian Backports
diff --git a/tools/build-debian-package.sh b/tools/build-debian-package.sh
new file mode 100755 (executable)
index 0000000..73231f0
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Written by Daniil Baturin, 2018
+# This file is public domain
+
+git diff-index --quiet HEAD || echo "Warning: git working directory is not clean!"
+
+# Set the defaults
+if [ "$EXTRA_VERSION" = "" ]; then
+    EXTRA_VERSION="-MyDebPkgVersion"
+fi
+
+if [ "$WANT_SNMP" = "" ]; then
+    WANT_SNMP=0
+fi
+
+if [ "$WANT_CUMULUS_MODE" = "" ]; then
+    WANT_CUMULUS_MODE=0
+fi
+
+echo "Preparing the build"
+./bootstrap.sh
+./configure --with-pkg-extra-version=$EXTRA_VERSION
+make dist
+
+echo "Preparing Debian source package"
+mv debianpkg debian
+make -f debian/rules backports
+
+echo "Unpacking the source to frrpkg/"
+mkdir frrpkg
+cd frrpkg
+tar xf ../frr_*.orig.tar.gz
+cd frr*
+. /etc/os-release
+tar xf ../../frr_*${ID}${VERSION_ID}*.debian.tar.xz
+
+echo "Building the Debian package"
+debuild --no-lintian --set-envvar=WANT_SNMP=$WANT_SNMP --set-envvar=WANT_CUMULUS_MODE=$WANT_CUMULUS_MODE -b -uc -us
+
index 602822e5897824536951737a1601bbc055c47e78..323d1222f9f4a0c5529b382126fdc8a710374475 100644 (file)
@@ -26,4 +26,5 @@ EXTRA_DIST += \
        tools/rrlookup.pl \
        tools/zc.pl \
        tools/zebra.el \
+       tools/build-debian-package.sh \
        # end