On Sat, 22 Jan 2011, Kirill Bychkov wrote: > Hi. > This diff adds rc script, removes snmp flavor, which is marked as obsolete > upstream and doesn't build.
You are missing the pkgpath markers in the PLIST for people upgrading from the snmp flavor. Also the rm -f /etc/nologin line in the RC script is ... scary. > Index: Makefile > =================================================================== > RCS file: /cvs/ports/sysutils/apcupsd/Makefile,v > retrieving revision 1.8 > diff -u -p -r1.8 Makefile > --- Makefile 20 Nov 2010 17:22:40 -0000 1.8 > +++ Makefile 21 Jan 2011 20:42:14 -0000 > @@ -6,10 +6,10 @@ COMMENT-x11 = gapcmon - GUI for apcupsd > > DISTNAME = apcupsd-3.14.8 > PKGNAME-main = ${DISTNAME} > -REVISION-main = 1 > +REVISION-main = 2 > PKGNAME-cgi = ${DISTNAME:S/-/-cgi-/} > PKGNAME-x11 = ${DISTNAME:S/-/-x11-/} > -REVISION-x11 = 1 > +REVISION-x11 = 2 > > CATEGORIES = sysutils > > @@ -47,7 +47,6 @@ CONFIGURE_ARGS = --mandir=${PREFIX}/man > --enable-usb > > PSEUDO_FLAVORS = no_x11 > -FLAVORS = snmp > FLAVOR ?= > > MULTI_PACKAGES = -main > @@ -73,13 +72,7 @@ WANTLIB-x11 += freetype gconf-2 gdk-x11- > WANTLIB-x11 += gmodule-2.0 gobject-2.0 gthread-2.0 gtk-x11-2.0 > WANTLIB-x11 += m pango-1.0 pangocairo-1.0 pangoft2-1.0 pixman-1 png > WANTLIB-x11 += pthread-stubs xcb-render xcb z ${WANTLIB} c pthread > -WANTLIB-x11 += GL X11-xcb Xxf86vm drm xcb-shm > -.endif > - > -.if ${FLAVOR:L:Msnmp} > -CONFIGURE_ARGS += --enable-net-snmp > -LIB_DEPENDS-main += ::net/net-snmp > -WANTLIB-main = ${WANTLIB} crypto netsnmp > +WANTLIB-x11 += GL Xxf86vm drm xcb-shm > .endif > > FAKE_FLAGS = sysconfdir=${TRUEPREFIX}/share/examples/apcupsd/etc > Index: pkg/MESSAGE-main > =================================================================== > RCS file: /cvs/ports/sysutils/apcupsd/pkg/MESSAGE-main,v > retrieving revision 1.3 > diff -u -p -r1.3 MESSAGE-main > --- pkg/MESSAGE-main 17 Jun 2010 18:43:43 -0000 1.3 > +++ pkg/MESSAGE-main 21 Jan 2011 20:42:14 -0000 > @@ -1,10 +1,3 @@ > -To start apcupsd at boot time, edit ${SYSCONFDIR}/apcupsd/apcupsd.conf > -and add the following lines to /etc/rc.local: > - > -if [ -x ${PREFIX}/sbin/apcupsd ]; then > - echo -n ' apcupsd'; ${PREFIX}/sbin/apcupsctl start > -fi > - > To allow the system to be fully powered down (in order to preserve > UPS battery), add the following lines to /etc/rc.shutdown: > > Index: pkg/PLIST-main > =================================================================== > RCS file: /cvs/ports/sysutils/apcupsd/pkg/PLIST-main,v > retrieving revision 1.1.1.1 > diff -u -p -r1.1.1.1 PLIST-main > --- pkg/PLIST-main 25 May 2010 21:56:33 -0000 1.1.1.1 > +++ pkg/PLIST-main 21 Jan 2011 20:42:14 -0000 > @@ -82,3 +82,4 @@ share/examples/apcupsd/status/SmartUPS70 > share/examples/apcupsd/status/SmartUPS700.status > share/examples/apcupsd/status/newbackupspro1.status > share/examples/apcupsd/status/newbackupspro2.status > +@rcscript ${RCDIR}/apcupsd > Index: pkg/apcupsd.rc > =================================================================== > RCS file: pkg/apcupsd.rc > diff -N pkg/apcupsd.rc > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ pkg/apcupsd.rc 21 Jan 2011 20:42:14 -0000 > @@ -0,0 +1,15 @@ > +#!/bin/sh > +# > +# $OpenBSD$ > + > +daemon=${TRUEPREFIX}/sbin/apcupsd > +daemon_flags="-k" > + > +. /etc/rc.d/rc.subr > + > +rc_pre() { > + rm -f ${SYSCONFDIR}/apcupsd/powerfail > + rm -f /etc/nologin > +} > + > +rc_cmd $1 > > -- Antoine