.build.sh 622 Bytes
Newer Older
root's avatar
root committed
1
2
3
#!/bin/bash

# This script generates a .deb package
4
BUILD_DEPS=$(grep 'Build-Depends' package/debian/control | cut -d' ' -f2- | tr ', ' ' ' | sed -E "s/ \((>|<|=)+[0-9]\)//g")
5
apt-get update && apt-get install -y devscripts "${BUILD_DEPS}"
root's avatar
root committed
6
7
8

CHANGELOG="package/debian/changelog"
LINE=$(head -n 1 $CHANGELOG)
9
10
11
PACKAGE=$(echo "$LINE" | cut -d' ' -f1)
VERSION=$(echo "$LINE" | cut -d' ' -f2 | grep -o -E '[0-9]*\.[0-9]*\.[0-9]*')
tar --exclude=debian -czf "${PACKAGE}_${VERSION}.orig.tar.gz" package/*
root's avatar
root committed
12

13
cd package || exit 1
14
debuild -us -uc --lintian-opts --profile debian
15
cd ../ || exit 1
root's avatar
root committed
16
17

mkdir build/
18
mv "${PACKAGE}"* build/