Index: head/sysutils/bsdstats/Makefile =================================================================== --- head/sysutils/bsdstats/Makefile (revision 191076) +++ head/sysutils/bsdstats/Makefile (revision 191077) @@ -1,43 +1,45 @@ # New ports collection makefile for: bsdstats # Date created: 5 August 2006 # Whom: Marc G. Fournier # # $FreeBSD$ # PORTNAME= bsdstats PORTVERSION= 5.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils DISTFILES= MAINTAINER= scrappy@freebsd.org COMMENT= Monthly script for reporting anonymous statistics about your machine .include .if ${OSVERSION} < 503102 || (${OSVERSION} >= 600000 && ${OSVERSION} < 600010) RUN_DEPENDS= nc:${PORTSDIR}/net/netcat .endif NO_BUILD= yes -PLIST_FILES= etc/periodic/monthly/300.statistics +PLIST_FILES= etc/periodic/monthly/300.statistics etc/rc.d/bsdstats.sh PLIST_DIRS= etc/periodic/monthly \ etc/periodic do-install: ${MKDIR} ${LOCALBASE}/etc/periodic/monthly ${CP} ${FILESDIR}/300.statistics ${LOCALBASE}/etc/periodic/monthly + ${CP} ${FILESDIR}/bsdstats.sh ${LOCALBASE}/etc/rc.d + ${CHMOD} 0755 ${LOCALBASE}/etc/rc.d/bsdstats.sh post-install: ${CAT} ${PKGMESSAGE} .if defined(BATCH) || defined(PACKAGE_BUILDING) @${ECHO_MSG} " To activate monthly statistics reporting in /etc/periodic.conf," @${ECHO_MSG} " execute the following as root user:" @${ECHO_MSG} @${ECHO_MSG} "PKG_PREFIX=\"${PREFIX}\" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL" @${ECHO_MSG} .else @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .endif .include Property changes on: head/sysutils/bsdstats/Makefile ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.47 \ No newline at end of property +1.48 \ No newline at end of property Index: head/sysutils/bsdstats/pkg-install =================================================================== --- head/sysutils/bsdstats/pkg-install (revision 191076) +++ head/sysutils/bsdstats/pkg-install (revision 191077) @@ -1,66 +1,77 @@ #!/bin/sh # # pkg-install : based off /usr/ports/mail/courier/files/pkg-install.in # ask() { local question default answer question=$1 default=$2 if [ -z "${PACKAGE_BUILDING}" ]; then read -p "${question} [${default}]? " answer fi if [ -z "${answer}" ]; then answer=${default} fi echo ${answer} } yesno() { local question default answer question=$1 default=$2 while :; do answer=$(ask "${question}" "${default}") case "${answer}" in [Yy]*) return 0;; [Nn]*) return 1;; esac echo "Please answer yes or no." done } if [ ":$2" = ":POST-INSTALL" ]; then if [ -f "/etc/periodic.conf" ]; then if [ `grep monthly_statistics /etc/periodic.conf | wc -l` = 0 ]; then if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf if yesno "Would you like to send a list of installed hardware as well" n; then echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf fi if yesno "Would you like to send a list of installed ports as well" n; then echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf fi if yesno "Would you like to run it now" y; then /usr/local/etc/periodic/monthly/300.statistics -nodelay fi fi fi elif [ ! -f "/etc/periodic.conf" ]; then if yesno "Would you like to activate monthly reporting in /etc/periodic.conf" n; then echo "monthly_statistics_enable=\"YES\"" >> /etc/periodic.conf if yesno "Would you like to send a list of installed hardware as well" n; then echo "monthly_statistics_report_devices=\"YES\"" >> /etc/periodic.conf fi if yesno "Would you like to send a list of installed ports as well" n; then echo "monthly_statistics_report_ports=\"YES\"" >> /etc/periodic.conf fi if yesno "Would you like to run it now" y; then /usr/local/etc/periodic/monthly/300.statistics -nodelay fi fi fi + if [ -f "/etc/rc.conf" ]; then + if [ `grep bsdstats_enable /etc/rc.conf | wc -l` = 0 ]; then + if yesno "Would you like to activate reporting on reboot in /etc/rc.conf" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi + elif [ ! -f "/etc/periodic.conf" ]; then + if yesno "Would you like to activate reporting on reboot in /etc/rc.conf" n; then + echo "bsdstats_enable=\"YES\"" >> /etc/rc.conf + fi + fi fi Property changes on: head/sysutils/bsdstats/pkg-install ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.5 \ No newline at end of property +1.6 \ No newline at end of property