aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/webmin
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2004-06-20 04:58:44 +0800
committerolgeni <olgeni@FreeBSD.org>2004-06-20 04:58:44 +0800
commit8a0504034ec136face71c616b4e38921f6acec26 (patch)
tree4938d622620eddbc954fab447f6eef4b88f9d911 /sysutils/webmin
parent75630b6d3d548cc4b71421e4d5434a4e9395412f (diff)
downloadfreebsd-ports-gnome-8a0504034ec136face71c616b4e38921f6acec26.tar.gz
freebsd-ports-gnome-8a0504034ec136face71c616b4e38921f6acec26.tar.zst
freebsd-ports-gnome-8a0504034ec136face71c616b4e38921f6acec26.zip
Use rc.subr.
Diffstat (limited to 'sysutils/webmin')
-rw-r--r--sysutils/webmin/Makefile23
-rw-r--r--sysutils/webmin/files/patch-aa69
-rw-r--r--sysutils/webmin/files/webmin.sh.in45
-rw-r--r--sysutils/webmin/files/webmin.sh.sample45
-rw-r--r--sysutils/webmin/pkg-descr2
-rw-r--r--sysutils/webmin/pkg-message4
-rw-r--r--sysutils/webmin/pkg-plist8
-rw-r--r--sysutils/webmin/scripts/pre-configure15
8 files changed, 108 insertions, 103 deletions
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