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

commit 4eff0d97cbf7235113f12ff7d93ba202cf9f89da
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Tue Sep 20 00:54:33 2011 +0200

inetd-1.79s-8-i686

- add native systemd unit

diff --git a/source/network/inetd/FrugalBuild b/source/network/inetd/FrugalBuild
index fd4379d..81b3a8c 100644
--- a/source/network/inetd/FrugalBuild
+++ b/source/network/inetd/FrugalBuild
@@ -4,20 +4,21 @@

pkgname=inetd
pkgver=1.79s
-pkgrel=7
+pkgrel=8
pkgdesc="Internet super-server - ported from OpenBSD"
url="http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/inetd/";
rurl="http://ftp.frugalware.org/pub/other/sources/inetd/";
groups=('network')
archs=('i686' 'x86_64' 'ppc')
-depends=('glibc')
+depends=('systemd')
backup=('etc/inetd.conf')
up2date="lynx -dump $rurl|Flasttar"
-source=($rurl/$pkgname-$pkgver.tar.gz inetd.conf rc.inetd gcc4X.patch)
+source=($rurl/$pkgname-$pkgver.tar.gz inetd.conf rc.inetd gcc4X.patch 
inetd.service)
sha1sums=('7f0a0e40ef5490b34d37e824075a5d1d0f129f7b' \
'6063540a59305869f5f36b23b8d5769b55b8547f' \
'506f59c066367d14667d60743024bf7444900594' \
-          '45ddd008658c41b09d4fc24bf673fb00590c4bf1')
+          '45ddd008658c41b09d4fc24bf673fb00590c4bf1' \
+          '4b45088ce7f8d36e5c680d59617d2a3ccd97633e')

build()
{
@@ -28,6 +29,7 @@ build()
Fexerel /usr/man/man8/inetd.8
Ffilerel ../inetd.conf /etc/inetd.conf
Frcd2
+       Ffile /lib/systemd/system/inetd.service
}

# optimization OK
diff --git a/source/network/inetd/inetd.install 
b/source/network/inetd/inetd.install
index b132598..f3f0646 100644
--- a/source/network/inetd/inetd.install
+++ b/source/network/inetd/inetd.install
@@ -1,9 +1,26 @@
post_install() {
-  chkconfig --add rc.inetd
+       chkconfig --add rc.inetd
+       systemctl enable inetd.service >/dev/null 2>&1
+}
+
+post_upgrade() {
+       systemctl daemon-reload >/dev/null 2>&1
+       # this can be removed after Frugalware-1.6
+       if [ `vercmp $2 1.79s-8` -lt 0 ] ; then
+               if chkconfig rc.inetd; then
+                       post_install
+               fi
+       fi
}

pre_remove() {
-  chkconfig --del rc.inetd
+       chkconfig --del rc.inetd
+       systemctl --no-reload disable inetd.service >/dev/null 2>&1
+       systemctl stop inetd.service >/dev/null 2>&1
+}
+
+post_remove() {
+       systemctl daemon-reload >/dev/null 2>&1
}

op=$1
diff --git a/source/network/inetd/inetd.service 
b/source/network/inetd/inetd.service
new file mode 100644
index 0000000..f416b1b
--- /dev/null
+++ b/source/network/inetd/inetd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Internet super-server daemon
+
+[Service]
+ExecStart=/usr/sbin/inetd
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
diff --git a/source/network/inetd/rc.inetd.new 
b/source/network/inetd/rc.inetd.new
deleted file mode 100644
index d54325f..0000000
--- a/source/network/inetd/rc.inetd.new
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# (c) 2005 Marcus Habermehl <bmh198...@yahoo.de>
-# (c) 2003 Vajna Miklos <vmik...@frugalware.org>
-# rc.inetd for FrugalWare
-# distributed under GPL License
-
-# chkconfig: 2345 26 50
-# description: Internet super-server - ported from OpenBSD
-
-source /lib/initscripts/functions
-TEXTDOMAIN=inetd
-
-actions=(restart start status stop)
-daemon=$"internet super-server daemon"
-
-pid="$(pidof inetd 2> /dev/null)"
-
-rc_start()
-{
-       start_msg
-       if [ -z ${pid} ] ; then
-               /usr/sbin/inetd
-               ok $?
-       else
-               ok 999
-       fi
-}
-
-rc_stop()
-{
-       stop_msg
-       if [ ! -z ${pid} ] ; then
-               killall inetd
-               ok $?
-       else
-               ok 999
-       fi
-}
-
-rc_exec $1
-
-# vim: ft=sh
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to