summaryrefslogtreecommitdiff
path: root/support/dktools/debian-jessie-build-deb.sh
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/debian-jessie-build-deb.sh
Initial commit
Diffstat (limited to 'support/dktools/debian-jessie-build-deb.sh')
-rwxr-xr-xsupport/dktools/debian-jessie-build-deb.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/support/dktools/debian-jessie-build-deb.sh b/support/dktools/debian-jessie-build-deb.sh
new file mode 100755
index 0000000000..056c075b34
--- /dev/null
+++ b/support/dktools/debian-jessie-build-deb.sh
@@ -0,0 +1,73 @@
+#! /bin/sh
+
+umask 022
+
+VERSION=`cat version.txt`
+
+# Make sure to run the script as unprivileged user
+
+if [ "X$LOGNAME" = "Xroot" ]
+then
+ echo 'ERROR: This script must not be run as root!'
+ exit 1
+fi
+
+
+# Make sure we are in the correct directory
+
+if [ "X$VERSION" = "X" ]
+then
+ echo 'ERROR: Failed to find version number!'
+ echo 'Make sure to call this script in the correct directory!'
+ exit 1
+fi
+
+
+# Make sure the original archive is still in the parent directory
+
+if [ ! -f ../dktools-${VERSION}.tar.gz ]
+then
+ echo 'ERROR: File' ../dktools-${VERSION}.tar.gz 'not found!'
+ exit 1
+fi
+
+
+# Create a .orig copy of the original archive
+
+if [ -f ../dktools_${VERSION}.orig.tar.gz ]
+then
+ rm -f ../dktools_${VERSION}.orig.tar.gz
+fi
+ln ../dktools-${VERSION}.tar.gz ../dktools_${VERSION}.orig.tar.gz
+
+
+# The 'debian' subdirectory must be present
+
+if [ ! -d debian ]
+then
+ echo 'ERROR: Missing directory debian!'
+ exit 1
+fi
+
+
+# Build the package, save output for later inspection
+
+if [ "X$DEB_SIGN_KEYID" != "X" ]
+then
+ dpkg-buildpackage 2>&1 | tee ../dpkg-buildpackage.out
+else
+ dpkg-buildpackage -us -uc 2>&1 | tee ../dpkg-buildpackage.out
+fi
+
+# Finally list the created packages and show some notes
+
+echo 'If the dpkg-buildpackage command succeeded, you should find the'
+echo '*.deb archive in the parent directory.'
+echo ''
+ls -l ../dktools*${VERSION}*.deb
+echo ''
+echo 'Otherwise you should inspect the ../dpkg-buildpackage.out file'
+echo 'for error messages.'
+echo ''
+
+exit 0