From 8ea3896b5c16eac25ebfe59b54ed3c8f465bb42e Mon Sep 17 00:00:00 2001 From: Jimmy Olgeni Date: Sun, 10 Nov 2002 20:11:29 +0000 Subject: Add usermin, a subset of webmin for non-administrative tasks. --- sysutils/Makefile | 1 + sysutils/usermin/Makefile | 75 ++++++++++++++++++++++++++++ sysutils/usermin/distinfo | 2 + sysutils/usermin/files/patch-commands_config | 8 +++ sysutils/usermin/files/patch-htaccess_config | 9 ++++ sysutils/usermin/files/patch-setup.sh | 54 ++++++++++++++++++++ sysutils/usermin/files/usermin.sh.in | 29 +++++++++++ sysutils/usermin/files/usermin.sh.sample | 29 +++++++++++ sysutils/usermin/pkg-comment | 1 + sysutils/usermin/pkg-descr | 7 +++ sysutils/usermin/pkg-message | 11 ++++ sysutils/usermin/pkg-plist | 10 ++++ sysutils/usermin/scripts/pre-configure | 15 ++++++ 13 files changed, 251 insertions(+) create mode 100644 sysutils/usermin/Makefile create mode 100644 sysutils/usermin/distinfo create mode 100644 sysutils/usermin/files/patch-commands_config create mode 100644 sysutils/usermin/files/patch-htaccess_config create mode 100644 sysutils/usermin/files/patch-setup.sh create mode 100644 sysutils/usermin/files/usermin.sh.in create mode 100644 sysutils/usermin/files/usermin.sh.sample create mode 100644 sysutils/usermin/pkg-comment create mode 100644 sysutils/usermin/pkg-descr create mode 100644 sysutils/usermin/pkg-message create mode 100644 sysutils/usermin/pkg-plist create mode 100644 sysutils/usermin/scripts/pre-configure (limited to 'sysutils') diff --git a/sysutils/Makefile b/sysutils/Makefile index c2a10ad5b708..eadec4a64538 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -226,6 +226,7 @@ SUBDIR += upsmon SUBDIR += uptimed SUBDIR += userlist + SUBDIR += usermin SUBDIR += uwatch SUBDIR += videogen SUBDIR += vobcopy diff --git a/sysutils/usermin/Makefile b/sysutils/usermin/Makefile new file mode 100644 index 000000000000..7f8c40730669 --- /dev/null +++ b/sysutils/usermin/Makefile @@ -0,0 +1,75 @@ +# New ports collection makefile for: usermin +# Date created: 10 Nov 2002 +# Whom: olgeni@FreeBSD.org +# +# $FreeBSD$ +# + +PORTNAME= usermin +PORTVERSION= 0.970 +CATEGORIES= sysutils +MASTER_SITES= http://www.webmin.com/uupdates/ \ + ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= webadmin +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${USERMIN_MODULES} +EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} + +MAINTAINER= olgeni@FreeBSD.org + +RUN_DEPENDS= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Net/SSLeay.pm:${PORTSDIR}/security/p5-Net-SSLeay \ + ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/${PERL_ARCH}/Authen/PAM.pm:${PORTSDIR}/security/p5-Authen-PAM + +NO_BUILD= yes +USE_PERL5= yes +SCRIPTS_ENV+= WRKDIR="${WRKDIR}" + +USERMIN_MODULES= mysql-0.970-1.wbm.gz + +USERMIN_THEMES= + +post-extract: + @if [ "${USERMIN_MODULES}" != "" ]; then \ + for usermin_module in ${USERMIN_MODULES}; do \ + ${ECHO} "===> Unpacking updated module: $${usermin_module}"; \ + ${TAR} --unlink -xzf ${DISTDIR}/$${usermin_module} -C ${WRKSRC}; \ + done; \ + fi + @find ${WRKSRC} -name "*.bak" | ${XARGS} ${RM} + +do-install: + @${MKDIR} ${PREFIX}/lib/usermin + @${CP} -r ${WRKSRC}/* ${PREFIX}/lib/usermin + @cd ${PREFIX}/lib/usermin && find . -name "*.orig" -print \ + | ${XARGS} ${RM} +# 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 + +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 + + @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script + @${ECHO_CMD} "/Insert PLIST.lib-usermin" >> ${WRKDIR}/ex.script + @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script + @${ECHO_CMD} "r ${WRKDIR}/PLIST.lib-usermin" >> ${WRKDIR}/ex.script + @${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 diff --git a/sysutils/usermin/distinfo b/sysutils/usermin/distinfo new file mode 100644 index 000000000000..b15332405fc6 --- /dev/null +++ b/sysutils/usermin/distinfo @@ -0,0 +1,2 @@ +MD5 (usermin-0.970.tar.gz) = 8f346c57358101a050da4d9d9ff59d77 +MD5 (mysql-0.970-1.wbm.gz) = 556d95707b96313505c49a2c783b511c diff --git a/sysutils/usermin/files/patch-commands_config b/sysutils/usermin/files/patch-commands_config new file mode 100644 index 000000000000..606f7a35eb85 --- /dev/null +++ b/sysutils/usermin/files/patch-commands_config @@ -0,0 +1,8 @@ + +$FreeBSD$ + +--- commands/config.orig Mon Nov 4 00:55:32 2002 ++++ commands/config Sun Nov 10 15:41:55 2002 +@@ -1 +1 @@ +-webmin_config=/etc/webmin/custom ++webmin_config=/usr/local/etc/webmin/custom diff --git a/sysutils/usermin/files/patch-htaccess_config b/sysutils/usermin/files/patch-htaccess_config new file mode 100644 index 000000000000..3943aec56076 --- /dev/null +++ b/sysutils/usermin/files/patch-htaccess_config @@ -0,0 +1,9 @@ + +$FreeBSD$ + +--- htaccess/config.orig Sun Nov 10 15:20:17 2002 ++++ htaccess/config Sun Nov 10 15:20:29 2002 +@@ -1,2 +1,2 @@ + htaccess=.htaccess +-webmin_apache=/etc/webmin/apache ++webmin_apache=/usr/local/etc/webmin/apache diff --git a/sysutils/usermin/files/patch-setup.sh b/sysutils/usermin/files/patch-setup.sh new file mode 100644 index 000000000000..253a3f2b2ebc --- /dev/null +++ b/sysutils/usermin/files/patch-setup.sh @@ -0,0 +1,54 @@ + +$FreeBSD$ + +--- setup.sh.orig Sun Nov 10 15:32:27 2002 ++++ setup.sh Sun Nov 10 15:32:34 2002 +@@ -48,12 +48,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]: " + if [ "$config_dir" = "" ]; then + read config_dir + fi + if [ "$config_dir" = "" ]; then +- config_dir=/etc/usermin ++ config_dir=!!PREFIX!!/etc/usermin + fi + abspath=`echo $config_dir | grep "^/"` + if [ "$abspath" = "" ]; then +@@ -138,19 +138,19 @@ + else + # Config directory exists .. make sure it is not in use + ls $config_dir | grep -v rpmsave >/dev/null 2>&1 +- if [ "$?" = "0" -a "$config_dir" != "/etc/usermin" ]; then ++ if [ "$?" = "0" -a "$config_dir" != "!!PREFIX!!/etc/usermin" ]; then + echo "ERROR: Config directory $config_dir is not empty" + echo "" + exit 2 + fi + + # Ask for log directory +- printf "Log file directory [/var/usermin]: " ++ printf "Log file directory [/var/log/usermin]: " + if [ "$var_dir" = "" ]; then + read var_dir + fi + if [ "$var_dir" = "" ]; then +- var_dir=/var/usermin ++ var_dir=/var/log/usermin + fi + abspath=`echo $var_dir | grep "^/"` + if [ "$abspath" = "" ]; then +@@ -178,8 +178,8 @@ + echo "Usermin 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 +- perldef=/usr/bin/perl ++ if [ -x !!PERL5!! ]; then ++ perldef=!!PERL5!! + elif [ -x /usr/local/bin/perl ]; then + perldef=/usr/local/bin/perl + else diff --git a/sysutils/usermin/files/usermin.sh.in b/sysutils/usermin/files/usermin.sh.in new file mode 100644 index 000000000000..e5f25fa71f2f --- /dev/null +++ b/sysutils/usermin/files/usermin.sh.in @@ -0,0 +1,29 @@ +#!/bin/sh + +# $FreeBSD$ + +case $1 in + + start) + LD_PRELOAD=/usr/lib/libpam.so.1 + export LD_PRELOAD + if [ -x !!PREFIX!!/etc/usermin/start ]; then + !!PREFIX!!/etc/usermin/start >/dev/null + echo -n ' usermin' + fi + exit 0 + ;; + + stop) + if [ -x !!PREFIX!!/etc/usermin/stop ]; then + !!PREFIX!!/etc/usermin/stop >/dev/null + echo -n ' usermin' + fi + exit 0 + ;; + + *) + echo "usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac diff --git a/sysutils/usermin/files/usermin.sh.sample b/sysutils/usermin/files/usermin.sh.sample new file mode 100644 index 000000000000..e5f25fa71f2f --- /dev/null +++ b/sysutils/usermin/files/usermin.sh.sample @@ -0,0 +1,29 @@ +#!/bin/sh + +# $FreeBSD$ + +case $1 in + + start) + LD_PRELOAD=/usr/lib/libpam.so.1 + export LD_PRELOAD + if [ -x !!PREFIX!!/etc/usermin/start ]; then + !!PREFIX!!/etc/usermin/start >/dev/null + echo -n ' usermin' + fi + exit 0 + ;; + + stop) + if [ -x !!PREFIX!!/etc/usermin/stop ]; then + !!PREFIX!!/etc/usermin/stop >/dev/null + echo -n ' usermin' + fi + exit 0 + ;; + + *) + echo "usage: `basename $0` {start|stop}" >&2 + exit 64 + ;; +esac diff --git a/sysutils/usermin/pkg-comment b/sysutils/usermin/pkg-comment new file mode 100644 index 000000000000..f143efe58fab --- /dev/null +++ b/sysutils/usermin/pkg-comment @@ -0,0 +1 @@ +Web-based interface for performing some user tasks diff --git a/sysutils/usermin/pkg-descr b/sysutils/usermin/pkg-descr new file mode 100644 index 000000000000..802a9f8bf894 --- /dev/null +++ b/sysutils/usermin/pkg-descr @@ -0,0 +1,7 @@ +Usermin is a web interface that can be used by any user on a Unix +system to easily perform tasks like reading mail, setting up SSH +or configuring mail forwarding. It can be thought of as a simplified +version of Webmin designed for use by normal users rather than +system administrators. + +WWW: http://www.usermin.com/ diff --git a/sysutils/usermin/pkg-message b/sysutils/usermin/pkg-message new file mode 100644 index 000000000000..144aee9a469f --- /dev/null +++ b/sysutils/usermin/pkg-message @@ -0,0 +1,11 @@ +=================================== + +To reconfigure usermin you should +run the following command as root: + + ${LOCALBASE}/lib/usermin/setup.sh + +You won't have to perform this step +after every usermin upgrade. + +=================================== diff --git a/sysutils/usermin/pkg-plist b/sysutils/usermin/pkg-plist new file mode 100644 index 000000000000..b7617cde8aa1 --- /dev/null +++ b/sysutils/usermin/pkg-plist @@ -0,0 +1,10 @@ +@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 +@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) diff --git a/sysutils/usermin/scripts/pre-configure b/sysutils/usermin/scripts/pre-configure new file mode 100644 index 000000000000..98f61a99440a --- /dev/null +++ b/sysutils/usermin/scripts/pre-configure @@ -0,0 +1,15 @@ +#! /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 -- cgit v1.2.3