1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Rework to use the newer USE_RC_SUBR method

PR:		119873
Submitted by:	ade
Approved by:	oliver (maintainer)
This commit is contained in:
Ade Lovett 2008-01-27 00:04:46 +00:00
parent 4d0bfa30e4
commit 9a2d43fbcb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=206272
6 changed files with 4 additions and 198 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= courier-imap PORTNAME= courier-imap
PORTVERSION= 4.3.0 PORTVERSION= 4.3.0
PORTREVISION= 1
PORTEPOCH= 2 PORTEPOCH= 2
CATEGORIES= mail ipv6 CATEGORIES= mail ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
@ -22,7 +23,9 @@ USE_BZIP2= yes
USE_PERL5= yes USE_PERL5= yes
GNU_CONFIGURE= yes GNU_CONFIGURE= yes
USE_GMAKE= yes USE_GMAKE= yes
USE_RC_SUBR= yes USE_RC_SUBR= courier-imap-imapd courier-imap-imapd-ssl \
courier-imap-pop3d courier-imap-pop3d-ssl
CPPFLAGS+= -I${LOCALBASE}/include -I${PREFIX}/include CPPFLAGS+= -I${LOCALBASE}/include -I${PREFIX}/include
LDFLAGS+= -L${LOCALBASE}/lib -L${PREFIX}/lib LDFLAGS+= -L${LOCALBASE}/lib -L${PREFIX}/lib
@ -49,12 +52,10 @@ OPTIONS= FAM "Build in fam support for IDLE command" off \
.endif .endif
CONFDIR?= ${PREFIX}/etc/${PORTNAME} CONFDIR?= ${PREFIX}/etc/${PORTNAME}
RCDIR?= ${PREFIX}/etc/rc.d
USERDB?= ${PREFIX}/etc/userdb USERDB?= ${PREFIX}/etc/userdb
LIBEXECDIR?= ${PREFIX}/libexec/${PORTNAME} LIBEXECDIR?= ${PREFIX}/libexec/${PORTNAME}
USE_OPENSSL= yes USE_OPENSSL= yes
PLIST_SUB= CONFDIR=${CONFDIR:S,^${PREFIX}/,,} \ PLIST_SUB= CONFDIR=${CONFDIR:S,^${PREFIX}/,,} \
RCDIR=${RCDIR:S,^${PREFIX}/,,} \
LIBEXECDIR=${LIBEXECDIR:S,^${PREFIX}/,,} LIBEXECDIR=${LIBEXECDIR:S,^${PREFIX}/,,}
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@ -101,8 +102,6 @@ CONFIGURE_ARGS+=--without-ipv6
CONFIGURE_ARGS+=--with-trashquota CONFIGURE_ARGS+=--with-trashquota
.endif .endif
RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
.if defined(WITH_FAM) .if defined(WITH_FAM)
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="${LDFLAGS}" LDFLAGS="${LDFLAGS}"
@ -140,11 +139,6 @@ post-install:
.for i in imapd pop3d .for i in imapd pop3d
${INSTALL_DATA} ${WRKSRC}/imap/${i}.cnf ${CONFDIR}/${i}.cnf.dist ${INSTALL_DATA} ${WRKSRC}/imap/${i}.cnf ${CONFDIR}/${i}.cnf.dist
.endfor .endfor
.for i in imapd imapd-ssl pop3d pop3d-ssl
${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
${FILESDIR}/courier-imap-${i}.sh > ${WRKDIR}/courier-imap-${i}.sh
${INSTALL_SCRIPT} ${WRKDIR}/courier-imap-${i}.sh ${RCDIR}/courier-imap-${i}.sh
.endfor
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR} @${MKDIR} ${DOCSDIR}
.for a in ${EXTRA_DOCS} .for a in ${EXTRA_DOCS}

View File

@ -1,46 +0,0 @@
#!/bin/sh
#
# An rc.subr-style startup script for Courier-IMAP's IMAP over SSL service.
# PROVIDE: courier_imap_imapd_ssl
# REQUIRE: LOGIN courier_authdaemond
# KEYWORD: shutdown
# Define these courier_imap_imapd_ssl_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/courier_imap_imapd_ssl
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
courier_imap_imapd_ssl_enable=${courier_imap_imapd_ssl_enable-"NO"}
. %%RC_SUBR%%
name="courier_imap_imapd_ssl"
rcvar=`set_rcvar`
command="%%PREFIX%%/libexec/courier-imap/imapd-ssl.rc"
pidfile="/var/run/imapd-ssl.pid"
procname="%%PREFIX%%/sbin/courierlogger"
start_cmd="imapd_ssl_cmd start"
stop_cmd="imapd_ssl_cmd stop"
restart_cmd="imapd_ssl_cmd stop && imapd_ssl_cmd start"
load_rc_config $name
imapd_ssl_cmd () {
case $1 in
start)
echo "Starting ${name}."
${command} start
;;
stop)
echo "Stopping ${name}."
${command} stop
;;
esac
}
run_rc_command "$1"

View File

@ -1,46 +0,0 @@
#!/bin/sh
#
# An rc.subr-style startup script for Courier-IMAP's IMAP service.
# PROVIDE: courier_imap_imapd
# REQUIRE: LOGIN courier_authdaemond
# KEYWORD: shutdown
# Define these courier_imap_imapd_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/courier_imap_imapd
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
courier_imap_imapd_enable=${courier_imap_imapd_enable-"NO"}
. %%RC_SUBR%%
name="courier_imap_imapd"
rcvar=`set_rcvar`
command="%%PREFIX%%/libexec/courier-imap/imapd.rc"
pidfile="/var/run/imapd.pid"
procname="%%PREFIX%%/sbin/courierlogger"
start_cmd="imapd_cmd start"
stop_cmd="imapd_cmd stop"
restart_cmd="imapd_cmd stop && imapd_cmd start"
load_rc_config $name
imapd_cmd () {
case $1 in
start)
echo "Starting ${name}."
${command} start
;;
stop)
echo "Stopping ${name}."
${command} stop
;;
esac
}
run_rc_command "$1"

View File

@ -1,46 +0,0 @@
#!/bin/sh
#
# An rc.subr-style startup script for Courier-IMAP's POP3 over SSL service.
# PROVIDE: courier_imap_pop3d_ssl
# REQUIRE: LOGIN courier_authdaemond
# KEYWORD: shutdown
# Define these courier_imap_pop3d_ssl_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/courier_imap_pop3d_ssl
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
courier_imap_pop3d_ssl_enable=${courier_imap_pop3d_ssl_enable-"NO"}
. %%RC_SUBR%%
name="courier_imap_pop3d_ssl"
rcvar=`set_rcvar`
command="%%PREFIX%%/libexec/courier-imap/pop3d-ssl.rc"
pidfile="/var/run/pop3d-ssl.pid"
procname="%%PREFIX%%/sbin/courierlogger"
start_cmd="pop3d_ssl_cmd start"
stop_cmd="pop3d_ssl_cmd stop"
restart_cmd="pop3d_ssl_cmd stop && pop3d_ssl_cmd start"
load_rc_config $name
pop3d_ssl_cmd () {
case $1 in
start)
echo "Starting ${name}."
${command} start
;;
stop)
echo "Stopping ${name}."
${command} stop
;;
esac
}
run_rc_command "$1"

View File

@ -1,46 +0,0 @@
#!/bin/sh
#
# An rc.subr-style startup script for Courier-IMAP's POP3 service.
# PROVIDE: courier_imap_pop3d
# REQUIRE: LOGIN courier_authdaemond
# KEYWORD: shutdown
# Define these courier_imap_pop3d_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/courier_imap_pop3d
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
courier_imap_pop3d_enable=${courier_imap_pop3d_enable-"NO"}
. %%RC_SUBR%%
name="courier_imap_pop3d"
rcvar=`set_rcvar`
command="%%PREFIX%%/libexec/courier-imap/pop3d.rc"
pidfile="/var/run/pop3d.pid"
procname="%%PREFIX%%/sbin/courierlogger"
start_cmd="pop3d_cmd start"
stop_cmd="pop3d_cmd stop"
restart_cmd="pop3d_cmd stop && pop3d_cmd start"
load_rc_config $name
pop3d_cmd () {
case $1 in
start)
echo "Starting ${name}."
${command} start
;;
stop)
echo "Stopping ${name}."
${command} stop
;;
esac
}
run_rc_command "$1"

View File

@ -22,10 +22,6 @@ bin/pop3d
%%CONFDIR%%/pop3d.dist %%CONFDIR%%/pop3d.dist
@exec %%LOCALBASE%%/share/sysconftool/sysconftool %D/%%CONFDIR%%/pop3d.dist @exec %%LOCALBASE%%/share/sysconftool/sysconftool %D/%%CONFDIR%%/pop3d.dist
%%CONFDIR%%/quotawarnmsg.example %%CONFDIR%%/quotawarnmsg.example
%%RCDIR%%/courier-imap-imapd.sh
%%RCDIR%%/courier-imap-imapd-ssl.sh
%%RCDIR%%/courier-imap-pop3d.sh
%%RCDIR%%/courier-imap-pop3d-ssl.sh
%%LIBEXECDIR%%/couriertcpd %%LIBEXECDIR%%/couriertcpd
%%LIBEXECDIR%%/imapd-ssl.rc %%LIBEXECDIR%%/imapd-ssl.rc
%%LIBEXECDIR%%/imapd.rc %%LIBEXECDIR%%/imapd.rc