summaryrefslogtreecommitdiff
path: root/packaging/ng/buildscripts/build-gnunet.sh
blob: 70fb1a8e4d8e58572f521bd666053fd4cc3e801d (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
41
#!/bin/sh
# This file is in the public domain.
# Helper script to build the latest DEB packages in the container.

set -eu
unset LD_LIBRARY_PATH

cd /pkgdir
dpkg-scanpackages . /dev/null | gzip -9c > /pkgdir/Packages.gz
echo "deb [trusted=yes] file:/pkgdir ./" >/etc/apt/sources.list.d/taler-packaging-local.list
apt-get update


mkdir -p /build
cd /build

TAG=${1:-master}

git clone --depth=1 git://git.gnunet.org/gnunet
cd gnunet
git checkout $TAG

# Get current version from debian/control file.
DEB_VERSION=$(dpkg-parsechangelog -S Version)

apt-cache show gnunet | grep "Version: $DEB_VERSION" >/dev/null && found=true || found=false
if [ $found = true ]; then
  echo "gnunet version $DEB_VERSION already built, skipping"
  exit 0
fi

# Install build-time dependencies.
mk-build-deps --install --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control

# We do a sparse checkout, so we need to hint
# the version to the build system.
echo $DEB_VERSION > .version
./bootstrap
dpkg-buildpackage -rfakeroot -b -uc -us

cp /build/*.deb /pkgdir/