mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
+ Embrace rcNG. (1)
+ Only install default configuration file if it does not exist. (2) PR: ports/70390 (2) Submitted by: Andy Miller via MAINTAINER <dd at FreeBSD dot org> (1) Dryice Liu <dryice at liu dot com dot cn> (2) Approved by: MAINTAINER timeout.
This commit is contained in:
parent
5e17ef3d03
commit
3745885086
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=117550
3 changed files with 22 additions and 42 deletions
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
PORTNAME= dictd
|
PORTNAME= dictd
|
||||||
PORTVERSION= 1.9.11
|
PORTVERSION= 1.9.11
|
||||||
PORTREVISION= 0
|
PORTREVISION= 1
|
||||||
CATEGORIES+= net textproc
|
CATEGORIES+= net textproc
|
||||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||||
MASTER_SITE_SUBDIR= dict
|
MASTER_SITE_SUBDIR= dict
|
||||||
|
@ -20,6 +20,7 @@ MAN1= dictzip.1
|
||||||
MAN8= dictd.8
|
MAN8= dictd.8
|
||||||
|
|
||||||
USE_LIBLTDL= yes
|
USE_LIBLTDL= yes
|
||||||
|
USE_RC_SUBR= yes
|
||||||
USE_REINPLACE= yes
|
USE_REINPLACE= yes
|
||||||
USE_BISON= yes
|
USE_BISON= yes
|
||||||
USE_LIBTOOL_VER=13
|
USE_LIBTOOL_VER=13
|
||||||
|
@ -47,7 +48,8 @@ post-install:
|
||||||
.for i in example.conf example.dictrc example.site example2.conf example3.conf
|
.for i in example.conf example.dictrc example.site example2.conf example3.conf
|
||||||
${INSTALL_DATA} ${WRKSRC}/$i ${DATADIR}
|
${INSTALL_DATA} ${WRKSRC}/$i ${DATADIR}
|
||||||
.endfor
|
.endfor
|
||||||
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.conf > ${PREFIX}/etc/${PORTNAME}.conf
|
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.conf > ${PREFIX}/etc/${PORTNAME}.conf.sample
|
||||||
|
@[ -f ${PREFIX}/etc/${PORTNAME}.conf ] || ${CP} ${PREFIX}/etc/${PORTNAME}.conf.sample ${PREFIX}/etc/${PORTNAME}.conf
|
||||||
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.sh > ${PREFIX}/etc/rc.d/${PORTNAME}.sh
|
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/${PORTNAME}.sh > ${PREFIX}/etc/rc.d/${PORTNAME}.sh
|
||||||
@${CHMOD} +x ${PREFIX}/etc/rc.d/${PORTNAME}.sh
|
@${CHMOD} +x ${PREFIX}/etc/rc.d/${PORTNAME}.sh
|
||||||
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${PKGMESSAGE}
|
@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${PKGMESSAGE}
|
||||||
|
|
|
@ -1,44 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
#
|
||||||
|
# PROVIDE: dictd
|
||||||
|
# REQUIRE: DAEMON
|
||||||
|
# KEYWORD: FreeBSD
|
||||||
|
#
|
||||||
|
# Add the following line to /etc/rc.conf to enable dictd:
|
||||||
|
#
|
||||||
|
# dictd_enable="YES"
|
||||||
|
#
|
||||||
|
|
||||||
SOCKSTAT=/usr/bin/sockstat
|
. /etc/rc.subr
|
||||||
GREP=/usr/bin/grep
|
|
||||||
AWK=/usr/bin/awk
|
|
||||||
ECHO=/bin/echo
|
|
||||||
CAT=/bin/cat
|
|
||||||
KILL=/bin/kill
|
|
||||||
RM=/bin/rm
|
|
||||||
|
|
||||||
DICTD=%%PREFIX%%/sbin/dictd
|
name=dictd
|
||||||
|
rcvar=`set_rcvar`
|
||||||
|
command=%%PREFIX%%/sbin/dictd
|
||||||
|
|
||||||
# DICTD_OPTIONS="-put -command_line -options -for -dictd -here"
|
load_rc_config $name
|
||||||
DICTD_OPTIONS=""
|
run_rc_command "$1"
|
||||||
|
|
||||||
DICTD_PID_FILE=/var/run/dictd.pid
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
if [ -x $DICTD ]; then
|
|
||||||
${ECHO} -n " dictd"
|
|
||||||
$DICTD $DICTD_OPTIONS
|
|
||||||
${ECHO} `${SOCKSTAT} | ${GREP} dictd | ${AWK} '{print $3}'` > ${DICTD_PID_FILE}
|
|
||||||
else
|
|
||||||
${ECHO} "dictd.sh: cannot find $DICTD or it's not executable"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
if [ ! -f $DICTD_PID_FILE ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
dictdpid=`${CAT} $DICTD_PID_FILE`
|
|
||||||
if [ "$dictdpid" -gt 0 ]; then
|
|
||||||
${ECHO} -n " dictd"
|
|
||||||
${KILL} -15 $dictdpid 2>&1 > /dev/null
|
|
||||||
fi
|
|
||||||
${RM} -f $DICTD_PID_FILE
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: dictd.sh { start | stop }"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ share/dictd/example.dictrc
|
||||||
share/dictd/example.site
|
share/dictd/example.site
|
||||||
share/dictd/example2.conf
|
share/dictd/example2.conf
|
||||||
share/dictd/example3.conf
|
share/dictd/example3.conf
|
||||||
etc/dictd.conf
|
@unexec if cmp -s %D/etc/dictd.conf %D/etc/dictd.conf.sample; then rm -f %D/etc/dictd.conf; fi
|
||||||
|
etc/dictd.conf.sample
|
||||||
|
@exec [ -f %B/dictd.conf ] || cp %B/%f %B/dictd.conf
|
||||||
etc/rc.d/dictd.sh
|
etc/rc.d/dictd.sh
|
||||||
@dirrm share/dictd
|
@dirrm share/dictd
|
||||||
|
|
Loading…
Add table
Reference in a new issue