summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-03-21 11:30:15 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-03-21 11:30:15 +0100
commit0fd5dedfaf107064d6ce9ea67654ff04b2860c8a (patch)
tree4ead14c0b372eac530d3e92ada2cd795666eb150
parent161a4f3f88a3f2d9172ee5a6086ad57602003a5f (diff)
downloadOSELAS.Toolchain-0fd5dedfaf107064d6ce9ea67654ff04b2860c8a.tar.gz
OSELAS.Toolchain-0fd5dedfaf107064d6ce9ea67654ff04b2860c8a.tar.xz
allow building toolchains for Ubuntu
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xdebian/bin/build.sh16
-rwxr-xr-xdebian/bin/gencontrol.sh7
2 files changed, 18 insertions, 5 deletions
diff --git a/debian/bin/build.sh b/debian/bin/build.sh
index 0bdcb86..51a7914 100755
--- a/debian/bin/build.sh
+++ b/debian/bin/build.sh
@@ -1,12 +1,22 @@
#!/bin/bash
+DIST="$(lsb_release -i -s)"
RELEASE="$(lsb_release -c -s)"
-VERSION="$(cat /etc/debian_version)"
-VERSION="${VERSION%%.*}"
+if [ "${DIST}" = "Debian" ]; then
+ VERSION="$(cat /etc/debian_version)"
+ VERSION="${VERSION%%.*}"
+ PREFIX="~deb"
+elif [ "${DIST}" = "Ubuntu" ]; then
+ VERSION="$(lsb_release -r -s)"
+ PREFIX="-ubuntu"
+else
+ echo "Unknown Distribution '${DIST}'"
+ exit 1
+fi
if ! [[ "${VERSION}" =~ .*/sid ]]; then
git checkout debian/changelog
- dch --local ~deb${VERSION}+ --distribution ${RELEASE} "Rebuild for ${RELEASE}" || exit
+ dch --local ${PREFIX}${VERSION}+ --distribution ${RELEASE} "Rebuild for ${RELEASE}" || exit
fi
debian/bin/gencontrol.sh "${@}"
diff --git a/debian/bin/gencontrol.sh b/debian/bin/gencontrol.sh
index b203cc1..0f54e9c 100755
--- a/debian/bin/gencontrol.sh
+++ b/debian/bin/gencontrol.sh
@@ -7,9 +7,12 @@ die() {
# This script assumes to have CWD = toplevel of OSELAS.Toolchain
test -f debian/changelog || die "debian/changelog not found"
-test "$(dpkg-vendor --query Vendor)" = "Debian" || die "This script only works on Debian"
+vendor="$(dpkg-vendor --query Vendor)"
+if [ "${vendor}" != "Debian" -a "${vendor}" != "Ubuntu" ]; then
+ die "This script only works on Debian"
+fi
-toolchain_version=$(dpkg-parsechangelog -SVersion | sed -e 's/-[^-]*$//')
+toolchain_version=$(dpkg-parsechangelog -SVersion | sed -e 's/-.*$//')
newcontrol=$(mktemp debian/control.XXXXXXXXX)
trap 'rm -v -- "$newcontrol"' INT QUIT EXIT