Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=ryuotesting2.git;a=commitdiff;h=4d4728b3b755ada81df4c1a1ce7236d94f6bdc05

commit 4d4728b3b755ada81df4c1a1ce7236d94f6bdc05
Author: James Buren <[email protected]>
Date:   Sun Jun 10 22:44:58 2012 -0500

acct-6.5.5-2-x86_64
* convert to systemd schema

diff --git a/source/apps-extra/acct/FrugalBuild 
b/source/apps-extra/acct/FrugalBuild
index f6ce15a..867e4e4 100644
--- a/source/apps-extra/acct/FrugalBuild
+++ b/source/apps-extra/acct/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=acct
pkgver=6.5.5
-pkgrel=1
+pkgrel=2
pkgdesc="Process accounting utilities"
url="http://www.gnu.org/software/acct/";
depends=('glibc')
@@ -11,11 +11,17 @@ groups=('apps-extra')
archs=('i686' 'x86_64')
Fup2gnugz
source=(http://ftp.gnu.org/pub/gnu/acct/$pkgname-$pkgver.tar.gz \
-       rc.acct rc.acct-{de,hu}.po)
+       rc.acct rc.acct-{de,hu}.po acct.service)
sha1sums=('907456b1dcf14c5079f834338e2de32cd7371a73' \
'f5bacf09ed811e38d0c3f3b808fec8d301607a3e' \
'd0e8f5ab9d94ee0e068d1acf7f4a9868c81943a8' \
-          '15cd39eaa42f8e61587d54bde87c891746ee4d96')
+          '15cd39eaa42f8e61587d54bde87c891746ee4d96' \
+          'c52f87cb1860be78d8ec20a4b7fe1db73c42742d')
+
+_F_systemd_scriptlet="$pkgname.install"
+_F_sysvinit_units=(acct)
+_F_systemd_units=(acct=)
+Finclude systemd

build()
{
@@ -28,6 +34,9 @@ build()

# conflicts with sysvinit
Frm /usr/{bin/last,man/man1/last.*,share/man/man1/last.*}
+
+       Ffile /lib/systemd/system/acct.service
+       Fgenscriptlet
}

# optimization OK
diff --git a/source/apps-extra/acct/acct.install 
b/source/apps-extra/acct/acct.install
new file mode 100644
index 0000000..22ad6fe
--- /dev/null
+++ b/source/apps-extra/acct/acct.install
@@ -0,0 +1,64 @@
+sysvinit_units=(@_F_sysvinit_units@)
+systemd_units=(@_F_systemd_units@)
+
+post_install()
+{
+       if [ ! -f /var/log/acct.log ]; then
+               echo -n "" > /var/log/acct.log
+       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()
+{
+       if [ ! -f /var/log/acct.log ]; then
+               echo -n "" > /var/log/acct.log
+       fi
+
+       for i in ${sysvinit_units[@]}; do
+               chkconfig --del rc.$i >/dev/null 2>&1
+       done
+
+       systemctl daemon-reload >/dev/null 2>&1
+}
+
+pre_remove()
+{
+       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
+shift
+$op $*
diff --git a/source/apps-extra/acct/acct.service 
b/source/apps-extra/acct/acct.service
new file mode 100644
index 0000000..6fcf771
--- /dev/null
+++ b/source/apps-extra/acct/acct.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=BSD Process Accounting
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/accton /var/log/acct.log
+ExecStop=/usr/sbin/accton off
+RemainAfterExit=yes
+Type=oneshot
+
+[Install]
+WantedBy=multi-user.target
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to