1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

- Update to 3.14.2

- Now the port build depends on devel/makedepend
- Utilize ETCDIR for Makefile and pkg-plist
- Move pkg-message to FILESDIR
- No need to use USE_GETTEXT=yes, because port doesn't install any mo files
and --enable-nls option doesn't help. With --with-included-gettext apcupsd
doesn't build.

PR:		ports/116774
Submitted by:	Alexander Logvinov
This commit is contained in:
Ion-Mihai Tetcu 2007-10-21 10:39:39 +00:00
parent 64ae7ba97f
commit a62bccf85a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=201714
5 changed files with 42 additions and 39 deletions

View File

@ -6,7 +6,7 @@
#
PORTNAME= apcupsd
PORTVERSION= 3.14.1
PORTVERSION= 3.14.2
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S/$/:src_sf/g} \
http://sce-tindy.tecnik93.com/FreeBSD/ports/${PORTNAME}/sources/:src_bk \
@ -21,14 +21,16 @@ IGNOREFILES= ${PORTNAME}.pdf
MAINTAINER= itetcu@FreeBSD.org
COMMENT= A daemon for controlling APC UPS
USE_GETTEXT= yes
BUILD_DEPENDS= makedepend:${PORTSDIR}/devel/makedepend
USE_RC_SUBR= apcupsd
SUB_FILES= pkg-message
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --sbindir=${PREFIX}/sbin \
--with-nologin=/var/run \
--disable-install-distdir \
--sysconfdir=${PREFIX}/etc/apcupsd \
--sysconfdir=${ETCDIR} \
--with-serial-dev=/dev/usv
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -L${LOCALBASE}/lib" \
@ -51,7 +53,7 @@ CONFIGURE_ARGS+= --enable-net
.endif
.if defined(WITH_CGI)
CONFIGURE_ARGS+= --enable-cgi --with-cgi-bin=${PREFIX}/etc/apcupsd/cgi
CONFIGURE_ARGS+= --enable-cgi --with-cgi-bin=${ETCDIR}/cgi
LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
PLIST_SUB+= CGI=""
.else
@ -79,21 +81,21 @@ post-install:
# the package list. So the port could be removed without problems
for na in apccontrol commfailure mainsback mastertimeout \
changeme commok masterconnect onbattery; do \
if [ -f ${PREFIX}/etc/apcupsd/$$na.orig ]; then \
if cmp -s ${PREFIX}/etc/apcupsd/$$na ${PREFIX}/etc/apcupsd/$$na.orig; then \
${ECHO_CMD} "etc/apcupsd/$$na.orig" >> ${TMPPLIST}; \
if [ -f ${ETCDIR}/$$na.orig ]; then \
if cmp -s ${ETCDIR}/$$na ${ETCDIR}/$$na.orig; then \
${ECHO_CMD} "%%ETCDIR%%/$$na.orig" >> ${TMPPLIST}; \
fi \
fi; \
done
@${ECHO_CMD} "@unexec if [ -d %D/etc/apcupsd ]; then ${ECHO_CMD} \"If you are permanently removing this port, you should do a ``rm -rf ${PREFIX}/etc/apcupsd`` to remove config files left.\" | ${FMT} ; fi" >> ${TMPPLIST}
@${ECHO_CMD} "@unexec if [ -d %D/${ETCDIR_REL} ]; then ${ECHO_CMD} \"If you are permanently removing this port, you should do a ``rm -rf ${ETCDIR}`` to remove config files left.\" | ${FMT} ; fi" >> ${TMPPLIST}
# Install sample startup script
# If there is already a config file it is installed as ...new
for na in apcupsd.conf apcupsd.css hosts.conf multimon.conf; do \
if [ -f ${PREFIX}/etc/apcupsd/$$na ]; then \
if [ -f ${PREFIX}/etc/apcupsd/$$na.new ]; then \
${MV} ${PREFIX}/etc/apcupsd/$$na.new ${PREFIX}/etc/apcupsd/$$na.sample; \
if [ -f ${ETCDIR}/$$na ]; then \
if [ -f ${ETCDIR}/$$na.new ]; then \
${MV} ${ETCDIR}/$$na.new ${ETCDIR}/$$na.sample; \
else \
${CP} ${PREFIX}/etc/apcupsd/$$na ${PREFIX}/etc/apcupsd/$$na.sample; \
${CP} ${ETCDIR}/$$na ${ETCDIR}/$$na.sample; \
fi; \
fi; \
done
@ -101,5 +103,6 @@ post-install:
@${MKDIR} ${DOCSDIR}
cd ${DISTDIR} && ${INSTALL_DATA} ${PORTNAME}.pdf ${DOCSDIR}
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -1,5 +1,5 @@
MD5 (apcupsd-3.14.1.tar.gz) = 258eb7515a12de493bb8952bc6d2f4e1
SHA256 (apcupsd-3.14.1.tar.gz) = 3d68ce2c387194a8d6d2afae40dbaa0c02a87992ac1bdbd2495b1b610266c123
SIZE (apcupsd-3.14.1.tar.gz) = 4352400
MD5 (apcupsd-3.14.2.tar.gz) = fd8785e7607d20cefa68dc20e44eebc4
SHA256 (apcupsd-3.14.2.tar.gz) = 72605e54356ffe32dc24159b4094a5b7e5e978d2440edded8b01496af9caca50
SIZE (apcupsd-3.14.2.tar.gz) = 4345034
MD5 (apcupsd.pdf) = IGNORE
SHA256 (apcupsd.pdf) = IGNORE

View File

@ -28,7 +28,7 @@ load_rc_config $name
: ${apcupsd_lockfile="/var/spool/lock/apcupsd.lock"}
pidfile="/var/run/apcupsd.pid"
required_files="%%PREFIX%%/etc/apcupsd/apcupsd.conf"
required_files="%%ETCDIR%%/apcupsd.conf"
command="%%PREFIX%%/sbin/apcupsd"
run_rc_command "$1"

View File

@ -1,14 +1,14 @@
**********************************************************************
Read the manual
${PREFIX}/share/doc/apcupsd/manual.pdf
%%DOCSDIR%%/manual.pdf
to do site specific configuration assigenments! Especially have a
detailed look into the chapter describing the shutdown procedure.
Sample files are installed in ${PREFIX}/etc/apcupsd. These files
Sample files are installed in %%ETCDIR%%. These files
must be copied and/or configured for a proper working apcupsd.
You need to modify ${PREFIX}/etc/apcupsd/apcupsd.conf as follows:
You need to modify %%ETCDIR%%/apcupsd.conf as follows:
For serial cable: DEVICE /dev/cuadX (or /dev/cuaaX for [45.]x)
For USB cable: DEVICE (yes, leave it blank after DEVICE)

View File

@ -3,23 +3,23 @@ sbin/apcaccess
sbin/apctest
sbin/smtp
%%POWERFL%%sbin/powerflute
@unexec if cmp -s %D/etc/apcupsd/apcupsd.conf.sample %D/etc/apcupsd/apcupsd.conf; then rm -f %D/etc/apcupsd/apcupsd.conf; fi
etc/apcupsd/apcupsd.conf.sample
etc/apcupsd/apccontrol
etc/apcupsd/changeme
etc/apcupsd/commfailure
etc/apcupsd/commok
etc/apcupsd/onbattery
etc/apcupsd/offbattery
%%CGI%%@unexec if cmp -s %D/etc/apcupsd/apcupsd.css.sample %D/etc/apcupsd/apcupsd.css; then rm -f %D/etc/apcupsd/apcupsd.css; fi
%%CGI%%etc/apcupsd/apcupsd.css.sample
%%CGI%%@unexec if cmp -s %D/etc/apcupsd/hosts.conf.sample %D/etc/apcupsd/hosts.conf; then rm -f %D/etc/apcupsd/hosts.conf; fi
%%CGI%%etc/apcupsd/hosts.conf.sample
%%CGI%%@unexec if cmp -s %D/etc/apcupsd/multimon.conf.sample %D/etc/apcupsd/multimon.conf; then rm -f %D/etc/apcupsd/multimon.conf; fi
%%CGI%%etc/apcupsd/multimon.conf.sample
%%CGI%%etc/apcupsd/cgi/multimon.cgi
%%CGI%%etc/apcupsd/cgi/upsfstats.cgi
%%CGI%%etc/apcupsd/cgi/upsimage.cgi
%%CGI%%etc/apcupsd/cgi/upsstats.cgi
%%CGI%%@dirrm etc/apcupsd/cgi
@dirrmtry etc/apcupsd
@unexec if cmp -s %D/%%ETCDIR%%/apcupsd.conf.sample %D/%%ETCDIR%%/apcupsd.conf; then rm -f %D/%%ETCDIR%%/apcupsd.conf; fi
%%ETCDIR%%/apcupsd.conf.sample
%%ETCDIR%%/apccontrol
%%ETCDIR%%/changeme
%%ETCDIR%%/commfailure
%%ETCDIR%%/commok
%%ETCDIR%%/onbattery
%%ETCDIR%%/offbattery
%%CGI%%@unexec if cmp -s %D/%%ETCDIR%%/apcupsd.css.sample %D/%%ETCDIR%%/apcupsd.css; then rm -f %D/%%ETCDIR%%/apcupsd.css; fi
%%CGI%%%%ETCDIR%%/apcupsd.css.sample
%%CGI%%@unexec if cmp -s %D/%%ETCDIR%%/hosts.conf.sample %D/%%ETCDIR%%/hosts.conf; then rm -f %D/%%ETCDIR%%/hosts.conf; fi
%%CGI%%%%ETCDIR%%/hosts.conf.sample
%%CGI%%@unexec if cmp -s %D/%%ETCDIR%%/multimon.conf.sample %D/%%ETCDIR%%/multimon.conf; then rm -f %D/%%ETCDIR%%/multimon.conf; fi
%%CGI%%%%ETCDIR%%/multimon.conf.sample
%%CGI%%%%ETCDIR%%/cgi/multimon.cgi
%%CGI%%%%ETCDIR%%/cgi/upsfstats.cgi
%%CGI%%%%ETCDIR%%/cgi/upsimage.cgi
%%CGI%%%%ETCDIR%%/cgi/upsstats.cgi
%%CGI%%@dirrm %%ETCDIR%%/cgi
@dirrmtry %%ETCDIR%%