From ccf30729fd18057759c18846c0c7284ba3ddf992 Mon Sep 17 00:00:00 2001 From: barner Date: Tue, 5 Sep 2006 07:20:39 +0000 Subject: - Use proper mechanisms for pkg-message and rc script Submitted by: Matthew Seaman (maintainer) PR: ports/102005 --- sysutils/fvcool/Makefile | 20 +++------------ sysutils/fvcool/files/fvcool.sh.in | 48 ++++++++++++++++++++++++++++++++++++ sysutils/fvcool/files/pkg-message.in | 21 ++++++++++++++++ sysutils/fvcool/pkg-message | 21 ---------------- sysutils/fvcool/scripts/fvcool.sh | 48 ------------------------------------ 5 files changed, 73 insertions(+), 85 deletions(-) create mode 100644 sysutils/fvcool/files/fvcool.sh.in create mode 100644 sysutils/fvcool/files/pkg-message.in delete mode 100644 sysutils/fvcool/pkg-message delete mode 100644 sysutils/fvcool/scripts/fvcool.sh (limited to 'sysutils') diff --git a/sysutils/fvcool/Makefile b/sysutils/fvcool/Makefile index d1b83f202486..1bf650465825 100644 --- a/sysutils/fvcool/Makefile +++ b/sysutils/fvcool/Makefile @@ -17,35 +17,23 @@ COMMENT= VCool for FreeBSD - Cooling software for AMD Athlon/Duron CPUs ONLY_FOR_ARCHS= i386 GNU_CONFIGURE= yes -USE_RC_SUBR= yes +USE_RC_SUBR= fvcool.sh +SUB_FILES= pkg-message +SUB_LIST+= "PORTNAME=${PORTNAME}" ALL_TARGET= fvcool PLIST_SUB+= DOCSDIR=${DOCSDIR:S,^${PREFIX}/,,} -MSG_FILE= ${PKGDIR}/pkg-message -PKGMESSAGE= ${WRKDIR}/pkg-message - -SED_SCRIPT= -e 's,%%RC_SUBR%%,${RC_SUBR},g' \ - -e 's,%%PORTNAME%%,${PORTNAME},g' \ - -e 's,%%PREFIX%%,${PREFIX},g' PORTDOCS= ReadMe ReadMe.jp ReadMe.tech_KT133 -PLIST_FILES= sbin/fvcool etc/rc.d/fvcool.sh +PLIST_FILES= sbin/fvcool post-patch: @${REINPLACE_CMD} -e 's|@CC@|& ${CFLAGS}|; \ s|-O3||g ; s| -s | |g' ${BUILD_WRKSRC}/Makefile.in -post-build: - @${SED} ${SED_SCRIPT} ${SCRIPTDIR}/${PORTNAME}.sh \ - > ${WRKDIR}/${PORTNAME}.sh - @${SED} ${SED_SCRIPT} ${MSG_FILE} \ - > ${PKGMESSAGE} - do-install: install-doc ${INSTALL_PROGRAM} ${WRKSRC}/fvcool ${PREFIX}/sbin/fvcool post-install: - @${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh \ - ${PREFIX}/etc/rc.d/${PORTNAME}.sh @${CAT} ${PKGMESSAGE} install-doc: diff --git a/sysutils/fvcool/files/fvcool.sh.in b/sysutils/fvcool/files/fvcool.sh.in new file mode 100644 index 000000000000..e33398997d47 --- /dev/null +++ b/sysutils/fvcool/files/fvcool.sh.in @@ -0,0 +1,48 @@ +#!/bin/sh +# +# @(#) $FreeBSD$ + +# PROVIDE: %%PORTNAME%% +# REQUIRE: LOGIN abi +# BEFORE: securelevel +# KEYWORD: shutdown + +# Add the following line to /etc/rc.conf to enable `%%PORTNAME%%': +# +#%%PORTNAME%%_enable="YES" +# +# Other rc.conf variables: +# +# %%PORTNAME%%_flags Set to "-v" for verbose mode. +# + +. %%RC_SUBR%% + +name="%%PORTNAME%%" +rcvar=`set_rcvar` + +command="%%PREFIX%%/sbin/%%PORTNAME%%" +command_args="-e" + +# %%PORTNAME%% is a command to be run during startup and shutdown, not a +# long running daemon process. There's no pidfile to check, and it's +# hard to tell if %%PORTNAME%% is enabled or not -- just run '%%PORTNAME%% -e' to +# force enable it, '%%PORTNAME%% -d' to disable. + +stop_cmd="stop_cmd" +stop_cmd() +{ + $command -d +} + +status_cmd="status_cmd" +status_cmd() +{ + echo "Can't check %%PORTNAME%% status" +} + +load_rc_config "$name" +: ${%%PORTNAME%%_enable="NO"} +: ${%%PORTNAME%%_flags=""} + +run_rc_command "$1" diff --git a/sysutils/fvcool/files/pkg-message.in b/sysutils/fvcool/files/pkg-message.in new file mode 100644 index 000000000000..b825562157ae --- /dev/null +++ b/sysutils/fvcool/files/pkg-message.in @@ -0,0 +1,21 @@ +===> How to enable the %%PORTNAME%% package + + If you want to invoke %%PORTNAME%% automatically on system startup, + add the following line to /etc/rc.conf: + + fvcool_enable="YES" + + See %%PREFIX%%/etc/rc.d/%%PORTNAME%%.sh for more details. + +===> WARNING + + This software can have a negative impact on system stability. In + particular while doing heavy duty work such as encoding music, + under certain conditions the system can freeze. + + Don't use this software in production or mission-critical + environments! + + Also note that this software is supposed to be used with AMD + Athlon (XP) an AMD Duron processors only. + diff --git a/sysutils/fvcool/pkg-message b/sysutils/fvcool/pkg-message deleted file mode 100644 index b825562157ae..000000000000 --- a/sysutils/fvcool/pkg-message +++ /dev/null @@ -1,21 +0,0 @@ -===> How to enable the %%PORTNAME%% package - - If you want to invoke %%PORTNAME%% automatically on system startup, - add the following line to /etc/rc.conf: - - fvcool_enable="YES" - - See %%PREFIX%%/etc/rc.d/%%PORTNAME%%.sh for more details. - -===> WARNING - - This software can have a negative impact on system stability. In - particular while doing heavy duty work such as encoding music, - under certain conditions the system can freeze. - - Don't use this software in production or mission-critical - environments! - - Also note that this software is supposed to be used with AMD - Athlon (XP) an AMD Duron processors only. - diff --git a/sysutils/fvcool/scripts/fvcool.sh b/sysutils/fvcool/scripts/fvcool.sh deleted file mode 100644 index e33398997d47..000000000000 --- a/sysutils/fvcool/scripts/fvcool.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# @(#) $FreeBSD$ - -# PROVIDE: %%PORTNAME%% -# REQUIRE: LOGIN abi -# BEFORE: securelevel -# KEYWORD: shutdown - -# Add the following line to /etc/rc.conf to enable `%%PORTNAME%%': -# -#%%PORTNAME%%_enable="YES" -# -# Other rc.conf variables: -# -# %%PORTNAME%%_flags Set to "-v" for verbose mode. -# - -. %%RC_SUBR%% - -name="%%PORTNAME%%" -rcvar=`set_rcvar` - -command="%%PREFIX%%/sbin/%%PORTNAME%%" -command_args="-e" - -# %%PORTNAME%% is a command to be run during startup and shutdown, not a -# long running daemon process. There's no pidfile to check, and it's -# hard to tell if %%PORTNAME%% is enabled or not -- just run '%%PORTNAME%% -e' to -# force enable it, '%%PORTNAME%% -d' to disable. - -stop_cmd="stop_cmd" -stop_cmd() -{ - $command -d -} - -status_cmd="status_cmd" -status_cmd() -{ - echo "Can't check %%PORTNAME%% status" -} - -load_rc_config "$name" -: ${%%PORTNAME%%_enable="NO"} -: ${%%PORTNAME%%_flags=""} - -run_rc_command "$1" -- cgit