Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=771f7911598f1f91c672d41a62e9171c2d64e436
commit 771f7911598f1f91c672d41a62e9171c2d64e436 Author: James Buren <[email protected]> Date: Wed Jun 6 02:00:58 2012 -0500 fw32-0.8.7-2-x86_64 * convert to use systemd schema diff --git a/source/fw32-extra/fw32/FrugalBuild b/source/fw32-extra/fw32/FrugalBuild index 9733220..8f9e6ff 100644 --- a/source/fw32-extra/fw32/FrugalBuild +++ b/source/fw32-extra/fw32/FrugalBuild @@ -3,7 +3,7 @@ pkgname=fw32 pkgver=0.8.7 -pkgrel=1 +pkgrel=2 pkgdesc="A framework for maintaining an i686 environment on x86_64." url="http://www.frugalware.org" depends=('glibc' 'pacman-g2') @@ -13,5 +13,14 @@ up2date="Flasttar http://ftp.frugalware.org/pub/other/$pkgname" backup=('etc/fw32/pacman-g2.conf') source=(http://ftp.frugalware.org/pub/other/$pkgname/$pkgname-$pkgver.tar.xz) sha1sums=('4dce608cac3d33c83f7efb7a76639e83107aecfe') +_F_systemd_scriptlet="$pkgname.install" +_F_systemd_units=(fw32=) +Finclude systemd + +build() +{ + Fbuild + Fgenscriptlet +} # optimization OK diff --git a/source/fw32-extra/fw32/fw32.install b/source/fw32-extra/fw32/fw32.install index e6f3184..5fe0b65 100644 --- a/source/fw32-extra/fw32/fw32.install +++ b/source/fw32-extra/fw32/fw32.install @@ -1,19 +1,56 @@ +sysvinit_units=(@_F_sysvinit_units@) +systemd_units=(@_F_systemd_units@) + +post_install() +{ + local unit + local op + + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + + for i in ${systemd_units[@]}; do + unit=$(echo $i | cut -f 1 -d '=') + op=$(echo $i | cut -f 2 -d '=') + if echo $op | grep -q 'e'; then + systemctl enable $unit.service >/dev/null 2>&1 + fi + if echo $op | grep -q 's'; then + systemctl start $unit.service >/dev/null 2>&1 + fi + done +} + post_upgrade() { - [ "$1" == "$2" ] && return - systemctl daemon-reload &> /dev/null fw32-update &> /dev/null + + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + + systemctl daemon-reload >/dev/null 2>&1 } pre_remove() { - systemctl --no-reload disable fw32.service &> /dev/null - systemctl stop fw32.service &> /dev/null + local unit + + for i in ${sysvinit_units[@]}; do + chkconfig --del rc.$i >/dev/null 2>&1 + done + + for i in ${systemd_units[@]}; do + unit=$(echo $i | cut -f 1 -d '=') + systemctl --no-reload disable $unit.service >/dev/null 2>&1 + systemctl stop $unit.service >/dev/null 2>&1 + done } post_remove() { - systemctl daemon-reload &> /dev/null + systemctl daemon-reload >/dev/null 2>&1 } op=$1 _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
