1) After repocopies:

o Use SUB_FILES infrastructure to full effect simplifying the
    port's Makefile logic.
    - Switch from files/amphetadesk.sh to files/amphetadesk.in
2) Bump PORTREVISION since there was a PLIST change due to the new
   rc.d script name.

PR:	117082 [1]
This commit is contained in:
Mario Sergio Fujikawa Ferreira 2007-12-25 19:52:37 +00:00
parent 63b7970a52
commit f50d495e0e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=204527
4 changed files with 9 additions and 75 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= amphetadesk
PORTVERSION= 0.93.1
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= www perl5
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -30,9 +30,15 @@ RUN_DEPENDS= \
${SITE_PERL}/URI/URL.pm:${PORTSDIR}/net/p5-URI
USE_PERL5= yes
USE_RC_SUBR= yes
USE_RC_SUBR= ${PORTNAME}
NO_BUILD= yes
# Add PERL substitution to SUB_LIST only if there is not already
# one listed
.if !defined(SUB_LIST) || ( defined(SUB_LIST) && !${SUB_LIST:MPERL} )
SUB_LIST+= PERL="${PERL}"
.endif
.ifndef(NOPORTDOCS)
PORTDOCS= \
*
@ -51,11 +57,6 @@ post-patch:
-e 's|%%DATADIR%%|${DATADIR}|' \
-e 's|%%DOCSDIR%%|${DOCSDIR}|' \
${WRKSRC}/lib/AmphetaDesk/Settings.pm
# rc.d
@${SED} \
-e 's|%%PREFIX%%|${PREFIX}|' \
-e "s|%%PERL%%|${PERL}|" \
${FILESDIR}/${PORTNAME}.sh > ${WRKDIR}/${PORTNAME}.sh
post-configure:
@${REINPLACE_CMD} -E \
@ -115,7 +116,5 @@ do-install:
${XARGS} -0 -x -n 10 -I {} \
${INSTALL_DATA} {} ${DATADIR}/{}
.endfor
# rc.d
@${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh ${PREFIX}/etc/rc.d
.include <bsd.port.mk>

View file

@ -16,7 +16,7 @@
#amphetadesk_pidfile=""
#
. /etc/rc.subr
. %%RC_SUBR%%
name="amphetadesk"
rcvar=`set_rcvar`

View file

@ -1,64 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
#
# Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org>
# PROVIDE: amphetadesk
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable amphetadesk:
#
#amphetadesk_enable="YES"
#amphetadesk_user=""
#amphetadesk_pidfile=""
#
. /etc/rc.subr
name="amphetadesk"
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/AmphetaDesk"
procname="%%PERL%%"
load_rc_config "${name}"
: ${amphetadesk_enable="NO"}
: ${amphetadesk_user=""}
if [ -n "${amphetadesk_user}" ]; then
eval realpath ~${amphetadesk_user} >/dev/null 2>&1 &&
amphetadesk_homedir="$(eval realpath ~${amphetadesk_user})"
fi
if [ -n "${amphetadesk_user}" -a -z "${amphetadesk_pidfile}" -a -n "${amphetadesk_homedir}" ]; then
amphetadesk_pidfile="${amphetadesk_homedir}/.${name}/AmphetaDesk.pid"
fi
pidfile="${amphetadesk_pidfile:-${HOME}/.${name}/AmphetaDesk.pid}"
start_cmd="start_cmd"
start_precmd="amphetadesk_check_vars"
stop_precmd="amphetadesk_check_vars"
status_precmd="amphetadesk_check_vars"
amphetadesk_check_vars()
{
if [ -z "${amphetadesk_user}" ]; then
amphetadesk_user=$(whoami)
fi
if [ "x${amphetadesk_user}" = "xroot" ]; then
err 1 "You have to set amphetadesk_user to a non-root user for security reasons"
fi
}
start_cmd()
{
su -l ${amphetadesk_user} \
-c "env PIDFILE=${pidfile} ${command} &"
}
run_rc_command "$1"

View file

@ -1,6 +1,5 @@
bin/AmphetaDesk
bin/AmphetaDesk-real
etc/rc.d/amphetadesk.sh
%%SITE_PERL%%/AmphetaDesk/AmphetaDesk.pm
%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/Channels.pm
%%SITE_PERL%%/AmphetaDesk/AmphetaDesk/ChannelsList.pm