commit 38e075c578e768de00860a79371b4635df552fc8 Author: EnumDev Date: Sun Jun 21 15:30:10 2026 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..55e1912 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="OpenVPN/openvpn" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..f86a3da --- /dev/null +++ b/info.yml @@ -0,0 +1,27 @@ +name: openvpn +description: An easy-to-use, robust and highly configurable VPN (Virtual Private Network) +version: 2.7.4 +revision: 1 +url: https://openvpn.net/index.php/open-source.html +license: GPL-2.0-only +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - libcap-ng + - openssl + - lz4 + - lzo + - openssl + - pkcs11-helper + - sysusers +optional_depends: + - pam:For PAM authentication +make_depends: + - python-docutils +downloads: + - url: https://github.com/OpenVPN/openvpn/releases/download/v${BPM_PKG_VERSION}/openvpn-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 18db05f3d5eee3663db1914590044e5f96ff5cd47b6e7846c6a350806c23dbce diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..f333de9 --- /dev/null +++ b/recipe.sh @@ -0,0 +1,60 @@ +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + + autoreconf -fi +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + mkdir build + + ./configure --prefix=/usr \ + --enable-dco \ + --enable-pkcs11 \ + --enable-plugins \ + --disable-systemd \ + --enable-x509-alt-username + make +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + make check +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make DESTDIR="$BPM_OUTPUT" install + + # Install esvm service + install -Dm644 "$BPM_WORKDIR"/openvpn.esv "$BPM_OUTPUT"/etc/esvm/services/openvpn.esv + + # Install sysusers + install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/openvpn.conf + + # Install examples + install -d "$BPM_OUTPUT"/usr/share/openvpn + cp -r sample/sample-config-files "$BPM_OUTPUT"/usr/share/openvpn/examples + + # Install contrib + for FILE in $(find contrib -type f); do + case "$(file --brief --mime-type --no-sandbox "$FILE")" in + "text/x-shellscript") + install -Dm755 "$FILE" "$BPM_OUTPUT"/usr/share/openvpn/"$FILE" ;; + *) + install -Dm644 "$FILE" "$BPM_OUTPUT"/usr/share/openvpn/"$FILE" ;; + esac + done + + # Install package license + install -Dm644 "$BPM_SOURCE"/{COPYING,COPYRIGHT.GPL} -t "$BPM_OUTPUT"/usr/share/licenses/openvpn +} diff --git a/source-files/openvpn.esv b/source-files/openvpn.esv new file mode 100644 index 0000000..1ddbee7 --- /dev/null +++ b/source-files/openvpn.esv @@ -0,0 +1,4 @@ +name: openvpn +description: start the OpenVPN daemon +type: background +start_cmd: /usr/sbin/openvpn --config /etc/openvpn/openvpn.conf diff --git a/source-files/sysusers b/source-files/sysusers new file mode 100644 index 0000000..df04fbf --- /dev/null +++ b/source-files/sysusers @@ -0,0 +1 @@ +u! openvpn - "OpenVPN"