[beast: 13/41] MISC: make-deb.sh: adjust the DEBIAN/postinst binary path to include versioning
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 13/41] MISC: make-deb.sh: adjust the DEBIAN/postinst binary path to include versioning
- Date: Fri, 16 Jun 2017 10:23:53 +0000 (UTC)
commit 48b8abfec564aa429ff67eea1e20d44cd6cb6449
Author: Tim Janik <timj gnu org>
Date: Tue Jun 13 23:02:22 2017 +0200
MISC: make-deb.sh: adjust the DEBIAN/postinst binary path to include versioning
Signed-off-by: Tim Janik <timj gnu org>
misc/make-deb.sh | 35 +++++++++++++++++++++++++++++++++--
misc/postinst-deb.sh | 32 --------------------------------
2 files changed, 33 insertions(+), 34 deletions(-)
---
diff --git a/misc/make-deb.sh b/misc/make-deb.sh
index f3a4b7c..2a968f5 100755
--- a/misc/make-deb.sh
+++ b/misc/make-deb.sh
@@ -77,8 +77,9 @@ echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "AIDACC_DESTDIR=$AIDACC_DESTDIR"
echo "DEBIAN=$DEBIAN"
+BEASTEXE=$BEASTDIR/bin/beast
REBUILD=false
-[ -x $DESTDIR/opt/bin/beast ] || REBUILD=true
+[ -x $DESTDIR/$BEASTEXE ] || REBUILD=true
if $REBUILD ; then
# clone/update and build rapicorn
@@ -93,6 +94,7 @@ if $REBUILD ; then
git_clone $R beast
build_checked beast ./autogen.sh
fi
+[ -x $DESTDIR/$BEASTEXE ] || die "failed to build Beast executable: $BEASTEXE"
NAME="beast"
VERSION=$(./tmpdeb/beast/misc/mkbuildid.sh -p)
@@ -158,7 +160,36 @@ gzip -9 $DEBCHANGELOG
cp debian/copyright $DEBDOCDIR
# DEBIAN/postinst
-cp misc/postinst-deb.sh $DEBIAN/postinst
+cat <<-\__EOF |
+ #!/bin/bash
+ set -e
+ set_perms() {
+ USER="$1"; GROUP="$2"; MODE="$3"; FILE="$4"
+ # https://www.debian.org/doc/debian-policy/ch-files.html#s10.9.1
+ if ! dpkg-statoverride --list "$FILE" > /dev/null ; then
+ chown "$USER:$GROUP" "$FILE"
+ chmod "$MODE" "$FILE"
+ fi
+ }
+ # https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-mscriptsinstact
+ case "$1" in
+ configure)
+ # https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
+ set_perms root root 4755 @BEASTEXE@ # wrapper which does renice -20
+ # https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-ldconfig
+ ldconfig
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+ *)
+ # unkown action
+ exit 1
+ ;;
+ esac
+ exit 0
+__EOF
+sed "s|@BEASTEXE@|$BEASTEXE|g" > $DEBIAN/postinst
+chmod +x $DEBIAN/postinst
# https://wiki.debian.org/ReleaseGoals/LAFileRemoval
find $DEBIAN/../ -name '*.la' -delete
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]