Skip site navigation (1)Skip section navigation (2)
Date:      1 Jan 2002 23:03:57 -0000
From:      Seamus Venasse <svenasse@polaris.ca>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/33453: New port: Apache module that can record traffic statistics
Message-ID:  <20020101230357.90514.qmail@pris.polaris.ca>

next in thread | raw e-mail | index | archive | help

>Number:         33453
>Category:       ports
>Synopsis:       New port: Apache module that can record traffic statistics
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 01 15:10:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Seamus Venasse
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Polaris Computing
>Environment:
System: FreeBSD pitou.polaris.ca 4.4-STABLE FreeBSD 4.4-STABLE #1: Wed Nov 7 01:23:05 PST 2001 root@pitou.polaris.ca:/usr/obj/usr/src/sys/PITOU i386


	
>Description:
	
>How-To-Repeat:
	
>Fix:


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mod_accounting
#	mod_accounting/Makefile
#	mod_accounting/scripts
#	mod_accounting/scripts/configure.mod_accounting
#	mod_accounting/distinfo
#	mod_accounting/pkg-comment
#	mod_accounting/pkg-descr
#	mod_accounting/pkg-message
#	mod_accounting/pkg-plist
#
echo c - mod_accounting
mkdir -p mod_accounting > /dev/null 2>&1
echo x - mod_accounting/Makefile
sed 's/^X//' >mod_accounting/Makefile << 'END-of-mod_accounting/Makefile'
X# New ports collection makefile for:	mod_accounting
X# Date created:				1 Jan 2002
X# Whom:					Seamus Venasse <svenasse@polaris.ca>
X#
X# $FreeBSD$
X#
X
XPORTNAME=		mod_accounting
XPORTVERSION=		0.3
XCATEGORIES=		www
XMASTER_SITES=		${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	mod-acct
X
XMAINTAINER=		svenasse@polaris.ca
X
XBUILD_DEPENDS=		${APXS}:${PORTSDIR}/www/apache13
XRUN_DEPENDS=		${BUILD_DEPENDS}
X
XAPXS=			${LOCALBASE}/sbin/apxs
XDOCS=			README
X
XSCRIPTS_ENV=		LOCALBASE="${LOCALBASE}" \
X			WRKDIRPREFIX="${WRKDIRPREFIX}" \
X			MKDIR="${MKDIR}"
X
Xpre-fetch:
X	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.mod_accounting
X
X.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
X.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
X.endif
X
Xdo-build:
X	@cd ${WRKSRC} && \
X	${APXS} -c ${MA_DEF} ${MA_INC} ${MA_LIB} mod_accounting.c ${MA_DB}
X
Xdo-install:
X	${APXS} -i -A -n accounting ${WRKSRC}/mod_accounting.so
X.if !defined(NOPORTDOCS)
X	${MKDIR} ${PREFIX}/share/doc/mod_accounting
X.for f in ${DOCS}
X	${INSTALL_DATA} ${WRKSRC}/${f} ${PREFIX}/share/doc/mod_accounting/
X.endfor
X.endif
X	${CAT} ${PKGMESSAGE}
X
Xpost-clean:
X	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
X
X.include <bsd.port.mk>
END-of-mod_accounting/Makefile
echo c - mod_accounting/scripts
mkdir -p mod_accounting/scripts > /dev/null 2>&1
echo x - mod_accounting/scripts/configure.mod_accounting
sed 's/^X//' >mod_accounting/scripts/configure.mod_accounting << 'END-of-mod_accounting/scripts/configure.mod_accounting'
X#!/bin/sh
X
Xif [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
X	echo "Already configured.  Do a \"make clean\" first to reconfigure."
X	exit
Xfi
X
X
X# get use input using dialog inputbox
X# returns $value
XdialogInputBox() {
X	prompt=$1
X	default_value=$2
X
X	tempfile=`mktemp -t input`
X
X	/usr/bin/dialog --inputbox "$prompt" 8 60 "$default_value" 2> $tempfile
X	retval=$?
X	if [ -s $tempfile ]; then
X		value=`cat $tempfile`
X	fi
X	rm -f $tempfile
X
X	case $retval in
X		0)	if [ -z $value ]; then
X				echo "Using default: ${default_value}"
X				value=${default_value}
X			fi
X			;;
X		1)	echo "Cancel pressed"
X			exit 1
X			;;
X	esac
X}
X
X
X# writes entry into the Makefile.inc file
XlogEntry() {
X	entry=$1
X
X	makefileinc="${WRKDIRPREFIX}${CURDIR}/Makefile.inc"
X	echo "$entry" >> $makefileinc
X}
X
X
Xtempfile=`mktemp -t input`
X/usr/bin/dialog --title "Database Selection" --clear \
X	--menu "\n\
XPlease select desired options:" -1 -1 4 \
XMYSQL		"MySQL 3.23" \
XPG		"PostgreSQL 7" \
X2> $tempfile
X
Xretval=$?
X
Xif [ -s $tempfile ]; then
X	set `cat $tempfile`
Xfi
Xrm -f $tempfile
X
Xcase $retval in
X	0)	if [ -z "$*" ]; then
X			echo "Nothing selected"
X			exit 1
X		fi
X		;;
X	1)	echo "Cancel pressed"
X		exit 1
X		;;
Xesac
X
X${MKDIR} ${WRKDIRPREFIX}${CURDIR}
X
Xcase $1 in
X	MYSQL)
X		logEntry "MA_DEF=-DNEED_MYSQL"
X		logEntry "MA_INC=-I/usr/local/include/"
X		logEntry "MA_LIB=-L/usr/local/lib/mysql/ -lmysqlclient"
X		logEntry "MA_DB=mysql.c"
X		logEntry "LIB_DEPENDS+=mysqlclient.10:\${PORTSDIR}/databases/mysql323-client"
X		;;
X	PG)
X		logEntry "MA_DEF=-DNEED_POSTGRES"
X		logEntry "MA_INC=-I/usr/local/include/pgsql"
X		logEntry "MA_LIB=-L/usr/local/lib -lpq"
X		logEntry "MA_DB=postgres.c"
X		logEntry "LIB_DEPENDS+=pq.2:${PORTSDIR}/databases/postgresql7"
X		;;
Xesac
END-of-mod_accounting/scripts/configure.mod_accounting
echo x - mod_accounting/distinfo
sed 's/^X//' >mod_accounting/distinfo << 'END-of-mod_accounting/distinfo'
XMD5 (mod_accounting-0.3.tar.gz) = 47ac54b7e6b43ae38754d080b5a12130
END-of-mod_accounting/distinfo
echo x - mod_accounting/pkg-comment
sed 's/^X//' >mod_accounting/pkg-comment << 'END-of-mod_accounting/pkg-comment'
XApache module that can record traffic statistics
END-of-mod_accounting/pkg-comment
echo x - mod_accounting/pkg-descr
sed 's/^X//' >mod_accounting/pkg-descr << 'END-of-mod_accounting/pkg-descr'
Xmod_accounting is a simple Apache module that can record 
Xtraffic statistics into a database (bytes in/out per http 
Xrequest)
X
XWWW: http://sourceforge.net/projects/mod-acct/
X
XSeamus Venasse <svenasse@polaris.ca>
END-of-mod_accounting/pkg-descr
echo x - mod_accounting/pkg-message
sed 's/^X//' >mod_accounting/pkg-message << 'END-of-mod_accounting/pkg-message'
X************************************************************
XPlease edit your apache.conf or httpd.conf to enable and
Xsetup this module.
X
XYou can always refer to the useful documents held in
X${PREFIX}/share/doc/mod_accounting/, where ${PREFIX} is
Xtypically /usr/local.
X
XWhen it's done, do the following to take effect:
X
X  apachectl configtest	(and correct any errors reported)
X  apachectl restart
X
X************************************************************
END-of-mod_accounting/pkg-message
echo x - mod_accounting/pkg-plist
sed 's/^X//' >mod_accounting/pkg-plist << 'END-of-mod_accounting/pkg-plist'
X@exec %D/sbin/apxs -e -a -n accounting
X@unexec %D/sbin/apxs -e -A -n accounting mod_accounting.so
Xlibexec/apache/mod_accounting.so
X%%PORTDOCS%%share/doc/mod_accounting/README
X%%PORTDOCS%%@dirrm share/doc/mod_accounting
END-of-mod_accounting/pkg-plist
exit

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020101230357.90514.qmail>