From da0b33d01c1ce12cc5b3129cd92c8db0f44ca1e9 Mon Sep 17 00:00:00 2001 From: Lars Koeller Date: Sun, 2 Dec 2001 11:24:53 +0000 Subject: Add apcupsd 3.8.3, a daemon for controlling APC UPS. PR: 31478 Submitted by: Lars Koeller --- sysutils/apcupsd/Makefile | 54 ++++++++++++++++++++++ sysutils/apcupsd/distinfo | 1 + sysutils/apcupsd/files/apcupsd.sh.sample | 63 +++++++++++++++++++++++++ sysutils/apcupsd/files/patch-aa | 53 +++++++++++++++++++++ sysutils/apcupsd/files/patch-ab | 79 ++++++++++++++++++++++++++++++++ sysutils/apcupsd/files/patch-ba | 53 +++++++++++++++++++++ sysutils/apcupsd/pkg-comment | 1 + sysutils/apcupsd/pkg-descr | 10 ++++ sysutils/apcupsd/pkg-plist | 27 +++++++++++ 9 files changed, 341 insertions(+) create mode 100644 sysutils/apcupsd/Makefile create mode 100644 sysutils/apcupsd/distinfo create mode 100644 sysutils/apcupsd/files/apcupsd.sh.sample create mode 100644 sysutils/apcupsd/files/patch-aa create mode 100644 sysutils/apcupsd/files/patch-ab create mode 100644 sysutils/apcupsd/files/patch-ba create mode 100644 sysutils/apcupsd/pkg-comment create mode 100644 sysutils/apcupsd/pkg-descr create mode 100644 sysutils/apcupsd/pkg-plist (limited to 'sysutils/apcupsd') diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile new file mode 100644 index 000000000000..1200dc08d378 --- /dev/null +++ b/sysutils/apcupsd/Makefile @@ -0,0 +1,54 @@ +# New ports collection makefile for: apcupsd +# Date created: 1.12.2001 +# Whom: Lars Köller +# +# $FreeBSD$ +# + +PORTNAME= apcupsd +PORTVERSION= 3.8.3 +CATEGORIES= sysutils +MASTER_SITES= ftp://ftp.apcupsd.org/pub/apcupsd/stable/tar/ + +MAINTAINER= Lars.Koeller@Uni-Bielefeld.de + +LIB_DEPENDS= intl.1:${PORTSDIR}/devel/gettext + +STARTUP_SCRIPT= apcupsd.sh.sample +PLIST_SUB= STARTUP_SCRIPT=${STARTUP_SCRIPT} + +HAS_CONFIGURE= yes +CONFIGURE_ARGS= --prefix=${PREFIX} --sbindir=${PREFIX}/sbin \ + --enable-nls \ + --sysconfdir=${PREFIX}/etc/apcupsd \ + --with-serial-dev=/dev/usv \ + --enable-cgi --with-cgi-bin=${PREFIX}/etc/apcupsd/cgi +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + CFLAGS="-I${LOCALBASE}/include" \ + LIBS="-L${LOCALBASE}/lib" + +.include + +# Cause FreeBSD 3.X misses libmenu, libforms and libpanel (curses) +.if ${OSVERSION} > 400000 +CONFIGURE_ARGS+=--enable-powerflute +PLIST_SUB+= POWERFL="" +.else +PLIST_SUB+= POWERFL="@comment " +.endif + +MAN8= "apcupsd.8" + +PORTDOCS= doc/manual/apcupsd.pdf + +post-install: + ${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} \ + ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT} +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} +.for file in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR} +.endfor +.endif + +.include diff --git a/sysutils/apcupsd/distinfo b/sysutils/apcupsd/distinfo new file mode 100644 index 000000000000..5a036d397aa8 --- /dev/null +++ b/sysutils/apcupsd/distinfo @@ -0,0 +1 @@ +MD5 (apcupsd-3.8.3.tar.gz) = 05966c23d3404c8598e78663738bae0c diff --git a/sysutils/apcupsd/files/apcupsd.sh.sample b/sysutils/apcupsd/files/apcupsd.sh.sample new file mode 100644 index 000000000000..a4b8c95d3e9c --- /dev/null +++ b/sysutils/apcupsd/files/apcupsd.sh.sample @@ -0,0 +1,63 @@ +#!/bin/sh +# $FreeBSD$ +# startup scripts for APCUPSD. + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then + echo "$0: Cannot determine the PREFIX" >&2 + exit 1 +fi + +# If there is a global system configuration file, suck it in. +if [ -r /etc/defaults/rc.conf ]; then + . /etc/defaults/rc.conf + source_rc_confs +elif [ -r /etc/rc.conf ]; then + . /etc/rc.conf +fi + +apcupsd_enable=${apcupsd_enable:-YES} +apcupsd_program=${apcupsd_program:-${PREFIX}/sbin/apcupsd} +apcupsd_flags=${apcupsd_flags:-"--kill-on-powerfail"} +apcupsd_pidfile=${apcupsd_pidfile:-/var/run/apcupsd.pid} +apcupsd_lockfile=${apcupsd_pidfile:-/var/spool/lock/apcupsd.lock + +case $1 in + start) + case "${apcupsd_enable}" in + [Yy][Ee][Ss]) + rm -f /var/run/powerfail + rm -f /var/run/nologin + if [ -f ${apcupsd_program} ]; then + echo -n " apcupsd" + ${apcupsd_program} ${apcupsd_flags} || return=" Failed." + touch ${apcupsd_lockfile} + fi + ;; + esac + ;; + + stop) + if [ -f ${apcupsd_pidfile} ]; then + PID=`cat ${apcupsd_pidfile}` + kill -KILL $PID || return=" Failed." + rm -f ${apcupsd_pidfile} + else + return=" Failed." + fi + ;; + + restart) + $0 stop + $0 start; + ;; + + status) + ${PREFIX}/sbin/apcaccess status + ;; + + *) + echo "usage: $0 {start|stop|restart|status}" 1>&2 + ;; +esac + +exit 0; diff --git a/sysutils/apcupsd/files/patch-aa b/sysutils/apcupsd/files/patch-aa new file mode 100644 index 000000000000..40f316a49128 --- /dev/null +++ b/sysutils/apcupsd/files/patch-aa @@ -0,0 +1,53 @@ +*** ../../configure Sat Dec 1 19:51:44 2001 +--- configure Sat Dec 1 19:53:05 2001 +*************** +*** 4327,4333 **** + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lmenu $LIBS" + cat > conftest.$ac_ext <&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lmenu -lcurses $LIBS" + cat > conftest.$ac_ext <&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lform $LIBS" + cat > conftest.$ac_ext <&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lform -lcurses $LIBS" + cat > conftest.$ac_ext <&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lpanel $LIBS" + cat > conftest.$ac_ext <&6 + else + ac_save_LIBS="$LIBS" +! LIBS="-lpanel -lcurses $LIBS" + cat > conftest.$ac_ext <