diff options
-rwxr-xr-x | gen-package | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/gen-package b/gen-package new file mode 100755 index 0000000..dcb2c0b --- /dev/null +++ b/gen-package @@ -0,0 +1,48 @@ +#!/bin/sh + +set -e + +git_version() +{ + local date rev + + date=`git log --date=iso|sed --silent \ + 's/^Date:\s*\([0-9]*\)-\([0-9]*\)-\([0-9]*\) [0-9]*.*/\1\2\3/p'|sort| + tail -1` + + rev=`git log --date=iso|sed --silent \ + 's/^Date:\s*\([0-9]*\)-\([0-9]*\)-\([0-9]*\) [0-9]*.*/\1\2\3/p'| + grep $date|wc -l` + + printf "%s" $date-$rev +} + +CONTROL='Package: go-webbrowser-launcher +Version: '`git_version`' +Maintainer: cos <cos> +Description: Wrapper script to conveniently(sic?) launch web browsers. +Section: base +Priority: Optional +Essential: no +Architecture: all' + +version=`echo "$CONTROL"|sed --silent 's/^Version: //p'` +package=`echo "$CONTROL"|sed --silent 's/^Package: //p'` +builddir=`mktemp -d` +find . -name ${package}_${version}.deb| + grep ${package}_${version}.deb || +{ + mkdir --parent ${builddir}/${package}_${version}/DEBIAN/ + echo "$CONTROL" > ${builddir}/${package}_${version}/DEBIAN/control + mkdir --parent ${builddir}/${package}_${version}/usr/bin/ + cp go ${builddir}/${package}_${version}/usr/bin + mkdir --parent \ + ${builddir}/${package}_${version}/usr/lib/go-webbrowser-launcher + cp enforce-configurations \ + ${builddir}/${package}_${version}/usr/lib/go-webbrowser-launcher + ( cd ${builddir}; dpkg-deb --build ${package}_${version} ) + + debsigs --sign=origin --default-key='|cos|' \ + ${builddir}/${package}_${version}.deb + mv ${builddir}/${package}_${version}.deb . +} |