diff --git a/pkg.info b/pkg.info index e785420..65cc3b8 100644 --- a/pkg.info +++ b/pkg.info @@ -1,9 +1,34 @@ name: libseccomp description: Library providing an easy to use, platform independent, interface to the Linux Kernel's syscall filtering mechanism version: 2.6.0 +revision: 2 url: https://github.com/seccomp/libseccomp license: LGPL2.1 +maintainers: + - enumdev@enumerated.dev architecture: any -depends: ["glibc"] -make_depends: ["valgrind"] type: source +depends: + - glibc +make_depends: + - python-cython + - gperf + - python3=3.14.* + - python-build + - python-installer + - python-setuptools + - python-wheel +check_depends: + - valgrind +downloads: + - url: https://github.com/seccomp/libseccomp/releases/download/v${BPM_PKG_VERSION}/libseccomp-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 83b6085232d1588c379dc9b9cae47bb37407cf262e6e74993c61ba72d2a784dc +split_packages: + - name: libseccomp + - name: python-libseccomp + description: Python module for libseccomp + depends: + - glibc + - python3=3.14.* diff --git a/source.sh b/source.sh index d73c73c..fa97cd0 100644 --- a/source.sh +++ b/source.sh @@ -2,21 +2,15 @@ # 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 -DOWNLOAD="https://github.com/seccomp/libseccomp/releases/download/v${BPM_PKG_VERSION}/libseccomp-${BPM_PKG_VERSION}.tar.gz" -FILENAME="${DOWNLOAD##*/}" - -# The prepare function is executed in the root of the temp directory -# This function is used for downloading files and putting them into the correct location -prepare() { - wget "$DOWNLOAD" - tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" -} - # The build function is executed in the source directory # This function is used to compile the source code build() { - ./configure --prefix=/usr --disable-static + ./configure --prefix=/usr make + + # Build python module + cd src/python + VERSION_RELEASE=${BPM_PKG_VERSION} CPPFLAGS="$CPPFLAGS -I${BPM_SOURCE}/include" python -m build --wheel --no-isolation } # The check function is executed in the source directory @@ -27,9 +21,17 @@ check() { # The package function is executed in the source directory # This function is used to move the compiled files into the output directory -package() { +package_libseccomp() { make DESTDIR="$BPM_OUTPUT" install # Install package license install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/libseccomp/LICENSE } + +package_python-libseccomp() { + cd src/python + VERSION_RELEASE=${BPM_PKG_VERSION} python -m installer --destdir="$BPM_OUTPUT" dist/*.whl + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/libseccomp/LICENSE +}