From 424124850e0b2ecc33b046c27e4192d96caddce2 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 9 Jul 2026 16:47:07 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ check-version.sh | 15 +++++++++++++++ info.yml | 31 +++++++++++++++++++++++++++++++ recipe.sh | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 info.yml create mode 100644 recipe.sh 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..3ec9f3f --- /dev/null +++ b/check-version.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Github repository +REPO="miniupnp/miniupnp" + +# 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 | jq -r '.[].tag_name' | grep '^miniupnpc_' | head -n1) + +# Trim prefix +VERSION=${TAG_NAME//miniupnpc_} + +# Replace '_' with '.' +VERSION=${VERSION//_/.} + +echo "$VERSION" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..cca3508 --- /dev/null +++ b/info.yml @@ -0,0 +1,31 @@ +name: miniupnpc +description: Small UPnP client library/tool to access Internet Gateway Devices +version: 2.3.3 +revision: 1 +url: https://miniupnp.tuxfamily.org/ +license: BSD-3-Clause +maintainers: + - enumdev@enumerated.dev +architecture: any +type: source +depends: + - glibc + - sh +make_depends: + - python3=3.14.* + - python-build + - python-installer + - python-setuptools + - python-wheel +downloads: + - url: http://miniupnp.free.fr/files/miniupnpc-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: d52a0afa614ad6c088cc9ddff1ae7d29c8c595ac5fdd321170a05f41e634bd1a +split_packages: + - name: miniupnpc + - name: python-miniupnpc + description: Python bindings for miniupnpc + depends: + - glibc + - python3=3.14.* diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..6d26553 --- /dev/null +++ b/recipe.sh @@ -0,0 +1,36 @@ +# 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 build function is executed in the source directory +# This function is used to compile the source code +build() { + make + python3 -m build --wheel --no-isolation . +} + +# 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 test +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package_miniupnpc() { + make DESTDIR="$BPM_OUTPUT" install + + # Install man page + install -Dm644 man3/miniupnpc.3 -t "$BPM_OUTPUT"/usr/share/man/man3 + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/miniupnpc/LICENSE +} + +package_python-miniupnpc() { + python3 -m installer --destdir="$BPM_OUTPUT" dist/*.whl + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/python-miniupnpc/LICENSE +}