Skip to content

Commit

Permalink
Add UDP Broadcast Relay GUI package. Implement #10818
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-ng committed Sep 30, 2022
1 parent 9bed0f4 commit 8d7abe7
Show file tree
Hide file tree
Showing 11 changed files with 1,061 additions and 0 deletions.
47 changes: 47 additions & 0 deletions net/pfSense-pkg-udpbroadcastrelay/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
PORTNAME= pfSense-pkg-udpbroadcastrelay
PORTVERSION= 1.0
PORTREVISION= 0
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
EXTRACT_ONLY= # empty

MAINTAINER= coreteam@pfsense.org
COMMENT= pfSense package UDP Broadcast Relay

LICENSE= APACHE20

RUN_DEPENDS= udpbroadcastrelay>0:net/udpbroadcastrelay

NO_BUILD= yes
NO_MTREE= yes

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

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

do-install:
${MKDIR} ${STAGEDIR}/etc/inc/priv
${MKDIR} ${STAGEDIR}${PREFIX}/pkg/udpbroadcastrelay
${MKDIR} ${STAGEDIR}${PREFIX}/www
${MKDIR} ${STAGEDIR}${DATADIR}

${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/udpbroadcastrelay.priv.inc \
${STAGEDIR}/etc/inc/priv
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/udpbroadcastrelay.xml \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/udpbroadcastrelay/udpbroadcastrelay.inc \
${STAGEDIR}${PREFIX}/pkg/udpbroadcastrelay
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/udpbroadcastrelay.php \
${STAGEDIR}${PREFIX}/www
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/udpbroadcastrelay_edit.php \
${STAGEDIR}${PREFIX}/www
${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
${STAGEDIR}${DATADIR}

@${REINPLACE_CMD} -i '' -e "s|%%PKGVERSION%%|${PKGVERSION}|" \
${STAGEDIR}${DATADIR}/info.xml

.include <bsd.port.mk>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/*
* udpbroadcastrelay.priv.inc
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2022 Rubicon Communications, LLC (Netgate)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

global $priv_list;

$priv_list['page-services-udpbroadcastrelay'] = array();
$priv_list['page-services-udpbroadcastrelay']['name'] = "WebCfg - Services: UDP Broadcast Relay";
$priv_list['page-services-udpbroadcastrelay']['descr'] = "Access the 'Services: UDP Broadcast Relay' page.";

$priv_list['page-services-udpbroadcastrelay']['match'] = array();
$priv_list['page-services-udpbroadcastrelay']['match'][] = "udpbroadcastrelay.php*";
$priv_list['page-services-udpbroadcastrelay']['match'][] = "udpbroadcastrelay_edit.php*";

?>
3 changes: 3 additions & 0 deletions net/pfSense-pkg-udpbroadcastrelay/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 net/pfSense-pkg-udpbroadcastrelay/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

${PKG_ROOTDIR}/usr/local/bin/php -f ${PKG_ROOTDIR}/etc/rc.packages %%PORTNAME%% ${2}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
<![CDATA[
/*
* udpbroadcastrelay.xml
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2022 Rubicon Communications, LLC (Netgate)
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
]]>
</copyright>
<name>udpbroadcastrelay</name>
<version>%%PKGVERSION%%</version>
<title>Services/UDP Broadcast Relay</title>
<include_file>/usr/local/pkg/udpbroadcastrelay/udpbroadcastrelay.inc</include_file>
<menu>
<name>UDP Broadcast Relay</name>
<section>Services</section>
<url>/udpbroadcastrelay.php</url>
</menu>
<service>
<name>udpbroadcastrelay</name>
<rcfile>udpbroadcastrelay.sh</rcfile>
<executable>udpbroadcastrelay</executable>
<description>UDP Broadcast Relay</description>
<starts_on_sync></starts_on_sync>
</service>
<plugins>
<item>
<type>plugin_carp</type>
</item>
</plugins>
<custom_php_resync_config_command>
<![CDATA[
udpbr_resync();
]]>
</custom_php_resync_config_command>
<custom_php_pre_deinstall_command>
<![CDATA[
udpbr_deinstall();
]]>
</custom_php_pre_deinstall_command>
</packagegui>

0 comments on commit 8d7abe7

Please sign in to comment.