From 39b89e62ccae9624591d612e972c1de02760d290 Mon Sep 17 00:00:00 2001 From: flz Date: Mon, 30 May 2005 20:39:23 +0000 Subject: - rcNG'ify the port. PR: ports/81624 Submitted by: Denis Shaposhnikov --- irc/ircd-ru/Makefile | 12 ++++-------- irc/ircd-ru/files/ircd.sh.in | 32 ++++++++++++++++++++++++++++++++ irc/ircd-ru/files/ircd.sh.sample | 23 ----------------------- irc/ircd-ru/files/pkg-message.in | 16 ++++++++++++++++ irc/ircd-ru/pkg-message | 17 ----------------- irc/ircd-ru/pkg-plist | 4 ---- 6 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 irc/ircd-ru/files/ircd.sh.in delete mode 100644 irc/ircd-ru/files/ircd.sh.sample create mode 100644 irc/ircd-ru/files/pkg-message.in delete mode 100644 irc/ircd-ru/pkg-message (limited to 'irc') diff --git a/irc/ircd-ru/Makefile b/irc/ircd-ru/Makefile index 3a1884b14f7a..df0c14c64e26 100644 --- a/irc/ircd-ru/Makefile +++ b/irc/ircd-ru/Makefile @@ -7,7 +7,7 @@ PORTNAME= ircd-ru PORTVERSION= 1.0.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= irc russian MASTER_SITES= ftp://ftp.ircd.ru/pub/ircd-RU/ ftp://ftp.ircd.ru/pub/ircd-RU/old/ DISTNAME= ircd-RU-${PORTVERSION}-02-stable @@ -18,7 +18,8 @@ COMMENT= An irc daemon with translation schemes and other useful features USE_BZIP2= yes GNU_CONFIGURE= yes USE_REINPLACE= yes -PKGMESSAGE= ${WRKSRC}/pkg-message +SUB_FILES= pkg-message +USE_RC_SUBR= ircd.sh VARDIR= /var PLIST_SUB= VARDIR=${VARDIR} @@ -94,12 +95,7 @@ pre-install: @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL post-install: - @${INSTALL_SCRIPT} -m 555 ${FILESDIR}/ircd.sh.sample ${PREFIX}/etc/rc.d - @${CHOWN} -R ircd:ircd ${PREFIX}/etc/ircd-ru ${DATADIR} ${VARDIR}/log/ircd-ru ${VARDIR}/run/ircd-ru -.if !defined(NOPORTDOCS) - @${CHOWN} -R ircd:ircd ${DOCSDIR} -.endif - @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' pkg-message > ${PKGMESSAGE} + @${CHOWN} -R ircd:ircd ${VARDIR}/log/ircd-ru @${CAT} ${PKGMESSAGE} .include diff --git a/irc/ircd-ru/files/ircd.sh.in b/irc/ircd-ru/files/ircd.sh.in new file mode 100644 index 000000000000..0b9baab1f854 --- /dev/null +++ b/irc/ircd-ru/files/ircd.sh.in @@ -0,0 +1,32 @@ +#! /bin/sh + +# +# PROVIDE: ircd +# +# Add the fellowing line to /etc/rc.conf to enable ircd: +# +# ircd_enable="YES" +# + +. "%%RC_SUBR%%" + +name=ircd +rcvar=`set_rcvar` + +command=/usr/local/sbin/ircd + +ircd_pidfile="/var/run/ircd-ru/ircd.pid" +ircd_required_files="/usr/local/etc/ircd-ru/ircd.conf /usr/local/etc/ircd-ru/ircd.motd /usr/local/etc/ircd-ru/ircd.smotd" +ircd_user="ircd" + +pidfile=${ircd_pidfile} +required_files=${ircd_required_files} + +ircd_precmd () { + /usr/bin/install -d -o ircd -g ircd /var/run/ircd-ru + eval `/usr/bin/limits -U ${ircd_user} -e` +} +start_precmd="ircd_precmd" + +load_rc_config ${name} +run_rc_command "$1" diff --git a/irc/ircd-ru/files/ircd.sh.sample b/irc/ircd-ru/files/ircd.sh.sample deleted file mode 100644 index 36d64efb43aa..000000000000 --- a/irc/ircd-ru/files/ircd.sh.sample +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -PREFIX=$(expr $0 : "\(/.*/\)etc/rc\.d/$(basename $0)\$") - -IRCD=${PREFIX}sbin/ircd - -case "$1" in -start) - if [ -x $IRCD ]; then - $IRCD -u ircd -g ircd >/dev/null 2>&1 - echo -n ' ircd' - fi - ;; -stop) - kill `cat /var/run/ircd-ru/ircd.pid` >/dev/null 2>&1 - echo -n ' ircd' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 diff --git a/irc/ircd-ru/files/pkg-message.in b/irc/ircd-ru/files/pkg-message.in new file mode 100644 index 000000000000..d9403b67d2d0 --- /dev/null +++ b/irc/ircd-ru/files/pkg-message.in @@ -0,0 +1,16 @@ + +---------------------------------------------------- + +ircd-RU has now been installed. + +This port create user ircd and group ircd + +You should now edit %%PREFIX%%/ircd-RU/etc/ircd.conf + to suit your needs. + (cp ircd.conf-dist ircd.conf; vi ircd.conf) + +You may then start the server by running: + echo "ircd_enable=\"YES\"" >> /etc/rc.conf + %%PREFIX%%/etc/rc.d/ircd.sh start + +---------------------------------------------------- diff --git a/irc/ircd-ru/pkg-message b/irc/ircd-ru/pkg-message deleted file mode 100644 index edfa042c48c2..000000000000 --- a/irc/ircd-ru/pkg-message +++ /dev/null @@ -1,17 +0,0 @@ - ----------------------------------------------------- - -ircd-RU has now been installed. - -This port create user ircd and group ircd - -You should now edit %%PREFIX%%/ircd-RU/etc/ircd.conf - to suit your needs. - (cp ircd.conf-dist ircd.conf; vi ircd.conf) - -You may then start the server by running: - cd %%PREFIX%%/etc/rc.d/ - mv ircd.sh.sample ircd.sh - %%PREFIX%%/etc/rc.d/ircd.sh start - ----------------------------------------------------- diff --git a/irc/ircd-ru/pkg-plist b/irc/ircd-ru/pkg-plist index 2029ffd2d6ab..89e1b9c55949 100644 --- a/irc/ircd-ru/pkg-plist +++ b/irc/ircd-ru/pkg-plist @@ -7,7 +7,6 @@ etc/ircd-ru/kline.conf etc/ircd-ru/ru_RU.CP1251/ircd.motd-dist etc/ircd-ru/ru_RU.CP1251/ircd.smotd-dist etc/ircd-ru/ru_RU.KOI8-R/ircd.conf-dist -etc/rc.d/ircd.sh.sample %%PORTDOCS%%%%DOCSDIR%%/README.Ilines %%PORTDOCS%%%%DOCSDIR%%/opers.txt %%PORTDOCS%%%%DOCSDIR%%/ru_RU.KOI8-R/FAQ @@ -27,8 +26,5 @@ etc/rc.d/ircd.sh.sample %%PORTDOCS%%@dirrm %%DOCSDIR%% @exec mkdir -m 755 %%VARDIR%%/log/ircd-ru @exec chown ircd:ircd %%VARDIR%%/log/ircd-ru -@exec mkdir -m 755 %%VARDIR%%/run/ircd-ru -@exec chown ircd:ircd %%VARDIR%%/run/ircd-ru -@unexec rm -R %%VARDIR%%/run/ircd-ru 2>&1 >/dev/null || true @unexec rm -R %%VARDIR%%/log/ircd-ru 2>&1 >/dev/null || true @unexec (rmdir %D/etc/ircd-ru && pw user del ircd) || echo 'To completely remove this port delete user ircd, group ircd and remove etc/ircd-ru' -- cgit