summaryrefslogtreecommitdiff
path: root/sysutils/ups-nut/Makefile
diff options
context:
space:
mode:
authormartin <martin@pkgsrc.org>2000-12-28 16:06:13 +0000
committermartin <martin@pkgsrc.org>2000-12-28 16:06:13 +0000
commitbd0977227398b1b661e7bc4907069e693f42c48f (patch)
tree0542a36883ba87bb6118c8552b6647ef0532b249 /sysutils/ups-nut/Makefile
parent5440c4b68e1aba4c9c746b6a6bda7435ace6f2fb (diff)
downloadpkgsrc-bd0977227398b1b661e7bc4907069e693f42c48f.tar.gz
Initial import of ups-nut pkg (network ups tools), a collection of
tools used to monitor various UPSes. Pkg from collver@softhome.net with minor modifications. Closes PR 11745.
Diffstat (limited to 'sysutils/ups-nut/Makefile')
-rw-r--r--sysutils/ups-nut/Makefile78
1 files changed, 78 insertions, 0 deletions
diff --git a/sysutils/ups-nut/Makefile b/sysutils/ups-nut/Makefile
new file mode 100644
index 00000000000..12588ec7467
--- /dev/null
+++ b/sysutils/ups-nut/Makefile
@@ -0,0 +1,78 @@
+# $NetBSD: Makefile,v 1.1.1.1 2000/12/28 16:06:13 martin Exp $
+#
+
+DISTNAME= nut-0.44.2
+PKGNAME= ups-nut-0.44.2
+CATEGORIES= sysutils
+MASTER_SITES= http://www.exploits.org/nut/release/
+
+MAINTAINER= collver@softhome.net
+HOMEPAGE= http://www.exploits.org/nut/
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+.if exists(/usr/sbin/user)
+ADDUSER= /usr/sbin/useradd
+ADDGROUP= /usr/sbin/groupadd
+USERDEL= /usr/sbin/userdel
+GROUPDEL= /usr/sbin/groupdel
+.else
+DEPENDS+= user>=20000313:../../sysutils/user
+ADDUSER= ${LOCALBASE}/sbin/useradd
+ADDGROUP= ${LOCALBASE}/sbin/groupadd
+USERDEL= ${LOCALBASE}/sbin/userdel
+GROUPDEL= ${LOCALBASE}/sbin/groupdel
+.endif
+.elif ${OPSYS} == "SunOS"
+ADDUSER= useradd
+ADDGROUP= groupadd
+USERDEL= userdel
+GROUPDEL= groupdel
+.endif
+WRKSRC= ${WRKDIR}/nut-0.44.2
+DEINSTALL_FILE= ${WRKDIR}/DEINSTALL
+INSTALL_FILE= ${WRKDIR}/INSTALL
+
+GNU_CONFIGURE= yes
+NUT_DOCDIR= ${LOCALBASE}/share/doc/nut
+NUT_USER= nut
+NUT_GROUP= nut
+CONFIGURE_ARGS+= --sysconfdir=${LOCALBASE}/etc/nut \
+ --with-user=${NUT_USER} \
+ --with-group=${NUT_GROUP} \
+ --with-statepath=/var/db/nut
+
+pre-install:
+ ${SED} -e 's|@NUT_USER@|${NUT_USER}|g' \
+ -e 's|@NUT_GROUP@|${NUT_GROUP}|g' \
+ -e 's|@USERDEL@|${USERDEL}|g' \
+ -e 's|@GROUPDEL@|${GROUPDEL}|g' \
+ < ${PKGDIR}/DEINSTALL > ${DEINSTALL_FILE}
+ ${SED} -e 's|@NUT_USER@|${NUT_USER}|g' \
+ -e 's|@NUT_GROUP@|${NUT_GROUP}|g' \
+ -e 's|@USERDIR@|${USERDIR}|g' \
+ -e 's|@ADDUSER@|${ADDUSER}|g' \
+ -e 's|@ADDGROUP@|${ADDGROUP}|g' \
+ -e 's|@CHGRP@|${CHGRP}|g' \
+ -e 's|@GREP@|${GREP}|g' \
+ -e 's|@RM@|${RM}|g' \
+ -e 's|@TOUCH@|${TOUCH}|g' \
+ < ${PKGDIR}/INSTALL > ${INSTALL_FILE}
+ ${SH} ${INSTALL_FILE}
+
+post-install:
+ @${SED} -e "/%%PREFIX%%/s##${LOCALBASE}#g" \
+ ${WRKSRC}/scripts/NetBSD/upsd \
+ >${LOCALBASE}/etc/rc.d/upsd
+ @${CHMOD} 0755 ${LOCALBASE}/etc/rc.d/upsd
+ @${INSTALL} -d -o ${NUT_USER} -g ${NUT_GROUP} -m 0770 /var/db/nut
+ @if ! [ -d ${NUT_DOCDIR} ]; then ${MKDIR} ${NUT_DOCDIR}; fi
+ @if ! [ -d ${NUT_DOCDIR}/cables ]; then ${MKDIR} ${NUT_DOCDIR}/cables; fi
+ ${INSTALL_DATA} ${WRKSRC}/docs/cables/*.txt ${NUT_DOCDIR}/cables
+ ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${NUT_DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/docs/FAQ ${NUT_DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/docs/Changes.trust ${NUT_DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${NUT_DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/QUICKSTART ${NUT_DOCDIR}
+
+.include "../../mk/bsd.pkg.mk"