From 155499e44ddc43a9197caad0ce920637cf0ff543 Mon Sep 17 00:00:00 2001 From: CapCreeperGR Date: Sat, 6 Jul 2024 20:37:12 +0000 Subject: [PATCH] Initial Commit --- pkg.info | 7 +++++++ source.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 pkg.info create mode 100644 source.sh diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..b7f9e39 --- /dev/null +++ b/pkg.info @@ -0,0 +1,7 @@ +name: p11-kit +description: Loads and enumerates PKCS#11 modules +version: 0.25.3 +url: https://p11-glue.freedesktop.org/ +license: BSD +architecture: any +type: source diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..09e1ed1 --- /dev/null +++ b/source.sh @@ -0,0 +1,40 @@ +# This is the source.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 + +DOWNLOAD="https://github.com/p11-glue/p11-kit/releases/download/${BPM_PKG_VERSION}/p11-kit-${BPM_PKG_VERSION}.tar.xz" +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() { + mkdir p11-build + cd p11-build + meson setup .. \ + --prefix=/usr \ + --buildtype=release \ + -Dtrust_paths=/etc/pki/anchors + ninja +} + +# 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() { + cd p11-build + LC=ALL=C ninja test +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + cd p11-build + DESTDIR="$BPM_OUTPUT" ninja install + ln -sfv /usr/libexec/p11-kit/trust-extract-compat "$BPM_OUTPUT"/usr/bin/update-ca-certificates +}