Date: Tue, 9 Nov 2004 20:08:48 +0800 (CST) From: Gea-Suan Lin <gslin@netnews.NCTU.edu.tw> To: FreeBSD-gnats-submit@FreeBSD.org Cc: gslin@netnews.NCTU.edu.tw Subject: ports/73713: Update port: net-mgmt/cricket Message-ID: <20041109120848.E182E143@netnews.NCTU.edu.tw> Resent-Message-ID: <200411091210.iA9CAUKF056201@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 73713 >Category: ports >Synopsis: Update port: net-mgmt/cricket >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Nov 09 12:10:30 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Gea-Suan Lin >Release: FreeBSD 4.10-RELEASE-p2 i386 >Organization: >Environment: System: FreeBSD netnews.NCTU.edu.tw 4.10-RELEASE-p2 FreeBSD 4.10-RELEASE-p2 #0: Tue Aug 10 21:24:00 CST 2004 root@netnews.NCTU.edu.tw:/da1/usr.obj/da0/usr.src/sys/NETNEWS i386 >Description: * Sort RUN_DEPENDS. * Make user able to change USER & GROUP, and change default USER. (Bump PORTREVISION) * Cleanup do-install code. >How-To-Repeat: >Fix: diff -ruN /usr/ports/net-mgmt/cricket/Makefile cricket/Makefile --- /usr/ports/net-mgmt/cricket/Makefile Mon Apr 19 03:40:03 2004 +++ cricket/Makefile Tue Nov 9 20:04:03 2004 @@ -7,6 +7,7 @@ PORTNAME= cricket PORTVERSION= 1.0.5 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -15,44 +16,47 @@ MAINTAINER= ports@FreeBSD.org COMMENT= A high performance, extremely flexible monitoring system -RUN_DEPENDS= ${SITE_PERL}/SNMP_Session.pm:${PORTSDIR}/net-mgmt/p5-SNMP_Session \ +RUN_DEPENDS= ${SITE_PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \ ${SITE_PERL_ARCH}/RRDs.pm:${PORTSDIR}/net/rrdtool \ - ${SITE_PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \ + ${SITE_PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \ ${SITE_PERL}/LWP.pm:${PORTSDIR}/www/p5-libwww \ - ${SITE_PERL}/Time/Zone.pm:${PORTSDIR}/devel/p5-TimeDate \ - ${SITE_PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes + ${SITE_PERL}/SNMP_Session.pm:${PORTSDIR}/net-mgmt/p5-SNMP_Session \ + ${SITE_PERL}/Time/Zone.pm:${PORTSDIR}/devel/p5-TimeDate SITE_PERL_ARCH= ${SITE_PERL}/${PERL_ARCH} HAS_CONFIGURE= yes USE_PERL5= yes NO_BUILD= yes -PKGMESSAGE= ${WRKDIR}/pkg-message PLIST_SUB+= VERSION=${PORTVERSION} -CRICKET_USER= cricket -CRICKET_GROUP= www +CRICKET_USER?= wwwadm +CRICKET_UID?= 81 +CRICKET_GROUP?= www +CRICKET_GID?= 80 do-install: - @PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL + @PREFIX="${PREFIX}" USER="${CRICKET_USER}" GROUP="${CRICKET_GROUP}" \ + UID="${CRICKET_UID}" GID="${CRICKET_GID}" ${SH} \ + ${PKGINSTALL} ${PORTNAME} PRE-INSTALL @${MKDIR} -m 755 ${PREFIX}/cricket/cricket-${PORTVERSION} @${CP} -R ${WRKSRC}/* ${PREFIX}/cricket/cricket-${PORTVERSION} @${FIND} ${PREFIX}/cricket/cricket-${PORTVERSION} -name \*.orig -or \ -name \*.bak | ${XARGS} ${RM} -f ${CHOWN} -R ${CRICKET_USER}:${CRICKET_GROUP} ${PREFIX}/cricket @if [ -L ${PREFIX}/cricket/cricket ]; then \ - ${ECHO_MSG} "Updating ${PREFIX}/cricket/cricket symbolic link" ; \ - ${RM} ${PREFIX}/cricket/cricket ; \ + ${ECHO_MSG} "Updating ${PREFIX}/cricket/cricket symbolic link" + ${RM} ${PREFIX}/cricket/cricket fi ${LN} -s ${PREFIX}/cricket/cricket-${PORTVERSION} \ ${PREFIX}/cricket/cricket @if [ -f ${LOCALBASE}/cricket/compile ] ; then \ - ${ECHO_MSG} "You should migrate manually to use new cricket" ; \ - ${ECHO_MSG} "installation scheme." ; \ + ${ECHO_MSG} "You should migrate manually to use new cricket" + ${ECHO_MSG} "installation scheme." fi post-install: @${SED} -e "s:%%PREFIX%%:${PREFIX}:g" ${WRKSRC}/cricket-conf.pl.sample \ - >${PREFIX}/etc/cricket-conf.pl.dist + > ${PREFIX}/etc/cricket-conf.pl.dist @${SED} -e 's,%%PREFIX%%,${PREFIX},' ${FILESDIR}/pkg-message.in > \ ${PKGMESSAGE} @${CAT} ${PKGMESSAGE} diff -ruN /usr/ports/net-mgmt/cricket/pkg-install cricket/pkg-install --- /usr/ports/net-mgmt/cricket/pkg-install Sun Jun 9 06:25:17 2002 +++ cricket/pkg-install Tue Nov 9 19:59:41 2004 @@ -6,19 +6,31 @@ exit 0 fi -USER=cricket -#group selected to be www since the webserver has to be able to serve it -GROUP=www +if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." +else + if /usr/sbin/pw groupadd ${GROUP} -g ${GID} + then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + echo "Please create it, and try again." + exit 1 + fi +fi -if ! pw usershow "${USER}" 2>/dev/null 1>&2; then - if pw useradd ${USER} -g ${GROUP} -h - \ - -s "/sbin/nologin" -d "${PREFIX}/cricket" \ - -c "Cricket Monitoring Owner"; \ - then - echo "Added user \"${USER}\"." - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi +if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." +else + if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -d /usr/local/www -s /bin/sh -c "WWW Administrator" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + echo "Please create it, and try again." + exit 1 + fi fi + exit 0 >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041109120848.E182E143>