summaryrefslogtreecommitdiffstats
path: root/tools/build-debian-package.sh
blob: 73231f0aecf8d00e9d4222057560ce695aa51f86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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