Skip to content

Commit

Permalink
Fixes for the deb packaging
Browse files Browse the repository at this point in the history
* add prerm / postrm scripts
* fix osvcd stop when package is removed
* remove opt from chroot file list
  • Loading branch information
arnaudveron committed Mar 4, 2019
1 parent 0b8a019 commit 0752085
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/pkg/make.lib
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function prepare_chroot {

# purge unwanted files
rm -rf $CHROOT/opt/opensvc
rmdir $CHROOT/opt

cd $OSVC
$SUDO chown -Rh 0:0 $CHROOT/* || return 1
Expand Down
6 changes: 6 additions & 0 deletions bin/pkg/make_deb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ Provides: opensvc
Description: $SUMMARY
EOF

cp $PATH_SCRIPT/../preuninstall $CHROOT/DEBIAN/prerm
chmod 755 $CHROOT/DEBIAN/prerm

cp $PATH_SCRIPT/../postremove $CHROOT/DEBIAN/postrm
chmod 755 $CHROOT/DEBIAN/postrm

echo "$DESCRIPTION" | sed -e "s/^/ /" >>$CHROOT/DEBIAN/control

$SUDO chown -R root:root $CHROOT/DEBIAN
Expand Down
21 changes: 21 additions & 0 deletions bin/postremove
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

case "$1" in
purge)
rm -rf /var/lib/opensvc /var/log/opensvc /etc/opensvc /usr/share/opensvc
;;

upgrade|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
;;

*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac

#DEBHELPER#

exit 0
6 changes: 6 additions & 0 deletions bin/preuninstall
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ then
ARGS=0
fi

if [ $OSFLAVOR = 'Linux' -a $ARGS = 'remove' ]
then
ARGS=0
fi


if [ -z "$OSVC_ROOT_PATH" ]
then
FLAG=/var/lib/opensvc/postinstall.restart
Expand Down

0 comments on commit 0752085

Please sign in to comment.