Author: sayer
Date: 2008-04-13 14:42:04 +0200 (Sun, 13 Apr 2008)
New Revision: 885

Added:
   trunk/pkg/gentoo/files/
   trunk/pkg/gentoo/files/sems.confd
   trunk/pkg/gentoo/files/sems.rc6
Modified:
   trunk/pkg/gentoo/sems-1.0.0_pre20080412.ebuild
Log:
added init scripts

Added: trunk/pkg/gentoo/files/sems.confd
===================================================================
--- trunk/pkg/gentoo/files/sems.confd   2008-04-13 11:53:03 UTC (rev 884)
+++ trunk/pkg/gentoo/files/sems.confd   2008-04-13 12:42:04 UTC (rev 885)
@@ -0,0 +1,24 @@
+# /etc/conf.d/sems: config file for /etc/init.d/sems
+
+# sems configuration file
+#SEMS_CFG_FILE="/etc/sems/sems.conf"
+
+# user to run sems as
+#SEMS_USER="sems"
+
+# group to run sems as
+#SEMS_GROUP="sems"
+
+# sems pidfile
+#SEMS_PIDFILE="/var/run/sems.pid"
+
+# set to true if you want to create core files
+#SEMS_CREATE_CORE="true"
+
+# path to use for core files
+#SEMS_COREDIR="/var/cores"
+
+# must be absolute path
+#SEMS_BINARY="/usr/sbin/sems"
+
+

Added: trunk/pkg/gentoo/files/sems.rc6
===================================================================
--- trunk/pkg/gentoo/files/sems.rc6     2008-04-13 11:53:03 UTC (rev 884)
+++ trunk/pkg/gentoo/files/sems.rc6     2008-04-13 12:42:04 UTC (rev 885)
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+#
+
+depend() {
+       use logger dns
+       need net
+}
+
+SEMS_CFG_FILE=${SEMS_CFG_FILE:-/etc/sems/sems.conf}
+SEMS_PIDFILE=${SEMS_PIDFILE:-/var/run/sems.pid}
+SEMS_CREATE_CORE=${SEMS_CREATE_CORE:-true}
+SEMS_COREDIR=${SEMS_COREDIR:-/var/core}
+SEMS_BINARY=${SEMS_BINARY:-/usr/sbin/sems}
+
+checkconfig() {
+       if [ ! -f "${SEMS_CFG_FILE}" ] ; then
+               eerror "You need a "${SEMS_CFG_FILE}" file to run sems"
+               return 1;
+       fi
+}
+
+
+start() {
+    local myopts=""
+
+    [ "${SEMS_USER}" != "" ] && \
+       myopts="${myopts} -u ${SEMS_USER}"
+
+    [ "${SEMS_GROUP}" != "" ] && \
+       myopts="${myopts} -g ${SEMS_GROUP}"
+
+
+    checkconfig || return 1
+
+    if test "$SEMS_CREATE_CORE" = "true" ; then
+       # directory for the core dump files
+       [ -d $SEMS_COREDIR ] || mkdir $SEMS_COREDIR
+       chmod 777 $SEMS_COREDIR
+       echo "$SEMS_COREDIR/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
+       ulimit -c unlimited
+    fi
+
+    ebegin "Starting ${SVCNAME}"
+       start-stop-daemon --start --exec "${SEMS_BINARY}" \
+           --pidfile "${SEMS_PIDFILE}" \
+           -- \
+           -f "${SEMS_CFG_FILE}" \
+           ${myopts} 
+    eend $?
+}
+
+stop() {
+       if [ "${RC_CMD}" = "restart" ] ; then
+               checkconfig || return 1
+       fi
+
+       ebegin "Stopping ${SVCNAME}"
+       start-stop-daemon --stop --exec "${SEMS_BINARY}" \
+           --pidfile "${SEMS_PIDFILE}" --quiet
+       eend $?
+}

Modified: trunk/pkg/gentoo/sems-1.0.0_pre20080412.ebuild
===================================================================
--- trunk/pkg/gentoo/sems-1.0.0_pre20080412.ebuild      2008-04-13 11:53:03 UTC 
(rev 884)
+++ trunk/pkg/gentoo/sems-1.0.0_pre20080412.ebuild      2008-04-13 12:42:04 UTC 
(rev 885)
@@ -21,15 +21,17 @@
        >=dev-lang/python-2.4.4-r4"
 
 src_compile () {
-    if [ -x ./configure ]; then
-        econf
-    fi
-    if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
-        emake PREFIX=/usr RELEASE=${PVR} || die "emake failed"
-    fi
+       if [ -x ./configure ]; then
+               econf
+       fi
+       if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
+               emake PREFIX=/usr RELEASE=${PVR} || die "emake failed"
+       fi
 }
 
 src_install () {
        emake PREFIX=/usr cfg-target="/etc/sems/" DESTDIR="${D}" install || die
+       newinitd "${FILESDIR}"/sems.rc6 sems
+       newconfd "${FILESDIR}"/sems.confd sems
        dodoc README
 }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to