Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=d4df17ca3b27d85052f9d765c813483f062621a9

commit d4df17ca3b27d85052f9d765c813483f062621a9
Author: James Buren <[email protected]>
Date:   Wed Jun 6 03:50:47 2012 -0500

openntpd-3.9p1-13-x86_64
* convert to use systemd schema

diff --git a/source/network-extra/openntpd/FrugalBuild 
b/source/network-extra/openntpd/FrugalBuild
index 951e9e6..13cb864 100644
--- a/source/network-extra/openntpd/FrugalBuild
+++ b/source/network-extra/openntpd/FrugalBuild
@@ -4,7 +4,7 @@

pkgname=openntpd
pkgver=3.9p1
-pkgrel=12
+pkgrel=13
pkgdesc="A free, easy to use implementation of the Network Time Protocol."
url="http://www.openntpd.org/";
groups=('network-extra')
@@ -23,6 +23,9 @@ 
source=(ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$pkgname-$pkgver.tar.gz \
07-ntpd-manpage-enhance.patch \
08-adjtimex.patch.patch  \
09-syslog.patch)
+_F_systemd_scriptlet="$pkgname.install"
+_F_systemd_units=($pkgname=e)
+Finclude systemd

build()
{
@@ -35,10 +38,12 @@ build()
Fmkdir lib/systemd/system/
Finstall 0644 $pkgname.service /lib/systemd/system/$pkgname.service
Ffile openntpd.sysconfig /etc/sysconfig/openntpd
+       Fgenscriptlet
}
+
sha1sums=('098a435d02886a9e4d34afb15b15fde795eda1e9' \
'e075ca43eaf618944bbc9655e07ae36ec279b074' \
-          'da498ca69421f23688fe9f27cc6091c46592d1d0' \
+          'b67566511114818b18febe938fa29495d07ccec1' \
'ecbd82864eb15321d7602f3369634bcf30c851ff' \
'b4407419b85cb1d82e56134cda70fc3de9096cfd' \
'00a3f064b6c5be3ea11d48df825789363c9ec45f' \
diff --git a/source/network-extra/openntpd/openntpd.install 
b/source/network-extra/openntpd/openntpd.install
index a79f82c..618b51f 100644
--- a/source/network-extra/openntpd/openntpd.install
+++ b/source/network-extra/openntpd/openntpd.install
@@ -1,4 +1,6 @@
-# arg 1:  the new package version
+sysvinit_units=(@_F_sysvinit_units@)
+systemd_units=(@_F_systemd_units@)
+
post_install()
{
if ! grep -q '^_ntp:' /etc/group ; then
@@ -7,15 +9,56 @@ post_install()
if ! grep -q '^_ntp:' /etc/passwd ; then
useradd -u 29 -g 29 -s /sbin/nologin -c "OpenNTP daemon" -d /var/empty/ntpd _ntp
fi
+
+       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()
+{
+       for i in ${sysvinit_units[@]}; do
+               chkconfig --del rc.$i >/dev/null 2>&1
+       done
+
+       systemctl daemon-reload >/dev/null 2>&1
}

-# arg 1:  the old package version
pre_remove()
{
userdel _ntp >/dev/null 2>&1
groupdel _ntp >/dev/null 2>&1
-       # disable the service in case the user would enable it manually
-       chkconfig --del rc.ntpd >/dev/null 2>&1
+
+       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 2>&1
}

op=$1
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to