Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #14539: Initial commit to add Oracle Cloud Infrastructure integration to pfSe… #1291

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions net/pfSense-pkg-ocicarp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
PORTNAME= pfSense-pkg-ocicarp
PORTVERSION= 0.1
PORTREVISION= 1
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
EXTRACT_ONLY= # empty

MAINTAINER= ce_coe_infra_code_assist_ww_grp@oracle.com
COMMENT= pfSense package Oracle Cloud Infrastructure CARP

LICENSE= APACHE20

RUN_DEPENDS= oci:devel/oci-cli

USES= python:3.9-3.11 shebangfix

NO_BUILD= yes
NO_MTREE= yes

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

SHEBANG_FILES= ${FILESDIR}${PREFIX}/bin/ocicarp.py

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

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

${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/ocicarp.priv.inc \
${STAGEDIR}/etc/inc/priv
${INSTALL_SCRIPT} ${FILESDIR}${PREFIX}/bin/ocicarp.py \
${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/ocicarp.xml \
${STAGEDIR}${PREFIX}/pkg
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/ocicarp/ocicarp.inc \
${STAGEDIR}${PREFIX}/pkg/ocicarp
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/ocicarp_settings.php \
${STAGEDIR}${PREFIX}/www
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/shortcuts/pkg_ocicarp.inc \
${STAGEDIR}${PREFIX}/www/shortcuts
${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
${STAGEDIR}${DATADIR}

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

post-install:
${MKDIR} ${STAGEDIR}/usr/local/etc/devd
${MKDIR} ${STAGEDIR}/usr/local/etc/ocicarp

.include <bsd.port.mk>
30 changes: 30 additions & 0 deletions net/pfSense-pkg-ocicarp/files/etc/inc/priv/ocicarp.priv.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/*
* ocicarp.priv.inc
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2023, Oracle and/or its affiliates.
*
* 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-ocicarp'] = array();
$priv_list['page-services-ocicarp']['name'] = 'WebCfg - Services: Oracle Cloud Infrastructure CARP';
$priv_list['page-services-ocicarp']['descr'] = "Allow access the 'Services: Oracle Cloud Infrastructure CARP' page.";

$priv_list['page-services-ocicarp']['match'] = array();
$priv_list['page-services-ocicarp']['match'][] = 'ocicarp_settings.php*';

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