diff --git a/pkg/gentoo/files/sems.confd b/pkg/gentoo/files/sems.confd new file mode 100644 index 00000000..6b6ac9e5 --- /dev/null +++ b/pkg/gentoo/files/sems.confd @@ -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" + + diff --git a/pkg/gentoo/files/sems.rc6 b/pkg/gentoo/files/sems.rc6 new file mode 100644 index 00000000..4b09bd9d --- /dev/null +++ b/pkg/gentoo/files/sems.rc6 @@ -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 $? +} diff --git a/pkg/gentoo/sems-1.0.0_pre20080412.ebuild b/pkg/gentoo/sems-1.0.0_pre20080412.ebuild index 40a42190..90bedf05 100644 --- a/pkg/gentoo/sems-1.0.0_pre20080412.ebuild +++ b/pkg/gentoo/sems-1.0.0_pre20080412.ebuild @@ -21,15 +21,17 @@ DEPEND=">=media-libs/spandsp-0.0.4_pre18 >=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 }