Skip to content

Commit

Permalink
Merge pull request #128 from dbaio/apcupsd
Browse files Browse the repository at this point in the history
  • Loading branch information
rbgarga committed Aug 4, 2016
2 parents 6c6c877 + b715f6b commit ee758b9
Show file tree
Hide file tree
Showing 12 changed files with 1,379 additions and 0 deletions.
48 changes: 48 additions & 0 deletions sysutils/pfSense-pkg-apcupsd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# $FreeBSD$

PORTNAME= pfSense-pkg-apcupsd
PORTVERSION= 0.3.9
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
EXTRACT_ONLY= # empty

MAINTAINER= [email protected]
COMMENT= pfSense package apcupsd

LICENSE= ESF

RUN_DEPENDS= ${LOCALBASE}/sbin/apcupsd:sysutils/apcupsd

NO_BUILD= yes
NO_MTREE= yes

SUB_FILES= pkg-install pkg-deinstall
SUB_LIST= PORTNAME=${PORTNAME}

do-extract:
${MKDIR} ${WRKSRC}

do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/pkg
${MKDIR} ${STAGEDIR}${PREFIX}/www
${MKDIR} ${STAGEDIR}/etc/inc/priv
${MKDIR} ${STAGEDIR}${DATADIR}
${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/apcupsd.xml \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/apcupsd.inc \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/apcupsd_status.php \
${STAGEDIR}${PREFIX}/www
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/apcupsd.conf.php \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/apcupsd_mail.php \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/apcupsd.priv.inc \
${STAGEDIR}/etc/inc/priv
${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
${STAGEDIR}${DATADIR}
@${REINPLACE_CMD} -i '' -e "s|%%PKGVERSION%%|${PKGVERSION}|" \
${STAGEDIR}${DATADIR}/info.xml

.include <bsd.port.mk>
38 changes: 38 additions & 0 deletions sysutils/pfSense-pkg-apcupsd/files/etc/inc/priv/apcupsd.priv.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/*
apcupsd.priv.inc
part of pfSense (http://www.pfSense.org/)
Copyright (C) 2015 ESF, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
global $priv_list;

$priv_list['page-services-apcupsd'] = array();
$priv_list['page-services-apcupsd']['name'] = "WebCfg - Services: apcupsd";
$priv_list['page-services-apcupsd']['descr'] = "Allow access to apcupsd package GUI";
$priv_list['page-services-apcupsd']['match'] = array();
$priv_list['page-services-apcupsd']['match'][] = "pkg_edit.php?xml=apcupsd.xml*";
$priv_list['page-services-apcupsd']['match'][] = "apcupsd_status.php*";

?>
3 changes: 3 additions & 0 deletions sysutils/pfSense-pkg-apcupsd/files/pkg-deinstall.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/usr/local/bin/php -f /etc/rc.packages %%PORTNAME%% ${2}
7 changes: 7 additions & 0 deletions sysutils/pfSense-pkg-apcupsd/files/pkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [ "${2}" != "POST-INSTALL" ]; then
exit 0
fi

/usr/local/bin/php -f /etc/rc.packages %%PORTNAME%% ${2}
Loading

0 comments on commit ee758b9

Please sign in to comment.