aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/apcupsd/files
diff options
context:
space:
mode:
authorlkoeller <lkoeller@FreeBSD.org>2001-12-02 19:24:53 +0800
committerlkoeller <lkoeller@FreeBSD.org>2001-12-02 19:24:53 +0800
commit8390e887e9903fff45407a9e88c143eef5dc1fa6 (patch)
tree1fd857b920fc152163f75261c8c3613ac6880cec /sysutils/apcupsd/files
parent34c2861b04cd7b214426489b829611dfa07701bb (diff)
downloadfreebsd-ports-gnome-8390e887e9903fff45407a9e88c143eef5dc1fa6.tar.gz
freebsd-ports-gnome-8390e887e9903fff45407a9e88c143eef5dc1fa6.tar.zst
freebsd-ports-gnome-8390e887e9903fff45407a9e88c143eef5dc1fa6.zip
Add apcupsd 3.8.3, a daemon for controlling APC UPS.
PR: 31478 Submitted by: Lars Koeller <Lars.Koeller@Uni-Bielefeld.DE>
Diffstat (limited to 'sysutils/apcupsd/files')
-rw-r--r--sysutils/apcupsd/files/apcupsd.sh.sample63
-rw-r--r--sysutils/apcupsd/files/patch-aa53
-rw-r--r--sysutils/apcupsd/files/patch-ab79
-rw-r--r--sysutils/apcupsd/files/patch-ba53
4 files changed, 248 insertions, 0 deletions
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 <<EOF
+ #line 4333 "configure"
+ #include "confdefs.h"
+--- 4327,4333 ----
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+! LIBS="-lmenu -lcurses $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 4333 "configure"
+ #include "confdefs.h"
+***************
+*** 4368,4374 ****
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+! LIBS="-lform $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 4374 "configure"
+ #include "confdefs.h"
+--- 4368,4374 ----
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+! LIBS="-lform -lcurses $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 4374 "configure"
+ #include "confdefs.h"
+***************
+*** 4409,4415 ****
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+! LIBS="-lpanel $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 4415 "configure"
+ #include "confdefs.h"
+--- 4409,4415 ----
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+! LIBS="-lpanel -lcurses $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 4415 "configure"
+ #include "confdefs.h"
diff --git a/sysutils/apcupsd/files/patch-ab b/sysutils/apcupsd/files/patch-ab
new file mode 100644
index 000000000000..2c4847cf9d5b
--- /dev/null
+++ b/sysutils/apcupsd/files/patch-ab
@@ -0,0 +1,79 @@
+*** Makefile.in.orig Sat Nov 24 09:23:03 2001
+--- Makefile.in Sun Dec 2 11:47:56 2001
+***************
+*** 196,202 ****
+ install-:
+ $(MAKE) dummy
+
+! install: install-apcupsd@WIN32@ install-@POWERFLUTE@ install-cgi @INSTALL_DISTDIR@
+
+ install-powerflute: powerflute
+ @echo "Installing powerflute binary..."
+--- 196,202 ----
+ install-:
+ $(MAKE) dummy
+
+! install: install-apcupsd@WIN32@ install-@POWERFLUTE@ install-cgi
+
+ install-powerflute: powerflute
+ @echo "Installing powerflute binary..."
+***************
+*** 219,249 ****
+ @echo "Installing apcaccess binary..."
+ $(INSTALL_PROGRAM) $(srcdir)/apcaccess $(sbindir)/apcaccess
+ @echo "Installing apccontrol script..."
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/distributions/$(DISTNAME)/apccontrol.sh $(sysconfdir)/apccontrol
+ @echo "Installing manual pages..."
+ $(INSTALL_DATA) $(srcdir)/doc/apcupsd.man $(mandir)/apcupsd.$(manext)
+ @echo "Installing language catalogs..."
+ @POMAKE@ install
+ # don't overwrite any existing config file
+! echo "Installing apcupsd.conf..."; \
+ if [ -f $(srcdir)/distributions/$(DISTNAME)/apcupsd.conf ]; then \
+ srcconf=$(srcdir)/distributions/$(DISTNAME)/apcupsd.conf; \
+ else \
+ srcconf=etc/apcupsd.conf; \
+ fi; \
+! if test -f $(sysconfdir)/apcupsd.conf; then \
+! dstconf=apcupsd.conf.new; \
+! echo " found old apcupsd.conf, installing new conf file as $$dstconf"; \
+! else \
+! dstconf=apcupsd.conf; \
+! fi; \
+ echo "$(INSTALL_DATA) $$srcconf $(sysconfdir)/$$dstconf"; \
+! $(INSTALL_PROGRAM) -m 644 $$srcconf $(sysconfdir)/$$dstconf
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/etc/changeme $(sysconfdir)
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/etc/commfailure $(sysconfdir)
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/etc/commok $(sysconfdir)
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/etc/onbattery $(sysconfdir)
+! $(INSTALL_PROGRAM) -m 744 $(srcdir)/etc/mainsback $(sysconfdir)
+
+
+ install-apcupsdwin32: apcupsd
+--- 219,244 ----
+ @echo "Installing apcaccess binary..."
+ $(INSTALL_PROGRAM) $(srcdir)/apcaccess $(sbindir)/apcaccess
+ @echo "Installing apccontrol script..."
+! $(INSTALL_DATA) -m 744 $(srcdir)/distributions/$(DISTNAME)/apccontrol.sh $(sysconfdir)/apccontrol
+ @echo "Installing manual pages..."
+ $(INSTALL_DATA) $(srcdir)/doc/apcupsd.man $(mandir)/apcupsd.$(manext)
+ @echo "Installing language catalogs..."
+ @POMAKE@ install
+ # don't overwrite any existing config file
+! echo "Installing sample apcupsd.conf..."; \
+ if [ -f $(srcdir)/distributions/$(DISTNAME)/apcupsd.conf ]; then \
+ srcconf=$(srcdir)/distributions/$(DISTNAME)/apcupsd.conf; \
+ else \
+ srcconf=etc/apcupsd.conf; \
+ fi; \
+! dstconf=apcupsd.conf.sample; \
+ echo "$(INSTALL_DATA) $$srcconf $(sysconfdir)/$$dstconf"; \
+! $(INSTALL_DATA) -m 644 $$srcconf $(sysconfdir)/$$dstconf
+! $(INSTALL_DATA) -m 744 $(srcdir)/etc/changeme $(sysconfdir)
+! $(INSTALL_DATA) -m 744 $(srcdir)/etc/commfailure $(sysconfdir)
+! $(INSTALL_DATA) -m 744 $(srcdir)/etc/commok $(sysconfdir)
+! $(INSTALL_DATA) -m 744 $(srcdir)/etc/onbattery $(sysconfdir)
+! $(INSTALL_DATA) -m 744 $(srcdir)/etc/mainsback $(sysconfdir)
+
+
+ install-apcupsdwin32: apcupsd
diff --git a/sysutils/apcupsd/files/patch-ba b/sysutils/apcupsd/files/patch-ba
new file mode 100644
index 000000000000..303f4604837f
--- /dev/null
+++ b/sysutils/apcupsd/files/patch-ba
@@ -0,0 +1,53 @@
+*** cgi/Makefile.in.orig Thu Jun 21 10:16:41 2001
+--- cgi/Makefile.in Sun Dec 2 11:04:54 2001
+***************
+*** 84,89 ****
+--- 84,92 ----
+ rm -f Makefile config.h
+
+ install: cgi
++ @if test ! -d $(cgibin) ; then \
++ mkdir -p $(cgibin); \
++ fi
+ @for p in $(CGIPROGS) ; do \
+ echo $(INSTALL_PROGRAM) $$p $(cgibin); \
+ $(INSTALL_PROGRAM) $$p $(cgibin); \
+***************
+*** 98,114 ****
+ echo "No CSS_DIR found, did not install multimon.css" ; \
+ fi
+ # don't overwrite any existing config file
+! @if test ! -f $(sysconfdir)/hosts.conf; then \
+! (echo "Installing hosts.conf..." && $(INSTALL_DATA) ../etc/hosts.conf $(sysconfdir)/hosts.conf); \
+! else \
+! (echo "Installing hosts.conf in $(sysconfdir)/hosts.conf.new" && $(INSTALL_DATA) ../etc/hosts.conf $(sysconfdir)/hosts.conf.new); \
+! fi
+ # don't overwrite any existing config file
+! @if test ! -f $(sysconfdir)/multimon.conf; then \
+! (echo "Installing multimon.conf..." && $(INSTALL_DATA) ../etc/multimon.conf $(sysconfdir)/multimon.conf); \
+! else \
+! (echo "Installing multimon.conf in $(sysconfdir)/multimon.conf.new" && $(INSTALL_DATA) ../etc/multimon.conf $(sysconfdir)/multimon.conf.new); \
+! fi
+
+ uninstall:
+ @echo "Uninstalling cgi program support..."
+--- 101,119 ----
+ echo "No CSS_DIR found, did not install multimon.css" ; \
+ fi
+ # don't overwrite any existing config file
+! # @if test ! -f $(sysconfdir)/hosts.conf; then \
+! # (echo "Installing hosts.conf..." && $(INSTALL_DATA) ../etc/hosts.conf $(sysconfdir)/hosts.conf); \
+! # else \
+! # (echo "Installing hosts.conf in $(sysconfdir)/hosts.conf.new" && $(INSTALL_DATA) ../etc/hosts.conf $(sysconfdir)/hosts.conf.new); \
+! # fi
+! $(INSTALL_DATA) ../etc/hosts.conf $(sysconfdir)/hosts.conf.sample
+ # don't overwrite any existing config file
+! # @if test ! -f $(sysconfdir)/multimon.conf; then \
+! # (echo "Installing multimon.conf..." && $(INSTALL_DATA) ../etc/multimon.conf $(sysconfdir)/multimon.conf); \
+! # else \
+! # (echo "Installing multimon.conf in $(sysconfdir)/multimon.conf.new" && $(INSTALL_DATA) ../etc/multimon.conf $(sysconfdir)/multimon.conf.new); \
+! # fi
+! $(INSTALL_DATA) ../etc/multimon.conf $(sysconfdir)/multimon.conf.sample
+
+ uninstall:
+ @echo "Uninstalling cgi program support..."