diff options
author | feld <feld@FreeBSD.org> | 2014-05-13 02:15:08 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2014-05-13 02:15:08 +0800 |
commit | b7ae8ab43482e6c3d5dabfd2789b26f9536ab776 (patch) | |
tree | fb39212acae5c655af038998003f67af152a322c /net-mgmt/devmon | |
parent | 01711c22ba234834851a42b53a75596de79cdaf1 (diff) | |
download | freebsd-ports-gnome-b7ae8ab43482e6c3d5dabfd2789b26f9536ab776.tar.gz freebsd-ports-gnome-b7ae8ab43482e6c3d5dabfd2789b26f9536ab776.tar.zst freebsd-ports-gnome-b7ae8ab43482e6c3d5dabfd2789b26f9536ab776.zip |
Support STAGE
Move pid dir creation to rc script
Clean up rc script a bit, add some consistency
change command_interpreter to /usr/local/bin/perl to avoid warnings
Sponsored by: SupraNet Communications, Inc
Diffstat (limited to 'net-mgmt/devmon')
-rw-r--r-- | net-mgmt/devmon/Makefile | 30 | ||||
-rw-r--r-- | net-mgmt/devmon/files/devmon.in | 31 | ||||
-rw-r--r-- | net-mgmt/devmon/pkg-plist | 1 |
3 files changed, 29 insertions, 33 deletions
diff --git a/net-mgmt/devmon/Makefile b/net-mgmt/devmon/Makefile index 877ef8f605ed..2576ac21b9a9 100644 --- a/net-mgmt/devmon/Makefile +++ b/net-mgmt/devmon/Makefile @@ -3,7 +3,7 @@ PORTNAME= devmon DISTVERSION= 0.3.1-beta1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net-mgmt MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${DISTVERSION} @@ -29,7 +29,6 @@ OPTIONS_DEFINE= MYSQL REINPLACE_ARGS= -i '' -NO_STAGE= yes .include <bsd.port.options.mk> .if ${PORT_OPTIONS:MMYSQL} @@ -43,23 +42,22 @@ pre-install: (cd ${WRKSRC} && ${MV} devmon.cfg devmon.cfg.dist) do-install: - ${INSTALL} -d ${PREFIX}/devmon - ${INSTALL} -d ${PREFIX}/devmon/modules - ${INSTALL_SCRIPT} ${WRKSRC}/devmon ${PREFIX}/devmon/ - ${INSTALL_DATA} ${WRKSRC}/devmon.cfg.dist ${PREFIX}/devmon/ - (cd ${WRKSRC}/modules && ${COPYTREE_SHARE} \* ${PREFIX}/devmon/modules/) + ${INSTALL} -d ${STAGEDIR}/${PREFIX}/devmon + ${INSTALL} -d ${STAGEDIR}/${PREFIX}/devmon/modules + ${INSTALL_SCRIPT} ${WRKSRC}/devmon ${STAGEDIR}/${PREFIX}/devmon/ + ${INSTALL_DATA} ${WRKSRC}/devmon.cfg.dist ${STAGEDIR}/${PREFIX}/devmon/ + (cd ${WRKSRC}/modules && ${COPYTREE_SHARE} \* ${STAGEDIR}/${PREFIX}/devmon/modules/) post-install: .if ${PORT_OPTIONS:MDOCS} - ${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/CHANGELOG ${DOCSDIR}/ - ${INSTALL_DATA} ${WRKSRC}/COPYING ${DOCSDIR}/ - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/ - ${INSTALL} -d ${DOCSDIR}/docs - ${INSTALL} -d ${DOCSDIR}/extras - ${INSTALL} -d -o ${USERS} -g ${GROUPS} /var/run/devmon - (cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* ${DOCSDIR}/docs/) - (cd ${WRKSRC}/extras && ${COPYTREE_SHARE} \* ${DOCSDIR}/extras/) + ${MKDIR} ${STAGEDIR}/${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/CHANGELOG ${STAGEDIR}/${DOCSDIR}/ + ${INSTALL_DATA} ${WRKSRC}/COPYING ${STAGEDIR}/${DOCSDIR}/ + ${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}/${DOCSDIR}/ + ${INSTALL} -d ${STAGEDIR}/${DOCSDIR}/docs + ${INSTALL} -d ${STAGEDIR}/${DOCSDIR}/extras + (cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DOCSDIR}/docs/) + (cd ${WRKSRC}/extras && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DOCSDIR}/extras/) .endif .include <bsd.port.mk> diff --git a/net-mgmt/devmon/files/devmon.in b/net-mgmt/devmon/files/devmon.in index a39ab64dda4b..78e3dce487ab 100644 --- a/net-mgmt/devmon/files/devmon.in +++ b/net-mgmt/devmon/files/devmon.in @@ -13,13 +13,13 @@ load_rc_config ${name} : ${devmon_enable:=NO} : ${devmon_config="%%PREFIX%%/devmon/devmon.cfg"} : ${devmon_db="%%PREFIX%%/devmon/hosts.db"} -: ${devmon_pid="/var/run/devmon/devmon.pid"} +: ${devmon_pid=/var/run/devmon/devmon.pid} : ${devmon_user="%%USERS%%"} : ${devmon_group="%%GROUPS%%"} command="%%PREFIX%%/devmon/devmon" command_args="-c ${devmon_config} -d ${devmon_db}" -command_interpreter=/usr/bin/perl +command_interpreter=/usr/local/bin/perl pidfile=${devmon_pid} start_precmd=devmon_startprecmd @@ -35,8 +35,7 @@ devmon_startprecmd() fi TEMPLATESDIR=%%PREFIX%%/devmon/templates - if [ ! -e ${TEMPLATESDIR} ] - then + if [ ! -e ${TEMPLATESDIR} ]; then echo "" echo " ERROR: no templates exist. Please install device templates" echo " to: ${TEMPLATESDIR}" @@ -45,43 +44,43 @@ devmon_startprecmd() echo "" echo " # svn co svn://svn.code.sf.net/p/devmon/code/trunk/templates ${TEMPLATESDIR}" echo "" - exit 1; + exit 1; fi DEVMONLOG=$(grep "^LOGFILE=" ${devmon_config} | awk -F '=' '{print $2}') - if [ ! -e ${DEVMONLOG} ]; - then + if [ ! -e ${DEVMONLOG} ]; then install -o devmon -g devmon /dev/null ${DEVMONLOG} fi + + if [ ! -d /var/run/devmon ]; then + install -o devmon -g devmon /dev/null /var/run/devmon + fi } devmon_statuscmd() { - if [ ! -e ${pidfile} ]; - then + if [ ! -e ${pidfile} ]; then echo "pidfile does not exist. ${name} is not running?"; - exit 1; + exit 1; fi - if pgrep -F ${pidfile} >/dev/null; - then + if pgrep -F ${pidfile} >/dev/null; then echo "${name} is running."; else echo "${name} is not running."; - exit 1; + exit 1; fi } devmon_stopcmd() { - if pgrep -F ${pidfile} >/dev/null; - then + if pgrep -F ${pidfile} >/dev/null; then mypid=`cat ${pidfile}`; kill ${sig_stop} ${mypid}; wait_for_pids ${mypid}; else echo "${name} is not running."; - exit 1; + exit 1; fi } diff --git a/net-mgmt/devmon/pkg-plist b/net-mgmt/devmon/pkg-plist index f26ce6ddde9a..974f864fe46f 100644 --- a/net-mgmt/devmon/pkg-plist +++ b/net-mgmt/devmon/pkg-plist @@ -25,7 +25,6 @@ devmon/devmon %%PORTDOCS%%%%DOCSDIR%%/CHANGELOG @dirrm devmon/modules @dirrmtry devmon -@unexec rmdir /var/run/devmon %%PORTDOCS%%@dirrm %%DOCSDIR%%/extras %%PORTDOCS%%@dirrm %%DOCSDIR%%/docs %%PORTDOCS%%@dirrm %%DOCSDIR%% |