aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/nut
diff options
context:
space:
mode:
authorsem <sem@FreeBSD.org>2005-07-14 16:21:12 +0800
committersem <sem@FreeBSD.org>2005-07-14 16:21:12 +0800
commitc15aa1d25f65d942ce21493bcd1bd4a624bc9759 (patch)
tree110817c513b8c46ef46ca4bd063f5822610f87b6 /sysutils/nut
parentd4ff1b92efae0e3c700a8cd4dc8d31a2315fb3fa (diff)
downloadfreebsd-ports-gnome-c15aa1d25f65d942ce21493bcd1bd4a624bc9759.tar.gz
freebsd-ports-gnome-c15aa1d25f65d942ce21493bcd1bd4a624bc9759.tar.zst
freebsd-ports-gnome-c15aa1d25f65d942ce21493bcd1bd4a624bc9759.zip
- Update to 2.0.2
- Make the port as master for soon-coming new ports - Resort MASTER_SITES - Homour portlint - Improve rcNG script - New maintainer PR: ports/83318 Submitted by: Joerg Pulz <Joerg.Pulz@frm2.tum.de> Approved by: DougB
Diffstat (limited to 'sysutils/nut')
-rw-r--r--sysutils/nut/Makefile79
-rw-r--r--sysutils/nut/distinfo8
-rw-r--r--sysutils/nut/files/nut.sh.sample7
-rw-r--r--sysutils/nut/files/patch-Makefile.in37
-rw-r--r--sysutils/nut/files/patch-man_Makefile.in11
-rw-r--r--sysutils/nut/pkg-plist7
6 files changed, 113 insertions, 36 deletions
diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile
index a690922c3ba4..e0b807227263 100644
--- a/sysutils/nut/Makefile
+++ b/sysutils/nut/Makefile
@@ -6,36 +6,46 @@
#
PORTNAME= nut
-PORTVERSION= 2.0.1
+PORTVERSION= 2.0.2
CATEGORIES= sysutils
-MASTER_SITES= http://us1.networkupstools.org/source/${PORTVERSION:R}/ \
- http://eu1.networkupstools.org/source/${PORTVERSION:R}/
+MASTER_SITES= http://eu1.networkupstools.org/source/${PORTVERSION:R}/ \
+ http://us1.networkupstools.org/source/${PORTVERSION:R}/
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${DISTNAME}${EXTRACT_SUFX}.sig
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+MAINTAINER= Joerg.Pulz@frm2.tum.de
+COMMENT?= Network UPS Tools
-MAINTAINER= ports@FreeBSD.org
-COMMENT= Network UPS Tools
+SUBSYS?= base
+.if ${SUBSYS} != base
+PKGNAMESUFFIX= -${SUBSYS}
+.endif
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/nut \
- --localstatedir=/var/db/nut \
+ --localstatedir=${STATEDIR} \
--datadir=${PREFIX}/etc/nut \
--with-drvpath=${PREFIX}/libexec/nut \
- --with-statepath=/var/db/nut \
- --with-altpidpath=/var/db/nut \
- --with-pidpath=/var/db/nut
+ --with-statepath=${STATEDIR} \
+ --with-altpidpath=${STATEDIR} \
+ --with-pidpath=${STATEDIR} \
+ --with-linux-hiddev=no
USE_RC_SUBR= yes
+STATEDIR= ${DESTDIR}/var/db/nut
+
+.include <bsd.port.pre.mk>
+.if ${SUBSYS} == base
MAN5= ups.conf.5 upsd.conf.5 upsd.users.5 upsmon.conf.5 \
upssched.conf.5
-MAN8= apcsmart.8 belkin.8 belkinunv.8 bestuferrups.8 bestups.8 \
- bestfcom.8 cpsups.8 cyberpower.8 etapro.8 everups.8 \
+MAN8= apcsmart.8 bcmxcp.8 belkin.8 belkinunv.8 bestuferrups.8 \
+ bestups.8 bestfcom.8 cpsups.8 cyberpower.8 etapro.8 everups.8 \
fentonups.8 genericups.8 ippon.8 isbmex.8 liebert.8 \
masterguard.8 metasys.8 mge-shut.8 mge-utalk.8 mustek.8 \
nutupsdrv.8 oneac.8 powercom.8 powermust.8 safenet.8 sms.8 \
- snmp-ups.8 tripplite.8 tripplitesu.8 upsc.8 upscmd.8 upsd.8 \
- upsdrvctl.8 upslog.8 upsmon.8 upsrw.8 upssched.8 victronups.8
+ solis.8 tripplite.8 tripplitesu.8 upsc.8 upscmd.8 upscode2.8 \
+ upsd.8 upsdrvctl.8 upslog.8 upsmon.8 upsrw.8 upssched.8 \
+ victronups.8
ALL_TARGET= all
INSTALL_TARGET= install install-conf
@@ -62,19 +72,52 @@ PLIST_SUB+= CGIFILES="@comment "
PLIST_SUB+= CGIDIRRM="@comment "
PLIST_SUB+= CGIETC="@comment "
.endif
+.endif
+
+.if ${SUBSYS} == usb
+LIB_DEPENDS= usb-0.1.8:${PORTSDIR}/devel/libusb
+ALL_TARGET= usb
+INSTALL_TARGET= install-usb
+
+MAN8= newhidups.8
+.endif
+.if ${SUBSYS} == snmp
+LIB_DEPENDS= netsnmp.7:${PORTSDIR}/net-mgmt/net-snmp
+ALL_TARGET= snmp
+INSTALL_TARGET= install-snmp
+
+MAN8= snmp-ups.8
+.endif
+
+.if ${SUBSYS} == libupsclient
+CONFIGURE_ARGS+= --enable-pkg-config \
+ --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig
+ALL_TARGET= lib
+INSTALL_TARGET= install-lib
+
+MAN3= upscli_connect.3 upscli_disconnect.3 upscli_readline.3 \
+ upscli_sendline.3 upscli_splitname.3 upscli_strerror.3
+
+post-patch:
+ @${REINPLACE_CMD} -e "s#@PKG_CFG_DIR@#${PREFIX}/libdata/pkgconfig#g" \
+ ${WRKSRC}/lib/Makefile.in
+.endif
+
+.if ${SUBSYS} == base
pre-install:
.if !defined(WITH_NUT_CGI) && !defined(BATCH) && !defined(PACKAGE_BUILDING)
@${ECHO_MSG} "Type \"make -DWITH_NUT_CGI\" if you want to build CGI scripts."
.endif
@${MKDIR} ${PREFIX}/libexec/nut
- @${MKDIR} /var/db/nut
- @${CHOWN} uucp:wheel /var/db/nut
- @${CHMOD} 0750 /var/db/nut
+ @${MKDIR} ${STATEDIR}
+ @${CHOWN} uucp:wheel ${STATEDIR}
+ @${CHMOD} 0750 ${STATEDIR}
post-install:
@${SED} -e "s#%%PREFIX%%#${PREFIX}#g" \
-e "s#%%RC_SUBR%%#${RC_SUBR}#g" \
+ -e "s#%%STATEDIR%%#${STATEDIR}#g" \
<${FILESDIR}/nut.sh.sample >${WRKSRC}/nut.sh
${INSTALL_SCRIPT} ${WRKSRC}/nut.sh ${PREFIX}/etc/rc.d/nut.sh
.if !defined(NOPORTDOCS)
@@ -88,4 +131,6 @@ post-install:
.endfor
.endif
-.include <bsd.port.mk>
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/sysutils/nut/distinfo b/sysutils/nut/distinfo
index 5477a5f59301..33e623586dce 100644
--- a/sysutils/nut/distinfo
+++ b/sysutils/nut/distinfo
@@ -1,4 +1,4 @@
-MD5 (nut-2.0.1.tar.gz) = fe28e182ab31015cfcfad5870a2322a2
-SIZE (nut-2.0.1.tar.gz) = 564545
-MD5 (nut-2.0.1.tar.gz.sig) = 5a44399917dbb14cb939266aeafcaf61
-SIZE (nut-2.0.1.tar.gz.sig) = 65
+MD5 (nut-2.0.2.tar.gz) = 6560df8d0a42f0f585d34ed1ae8c6f67
+SIZE (nut-2.0.2.tar.gz) = 609977
+MD5 (nut-2.0.2.tar.gz.sig) = 65bfaa136df1b0a1b73f983f51d706b3
+SIZE (nut-2.0.2.tar.gz.sig) = 65
diff --git a/sysutils/nut/files/nut.sh.sample b/sysutils/nut/files/nut.sh.sample
index 24945d485928..85638b71c5af 100644
--- a/sysutils/nut/files/nut.sh.sample
+++ b/sysutils/nut/files/nut.sh.sample
@@ -17,7 +17,7 @@
#
nut_enable=${nut_enable-"NO"}
nut_prefix=${nut_prefix-"%%PREFIX%%"}
-nut_pidfile=${nut_pidfile-"/var/db/nut/nut.pid"}
+nut_pidfile=${nut_pidfile-"%%STATEDIR%%/nut.pid"}
nut_upslog=${nut_upslog-"/var/log/ups.log"}
nut_upsloginterval=${nut_upsloginterval-"300"}
nut_upslogmail=${nut_upslogmail-"backups@localhost"}
@@ -27,7 +27,10 @@ nut_upslogmail=${nut_upslogmail-"backups@localhost"}
name="nut"
rcvar=`set_rcvar`
-start_cmd="nut_start"
+required_dirs="%%STATEDIR%%"
+required_files="${nut_prefix}/etc/nut/ups.conf ${nut_prefix}/etc/nut/upsd.conf ${nut_prefix}/etc/nut/upsd.users ${nut_prefix}/etc/nut/upsmon.conf"
+
+start_postcmd="nut_start"
stop_cmd="nut_stop"
nut_start() {
diff --git a/sysutils/nut/files/patch-Makefile.in b/sysutils/nut/files/patch-Makefile.in
new file mode 100644
index 000000000000..313109b69c9c
--- /dev/null
+++ b/sysutils/nut/files/patch-Makefile.in
@@ -0,0 +1,37 @@
+--- Makefile.in.orig Thu Jan 27 15:33:15 2005
++++ Makefile.in Fri Jul 8 21:45:32 2005
+@@ -90,6 +90,12 @@
+ install-cgi-conf:
+ @cd conf; $(MAKE) install-cgi-conf; cd ..;
+
++lib: build-lib
++
++build-lib:
++ @cd common ; $(MAKE) || exit 1; cd ..;
++ @cd clients; $(MAKE) libupsclient.a || exit 1; cd ..;
++
+ install-lib:
+ @cd clients; $(MAKE) install-lib; cd ..;
+ @cd man; $(MAKE) install-lib-man; cd ..;
+@@ -98,9 +104,8 @@
+ usb: build-usb
+
+ build-usb:
+- @cd drivers; $(MAKE) hidups; cd ..;
+- @cd drivers; $(MAKE) newhidups; cd ..;
+- @cd drivers; $(MAKE) energizerups; cd ..;
++ @cd common ; $(MAKE) || exit 1; cd ..;
++ @cd drivers; $(MAKE) newhidups || exit 1; cd ..;
+
+ install-usb:
+ @cd drivers; $(MAKE) install-usb; cd ..;
+@@ -109,7 +114,8 @@
+ snmp: build-snmp
+
+ build-snmp:
+- @cd drivers; $(MAKE) snmp-ups; cd ..;
++ @cd common ; $(MAKE) || exit 1; cd ..;
++ @cd drivers; $(MAKE) snmp-ups || exit 1; cd ..;
+
+ install-snmp: snmp install-snmp-man install-snmp-mgr
+
diff --git a/sysutils/nut/files/patch-man_Makefile.in b/sysutils/nut/files/patch-man_Makefile.in
deleted file mode 100644
index a4387d2a5bbf..000000000000
--- a/sysutils/nut/files/patch-man_Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- man/Makefile.in.orig Thu Nov 27 15:35:19 2003
-+++ man/Makefile.in Sat Feb 7 23:09:21 2004
-@@ -47,7 +47,7 @@
- echo $(INSTALLCMD) -m $(INSTALLMODE) $$f $(MANDIR)/man5; \
- $(INSTALLCMD) -m $(INSTALLMODE) $$f $(MANDIR)/man5; \
- done
-- @for f in $(MAN8_PAGES) ; do \
-+ @for f in $(MAN8_PAGES) $(SNMPPAGES) ; do \
- echo $(INSTALLCMD) -m $(INSTALLMODE) $$f $(MANDIR)/man8; \
- $(INSTALLCMD) -m $(INSTALLMODE) $$f $(MANDIR)/man8; \
- done
diff --git a/sysutils/nut/pkg-plist b/sysutils/nut/pkg-plist
index e8a2acfb9a78..e98706c5c707 100644
--- a/sysutils/nut/pkg-plist
+++ b/sysutils/nut/pkg-plist
@@ -1,3 +1,4 @@
+@unexec %D/etc/rc.d/nut.sh forcestop 2>/dev/null || true
bin/upsc
bin/upscmd
bin/upslog
@@ -12,6 +13,7 @@ etc/nut/upssched.conf.sample
@unexec rmdir %D/etc/nut 2>/dev/null || true
etc/rc.d/nut.sh
libexec/nut/apcsmart
+libexec/nut/bcmxcp
libexec/nut/belkin
libexec/nut/belkinunv
libexec/nut/bestfcom
@@ -38,8 +40,10 @@ libexec/nut/powercom
libexec/nut/powermust
libexec/nut/safenet
libexec/nut/sms
+libexec/nut/solis
libexec/nut/tripplite
libexec/nut/tripplitesu
+libexec/nut/upscode2
libexec/nut/upsdrvctl
libexec/nut/victronups
sbin/upsd
@@ -94,7 +98,6 @@ sbin/upssched
%%PORTDOCS%%@dirrm %%DOCSDIR%%/cables
%%PORTDOCS%%@dirrm %%DOCSDIR%%/drivers
%%PORTDOCS%%@dirrm %%DOCSDIR%%
-@dirrm libexec/nut
-@exec if [ ! -d /var/db/nut ]; then mkdir /var/db/nut; chown uucp:wheel /var/db/nut; chmod 0755 /var/db/nut; fi
+@unexec rmdir %D/libexec/nut 2>/dev/null || true
@unexec rmdir /var/db/nut 2>/dev/null || true
%%CGIDIRRM%%