diff options
author | Jimmy Olgeni <olgeni@FreeBSD.org> | 2004-06-19 20:58:44 +0000 |
---|---|---|
committer | Jimmy Olgeni <olgeni@FreeBSD.org> | 2004-06-19 20:58:44 +0000 |
commit | 16ebae5b9aff8663b6944ad835fc8018ac8ced4c (patch) | |
tree | 950bc5b26718cd5fbcfe6bd3836a84d6411c8dec | |
parent | 2998f14b5b245241bf5b971d65978788bad1b3bd (diff) | |
download | ports-16ebae5b9aff8663b6944ad835fc8018ac8ced4c.tar.gz ports-16ebae5b9aff8663b6944ad835fc8018ac8ced4c.zip |
Use rc.subr.
Notes
Notes:
svn path=/head/; revision=111831
-rw-r--r-- | sysutils/usermin/Makefile | 47 | ||||
-rw-r--r-- | sysutils/usermin/files/patch-setup.sh | 20 | ||||
-rw-r--r-- | sysutils/usermin/files/usermin.sh.in | 43 | ||||
-rw-r--r-- | sysutils/usermin/files/usermin.sh.sample | 43 | ||||
-rw-r--r-- | sysutils/usermin/pkg-message | 4 | ||||
-rw-r--r-- | sysutils/usermin/pkg-plist | 9 | ||||
-rw-r--r-- | sysutils/usermin/scripts/pre-configure | 15 | ||||
-rw-r--r-- | sysutils/webmin/Makefile | 23 | ||||
-rw-r--r-- | sysutils/webmin/files/patch-aa | 69 | ||||
-rw-r--r-- | sysutils/webmin/files/webmin.sh.in | 45 | ||||
-rw-r--r-- | sysutils/webmin/files/webmin.sh.sample | 45 | ||||
-rw-r--r-- | sysutils/webmin/pkg-descr | 2 | ||||
-rw-r--r-- | sysutils/webmin/pkg-message | 4 | ||||
-rw-r--r-- | sysutils/webmin/pkg-plist | 8 | ||||
-rw-r--r-- | sysutils/webmin/scripts/pre-configure | 15 |
15 files changed, 196 insertions, 196 deletions
diff --git a/sysutils/usermin/Makefile b/sysutils/usermin/Makefile index ae72de91f4ba..a02493a5ae8f 100644 --- a/sysutils/usermin/Makefile +++ b/sysutils/usermin/Makefile @@ -7,7 +7,7 @@ PORTNAME= usermin PORTVERSION= 1.080 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://www.webmin.com/uupdates/ \ ${MASTER_SITE_SOURCEFORGE} @@ -23,7 +23,8 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/SSLeay.pm:${PORTSDIR}/security/p5-Net NO_BUILD= yes USE_PERL5= yes -SCRIPTS_ENV+= WRKDIR="${WRKDIR}" +USE_RC_SUBR= yes +USE_REINPLACE= yes USERMIN_MODULES=quota-1.080-1.wbm.gz @@ -36,27 +37,33 @@ post-extract: ${TAR} --unlink -xzf ${DISTDIR}/$${usermin_module} -C ${WRKSRC}; \ done; \ fi - @${FIND} ${WRKSRC} -name "*.orig" -or -name "*.bak" | ${XARGS} ${RM} + +post-patch: + @${REINPLACE_CMD} -e "s=%%PREFIX%%=${PREFIX}=" ${WRKSRC}/setup.sh + @${FIND} ${WRKSRC} -name "*.cgi" -print \ + | ${XARGS} ${REINPLACE_CMD} -e "s@/usr/local/bin/perl@${PERL}@" + @${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} + @${FIND} ${WRKSRC} -name "*.bak" -print | ${XARGS} ${RM} +# we may have 2 levels of empty directories which cause the plist generation +# system to fail + @${FIND} ${WRKSRC} -type d -empty -print | ${XARGS} ${RMDIR} + @${FIND} ${WRKSRC} -type d -empty -print | ${XARGS} ${RMDIR} do-install: @${MKDIR} ${PREFIX}/lib/usermin @${CP} -r ${WRKSRC}/* ${PREFIX}/lib/usermin -# we may have 2 levels of empty directories which cause the plist generation -# system to fail - @cd ${PREFIX}/lib/usermin && ${FIND} . -type d -empty -print \ - | ${XARGS} ${RMDIR} - @cd ${PREFIX}/lib/usermin && ${FIND} . -type d -empty -print \ - | ${XARGS} ${RMDIR} - @${CP} ${WRKDIR}/usermin.sh ${PREFIX}/etc/rc.d/usermin.sh-dist - @${CHMOD} 554 ${PREFIX}/etc/rc.d/usermin.sh-dist + @${SED} -e "s=%%RC_SUBR%%=${RC_SUBR}=" \ + -e "s=%%PREFIX%%=${PREFIX}=" \ + -e "s=%%PERL5%%=${PERL}=" \ + < ${FILESDIR}/usermin.sh.sample > ${PREFIX}/etc/rc.d/usermin.sh + @${CHMOD} 555 ${PREFIX}/etc/rc.d/usermin.sh post-install: - @cd ${PREFIX} ; ${FIND} lib/usermin -type f -o -type l | ${SORT} \ - > ${WRKDIR}/PLIST.lib-usermin - @cd ${PREFIX} ; ${FIND} lib/usermin -type d | ${SORT} -r \ - | ${SED} -e 's/^/@dirrm /g' \ - >> ${WRKDIR}/PLIST.lib-usermin - + @cd ${WRKSRC} ; ${FIND} * -type f -o -type l | ${SORT} | ${AWK} \ + '{ print "lib/usermin/" $$1 }' > ${WRKDIR}/PLIST.lib-usermin + @cd ${WRKSRC} ; ${FIND} * -type d | ${SORT} -r | ${AWK} \ + '{ print "lib/usermin/" $$1 }' | ${SED} -e 's/^/@dirrm /g' \ + >> ${WRKDIR}/PLIST.lib-webmin @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script @${ECHO_CMD} "/Insert PLIST.lib-usermin" >> ${WRKDIR}/ex.script @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script @@ -64,12 +71,6 @@ post-install: @${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script @${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-usermin @cd ${WRKDIR} ; ex < ex.script -# stop usermin if configured and enabled at startup - @[ -n "${BATCH}" ] || ([ ! -d ${PREFIX}/etc/usermin ] || [ ! -x ${PREFIX}/etc/rc.d/usermin.sh ] || ${PREFIX}/etc/rc.d/usermin.sh stop > /dev/null) -# upgrade configuration if etc/usermin exists - @[ ! -d ${PREFIX}/etc/usermin ] || ${ECHO_CMD} | nostart=Y ${PREFIX}/lib/usermin/setup.sh -# run interactive setup if not in BATCH mode and no configuration exists - @[ -n "${BATCH}" ] || ([ -d ${PREFIX}/etc/usermin ] || nostart=Y ${PREFIX}/lib/usermin/setup.sh) @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/sysutils/usermin/files/patch-setup.sh b/sysutils/usermin/files/patch-setup.sh index c0f683ed6a10..4616de21cc68 100644 --- a/sysutils/usermin/files/patch-setup.sh +++ b/sysutils/usermin/files/patch-setup.sh @@ -1,20 +1,20 @@ $FreeBSD$ ---- setup.sh.orig Sat Jan 31 10:52:05 2004 -+++ setup.sh Sat Jan 31 10:55:35 2004 +--- setup.sh.orig Fri Jun 4 01:18:07 2004 ++++ setup.sh Sat Jun 19 21:59:35 2004 @@ -84,12 +84,12 @@ echo "Unless you want to run multiple versions of Usermin at the same time" echo "you can just accept the defaults." echo "" -printf "Config file directory [/etc/usermin]: " -+printf "Config file directory [!!PREFIX!!/etc/usermin]: " ++printf "Config file directory [%%PREFIX%%/etc/usermin]: " if [ "$config_dir" = "" ]; then read config_dir fi if [ "$config_dir" = "" ]; then - config_dir=/etc/usermin -+ config_dir=!!PREFIX!!/etc/usermin ++ config_dir=%%PREFIX%%/etc/usermin fi abspath=`echo $config_dir | grep "^/"` if [ "$abspath" = "" ]; then @@ -38,9 +38,17 @@ $FreeBSD$ echo "Perl 5 interpreter on your system." echo "" - if [ -x /usr/bin/perl ]; then -+ if [ -x !!PERL!! ]; then -+ perldef=!!PERL!! ++ if [ -x %%PERL%% ]; then ++ perldef=%%PERL%% + elif [ -x /usr/bin/perl ]; then perldef=/usr/bin/perl elif [ -x /usr/local/bin/perl ]; then perldef=/usr/local/bin/perl +@@ -465,7 +467,6 @@ + echo "Creating start and stop scripts.." + rm -f $config_dir/stop $config_dir/start + echo "#!/bin/sh" >>$config_dir/start +-echo "echo Starting Usermin server in $wadir" >>$config_dir/start + echo "trap '' 1" >>$config_dir/start + echo "LANG=" >>$config_dir/start + echo "export LANG" >>$config_dir/start diff --git a/sysutils/usermin/files/usermin.sh.in b/sysutils/usermin/files/usermin.sh.in index bf7ec974a489..4aadd72b5513 100644 --- a/sysutils/usermin/files/usermin.sh.in +++ b/sysutils/usermin/files/usermin.sh.in @@ -1,27 +1,28 @@ #!/bin/sh - +# # $FreeBSD$ +# +# PROVIDE: usermin +# REQUIRE: LOGIN +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable usermin: +# +# usermin_enable="YES" +# + +usermin_enable="NO" -case $1 in +. %%RC_SUBR%% - start) - if [ -x !!PREFIX!!/etc/usermin/start ]; then - !!PREFIX!!/etc/usermin/start >/dev/null - echo -n ' usermin' - fi - exit 0 - ;; +name=usermin +rcvar=`set_rcvar` - stop) - if [ -x !!PREFIX!!/etc/usermin/stop ]; then - !!PREFIX!!/etc/usermin/stop >/dev/null - echo -n ' usermin' - fi - exit 0 - ;; +prefix=%%PREFIX%% +procname=%%PERL5%% +pidfile=/var/log/usermin/miniserv.pid +required_dirs=${prefix}/etc/usermin +command=${prefix}/etc/usermin/start - *) - echo "usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/usermin/files/usermin.sh.sample b/sysutils/usermin/files/usermin.sh.sample index bf7ec974a489..4aadd72b5513 100644 --- a/sysutils/usermin/files/usermin.sh.sample +++ b/sysutils/usermin/files/usermin.sh.sample @@ -1,27 +1,28 @@ #!/bin/sh - +# # $FreeBSD$ +# +# PROVIDE: usermin +# REQUIRE: LOGIN +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable usermin: +# +# usermin_enable="YES" +# + +usermin_enable="NO" -case $1 in +. %%RC_SUBR%% - start) - if [ -x !!PREFIX!!/etc/usermin/start ]; then - !!PREFIX!!/etc/usermin/start >/dev/null - echo -n ' usermin' - fi - exit 0 - ;; +name=usermin +rcvar=`set_rcvar` - stop) - if [ -x !!PREFIX!!/etc/usermin/stop ]; then - !!PREFIX!!/etc/usermin/stop >/dev/null - echo -n ' usermin' - fi - exit 0 - ;; +prefix=%%PREFIX%% +procname=%%PERL5%% +pidfile=/var/log/usermin/miniserv.pid +required_dirs=${prefix}/etc/usermin +command=${prefix}/etc/usermin/start - *) - echo "usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/usermin/pkg-message b/sysutils/usermin/pkg-message index 144aee9a469f..5be45c6778fe 100644 --- a/sysutils/usermin/pkg-message +++ b/sysutils/usermin/pkg-message @@ -8,4 +8,8 @@ run the following command as root: You won't have to perform this step after every usermin upgrade. +Since 1.080_2, to run usermin from +startup, add usermin_enable="YES" +in your /etc/rc.conf. + =================================== diff --git a/sysutils/usermin/pkg-plist b/sysutils/usermin/pkg-plist index b7617cde8aa1..ba3e895d607d 100644 --- a/sysutils/usermin/pkg-plist +++ b/sysutils/usermin/pkg-plist @@ -1,10 +1,5 @@ -@comment stop service at deinstall time -@unexec [ -n "$BATCH" ] || ([ ! -d %D/etc/usermin ] || [ ! -x %D/etc/rc.d/usermin.sh ] || %D/etc/rc.d/usermin.sh stop >/dev/null ) -etc/rc.d/usermin.sh-dist +etc/rc.d/usermin.sh @comment Insert PLIST.lib-usermin here @comment -=[ begin PLIST.lib-usermin ]=- @comment -=[ end PLIST.lib-usermin ]=- -@comment upgrade configuration if etc/usermin exists -@exec [ ! -d %D/etc/usermin ] || echo | nostart=Y %D/lib/usermin/setup.sh -@comment run interactive setup if not in BATCH mode and no configuration exists -@exec [ -n "$BATCH" ] || ([ -d %D/etc/usermin ] || nostart=Y %D/lib/usermin/setup.sh) +@dirrm lib/usermin diff --git a/sysutils/usermin/scripts/pre-configure b/sysutils/usermin/scripts/pre-configure deleted file mode 100644 index 98f61a99440a..000000000000 --- a/sysutils/usermin/scripts/pre-configure +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh - -perl -pi -e "s=!!PREFIX!!=$PREFIX=" ${WRKSRC}/setup.sh - -if [ -x /usr/bin/perl5 ]; then - PERL5=/usr/bin/perl -elif [ -x $PREFIX/bin/perl ]; then - PERL5=$PREFIX/bin/perl -fi - -perl -pi -e "s=!!PERL5!!=$PERL5=" ${WRKSRC}/setup.sh - -sed -e "s=!!PREFIX!!=$PREFIX=" < ${FILESDIR}/usermin.sh.sample > ${WRKDIR}/usermin.sh - -exit 0 diff --git a/sysutils/webmin/Makefile b/sysutils/webmin/Makefile index 0a735dc067c9..b3fd22a94d45 100644 --- a/sysutils/webmin/Makefile +++ b/sysutils/webmin/Makefile @@ -7,7 +7,7 @@ PORTNAME= webmin PORTVERSION= 1.150 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://www.webmin.com/updates/ \ ${MASTER_SITE_SOURCEFORGE} @@ -23,7 +23,8 @@ RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Net/SSLeay.pm:${PORTSDIR}/security/p5-Net NO_BUILD= yes USE_PERL5= yes -SCRIPTS_ENV+= WRKDIR="${WRKDIR}" +USE_RC_SUBR= yes +USE_REINPLACE= yes WEBMIN_MODULES= fsdump-1.150-1.wbm.gz @@ -36,7 +37,6 @@ post-extract: ${TAR} --unlink -xzf ${DISTDIR}/$${webmin_module} -C ${WRKSRC}; \ done; \ fi - @${FIND} ${WRKSRC} -name "*.bak" | ${XARGS} ${RM} post-patch: @${CP} ${WRKDIR}/webmin-${PORTVERSION}/bind8/config-freebsd-3.0 \ @@ -56,6 +56,9 @@ post-patch: usermin/config @${PERL} -pi -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/${file} .endfor + @${REINPLACE_CMD} -e "s=%%PREFIX%%=${PREFIX}=" ${WRKSRC}/setup.sh + @${FIND} ${WRKSRC} -name "*.cgi" -print \ + | ${XARGS} ${REINPLACE_CMD} -e "s@/usr/local/bin/perl@${PERL}@" @${FIND} ${WRKSRC} -name "*.orig" -print | ${XARGS} ${RM} @${FIND} ${WRKSRC} -name "*.bak" -print | ${XARGS} ${RM} # we may have 2 levels of empty directories which cause the plist generation @@ -66,8 +69,11 @@ post-patch: do-install: @${MKDIR} ${PREFIX}/lib/webmin @${CP} -r ${WRKSRC}/* ${PREFIX}/lib/webmin - @${CP} ${WRKDIR}/webmin.sh ${PREFIX}/etc/rc.d/webmin.sh-dist - @${CHMOD} 554 ${PREFIX}/etc/rc.d/webmin.sh-dist + @${SED} -e "s=%%RC_SUBR%%=${RC_SUBR}=" \ + -e "s=%%PREFIX%%=${PREFIX}=" \ + -e "s=%%PERL5%%=${PERL}=" \ + < ${FILESDIR}/webmin.sh.sample > ${PREFIX}/etc/rc.d/webmin.sh + @${CHMOD} 555 ${PREFIX}/etc/rc.d/webmin.sh post-install: @cd ${WRKSRC} ; ${FIND} * -type f -o -type l | ${SORT} | ${AWK} \ @@ -75,7 +81,6 @@ post-install: @cd ${WRKSRC} ; ${FIND} * -type d | ${SORT} -r | ${AWK} \ '{ print "lib/webmin/" $$1 }' | ${SED} -e 's/^/@dirrm /g' \ >> ${WRKDIR}/PLIST.lib-webmin - @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script @${ECHO_CMD} "/Insert PLIST.lib-webmin" >> ${WRKDIR}/ex.script @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script @@ -83,12 +88,6 @@ post-install: @${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script @${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-lib-webmin @cd ${WRKDIR} ; ex < ex.script -# stop webmin if configured and enabled at startup - @[ -n "${BATCH}" ] || ([ ! -d ${PREFIX}/etc/webmin ] || [ ! -x ${PREFIX}/etc/rc.d/webmin.sh ] || ${PREFIX}/etc/rc.d/webmin.sh stop > /dev/null) -# upgrade configuration if etc/webmin exists - @[ ! -d ${PREFIX}/etc/webmin ] || ${ECHO_CMD} | nostart=Y ${PREFIX}/lib/webmin/setup.sh -# run interactive setup if not in BATCH mode and no configuration exists - @[ -n "${BATCH}" ] || ([ -d ${PREFIX}/etc/webmin ] || nostart=Y ${PREFIX}/lib/webmin/setup.sh) @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/sysutils/webmin/files/patch-aa b/sysutils/webmin/files/patch-aa index 45e50043665b..dfe464244370 100644 --- a/sysutils/webmin/files/patch-aa +++ b/sysutils/webmin/files/patch-aa @@ -1,23 +1,26 @@ ---- setup.sh.orig Mon Dec 13 12:57:41 1999 -+++ setup.sh Tue Dec 14 10:20:32 1999 -@@ -33,12 +33,12 @@ + +$FreeBSD$ + +--- setup.sh.orig Fri Jun 4 01:15:55 2004 ++++ setup.sh Sat Jun 19 19:24:25 2004 +@@ -89,12 +89,12 @@ echo "Unless you want to run multiple versions of Webmin at the same time" echo "you can just accept the defaults." echo "" -printf "Config file directory [/etc/webmin]: " -+printf "Config file directory [!!PREFIX!!/etc/webmin]: " ++printf "Config file directory [%%PREFIX%%/etc/webmin]: " if [ "$config_dir" = "" ]; then read config_dir fi if [ "$config_dir" = "" ]; then - config_dir=/etc/webmin -+ config_dir=!!PREFIX!!/etc/webmin ++ config_dir=%%PREFIX%%/etc/webmin fi abspath=`echo $config_dir | grep "^/"` if [ "$abspath" = "" ]; then -@@ -106,12 +106,12 @@ +@@ -199,12 +199,12 @@ fi - else + # Ask for log directory - printf "Log file directory [/var/webmin]: " + printf "Log file directory [/var/log/webmin]: " @@ -30,31 +33,53 @@ fi abspath=`echo $var_dir | grep "^/"` if [ "$abspath" = "" ]; then -@@ -135,7 +135,9 @@ +@@ -232,7 +232,9 @@ echo "Webmin is written entirely in Perl. Please enter the full path to the" echo "Perl 5 interpreter on your system." echo "" - if [ -x /usr/bin/perl ]; then -+ if [ -x !!PERL5!! ]; then -+ perldef=!!PERL5!! ++ if [ -x %%PERL5%% ]; then ++ perldef=%%PERL5%% + elif [ -x /usr/bin/perl ]; then perldef=/usr/bin/perl elif [ -x /usr/local/bin/perl ]; then perldef=/usr/local/bin/perl -@@ -313,11 +315,11 @@ - initsupp=`grep "^os_support=" $wadir/init/module.info | sed -e 's/os_support=//g' | grep $os_type` - atboot=0 - if [ "$initsupp" != "" ]; then +@@ -418,22 +420,6 @@ + fi + fi + +- # Ask whether to run at boot time +- if [ "$atboot" = "" ]; then +- initsupp=`grep "^os_support=" "$srcdir/init/module.info" | sed -e 's/os_support=//g' | grep $os_type` +- atboot=0 +- if [ "$initsupp" != "" ]; then - printf "Start Webmin at boot time (y/n): " - read atbootyn - if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then - atboot=1 - fi -+ # printf "Start Webmin at boot time (y/n): " -+ # read atbootyn -+ # if [ "$atbootyn" = "y" -o "$atbootyn" = "Y" ]; then -+ # atboot=1 -+ # fi - else - echo "Webmin does not support being started at boot time on your system." - fi +- else +- echo "Webmin does not support being started at boot time on your system." +- fi +- fi +- makeboot=$atboot +- + # Copy files to target directory + echo "***********************************************************************" + if [ "$wadir" != "$srcdir" ]; then +@@ -535,6 +521,7 @@ + fi + fi + ++noperlpath="yes" + if [ "$noperlpath" = "" ]; then + echo "Inserting path to perl into scripts.." + (find "$wadir" -name '*.cgi' -print ; find "$wadir" -name '*.pl' -print) | $perl "$wadir/perlpath.pl" $perl - +@@ -545,7 +532,6 @@ + echo "Creating start and stop scripts.." + rm -f $config_dir/stop $config_dir/start $config_dir/restart + echo "#!/bin/sh" >>$config_dir/start +-echo "echo Starting Webmin server in $wadir" >>$config_dir/start + echo "trap '' 1" >>$config_dir/start + echo "LANG=" >>$config_dir/start + echo "export LANG" >>$config_dir/start diff --git a/sysutils/webmin/files/webmin.sh.in b/sysutils/webmin/files/webmin.sh.in index b09816821764..15f434489542 100644 --- a/sysutils/webmin/files/webmin.sh.in +++ b/sysutils/webmin/files/webmin.sh.in @@ -1,29 +1,28 @@ #!/bin/sh - +# # $FreeBSD$ +# +# PROVIDE: webmin +# REQUIRE: LOGIN +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable webmin: +# +# webmin_enable="YES" +# + +webmin_enable="NO" -case $1 in +. %%RC_SUBR%% - start) - LD_PRELOAD=/usr/lib/libpam.so - export LD_PRELOAD - if [ -x !!PREFIX!!/etc/webmin/start ]; then - !!PREFIX!!/etc/webmin/start >/dev/null - echo -n ' webmin' - fi - exit 0 - ;; +name=webmin +rcvar=`set_rcvar` - stop) - if [ -x !!PREFIX!!/etc/webmin/stop ]; then - !!PREFIX!!/etc/webmin/stop >/dev/null - echo -n ' webmin' - fi - exit 0 - ;; +prefix=%%PREFIX%% +procname=%%PERL5%% +pidfile=/var/log/webmin/miniserv.pid +required_dirs=${prefix}/etc/webmin +command=${prefix}/etc/webmin/start - *) - echo "usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/webmin/files/webmin.sh.sample b/sysutils/webmin/files/webmin.sh.sample index b09816821764..15f434489542 100644 --- a/sysutils/webmin/files/webmin.sh.sample +++ b/sysutils/webmin/files/webmin.sh.sample @@ -1,29 +1,28 @@ #!/bin/sh - +# # $FreeBSD$ +# +# PROVIDE: webmin +# REQUIRE: LOGIN +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable webmin: +# +# webmin_enable="YES" +# + +webmin_enable="NO" -case $1 in +. %%RC_SUBR%% - start) - LD_PRELOAD=/usr/lib/libpam.so - export LD_PRELOAD - if [ -x !!PREFIX!!/etc/webmin/start ]; then - !!PREFIX!!/etc/webmin/start >/dev/null - echo -n ' webmin' - fi - exit 0 - ;; +name=webmin +rcvar=`set_rcvar` - stop) - if [ -x !!PREFIX!!/etc/webmin/stop ]; then - !!PREFIX!!/etc/webmin/stop >/dev/null - echo -n ' webmin' - fi - exit 0 - ;; +prefix=%%PREFIX%% +procname=%%PERL5%% +pidfile=/var/log/webmin/miniserv.pid +required_dirs=${prefix}/etc/webmin +command=${prefix}/etc/webmin/start - *) - echo "usage: `basename $0` {start|stop}" >&2 - exit 64 - ;; -esac +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/webmin/pkg-descr b/sysutils/webmin/pkg-descr index a5f83dafa6a4..f880c9c74b61 100644 --- a/sysutils/webmin/pkg-descr +++ b/sysutils/webmin/pkg-descr @@ -4,6 +4,6 @@ user accounts, Apache, DNS, file sharing and so on. Webmin consists of a simple web server, and a number of CGI programs which directly update system files like /etc/inetd.conf and -/etc/passwd. +/etc/master.passwd. WWW: http://www.webmin.com/webmin/ diff --git a/sysutils/webmin/pkg-message b/sysutils/webmin/pkg-message index ddcfdbc65dfa..c213b4092959 100644 --- a/sysutils/webmin/pkg-message +++ b/sysutils/webmin/pkg-message @@ -8,4 +8,8 @@ run the following command as root: You won't have to perform this step after every webmin upgrade. +Since 1.150_2, to run webmin from +startup, add webmin_enable="YES" +in your /etc/rc.conf. + =================================== diff --git a/sysutils/webmin/pkg-plist b/sysutils/webmin/pkg-plist index 49d7126eff34..5e23e3612634 100644 --- a/sysutils/webmin/pkg-plist +++ b/sysutils/webmin/pkg-plist @@ -1,11 +1,5 @@ -@comment stop service at deinstall time -@unexec [ -n "$BATCH" ] || ([ ! -d %D/etc/webmin ] || [ ! -x %D/etc/rc.d/webmin.sh ] || %D/etc/rc.d/webmin.sh stop >/dev/null ) -etc/rc.d/webmin.sh-dist +etc/rc.d/webmin.sh @comment Insert PLIST.lib-webmin here @comment -=[ begin PLIST.lib-webmin ]=- @comment -=[ end PLIST.lib-webmin ]=- @dirrm lib/webmin -@comment upgrade configuration if etc/webmin exists -@exec [ ! -d %D/etc/webmin ] || echo | nostart=Y %D/lib/webmin/setup.sh -@comment run interactive setup if not in BATCH mode and no configuration exists -@exec [ -n "$BATCH" ] || ([ -d %D/etc/webmin ] || nostart=Y %D/lib/webmin/setup.sh) diff --git a/sysutils/webmin/scripts/pre-configure b/sysutils/webmin/scripts/pre-configure deleted file mode 100644 index d620e4227e06..000000000000 --- a/sysutils/webmin/scripts/pre-configure +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh - -perl -pi -e "s=!!PREFIX!!=$PREFIX=" ${WRKSRC}/setup.sh - -if [ -x /usr/bin/perl5 ]; then - PERL5=/usr/bin/perl -elif [ -x $PREFIX/bin/perl ]; then - PERL5=$PREFIX/bin/perl -fi - -perl -pi -e "s=!!PERL5!!=$PERL5=" ${WRKSRC}/setup.sh - -sed -e "s=!!PREFIX!!=$PREFIX=" < ${FILESDIR}/webmin.sh.sample > ${WRKDIR}/webmin.sh - -exit 0 |