commit 18b7d7ecb4f2bc8b1f133a5ad3e890eebc0cf205 Author: EnumDev Date: Thu Oct 9 21:04:24 2025 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..7f68cc4 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Git repository +REPO="https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git" + +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | tail -1) + +# Trim prefix +VERSION=${TAG_NAME//libtraceevent-/} + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..62d4d38 --- /dev/null +++ b/pkg.info @@ -0,0 +1,18 @@ +name: libtraceevent +description: Linux kernel trace event library +version: 1.8.4 +revision: 1 +url: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ +license: GPL2-only,LGPL2.1-only +architecture: any +type: source +depends: + - glibc +make_depends: + - asciidoc + - xmlto +downloads: + - url: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: dc456d4d2bf4b4cd4d0c737d3374a8093f9e5ca18c1d7fc2279a4bf41e613121 diff --git a/source-files/documentation.patch b/source-files/documentation.patch new file mode 100644 index 0000000..0018ccf --- /dev/null +++ b/source-files/documentation.patch @@ -0,0 +1,12 @@ +diff -ruN a/Documentation/Makefile b/Documentation/Makefile +--- a/Documentation/Makefile 2021-12-20 03:09:42.000000000 +0100 ++++ b/Documentation/Makefile 2021-12-20 16:24:43.651313119 +0100 +@@ -13,8 +13,6 @@ + _MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT)) + _DOC_MAN3=$(patsubst %.txt,%.m,$(MAN3_TXT)) + +-OUTPUT := $(obj)/Documentation/ +- + MAN_XML=$(addprefix $(OUTPUT),$(_MAN_XML)) + MAN_HTML=$(addprefix $(OUTPUT),$(_MAN_HTML)) + DOC_MAN3=$(addprefix $(OUTPUT),$(_DOC_MAN3)) diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..55a07fc --- /dev/null +++ b/source.sh @@ -0,0 +1,28 @@ +# 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 + +# 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" + # Fix issue while building documentation + patch -Np1 -i "$BPM_WORKDIR"/documentation.patch +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + make EXTRA_CFLAGS="$CFLAGS" -j1 + make -C Documentation +} + +# 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" libdir_relative=lib prefix=/usr install + make -C Documentation DESTDIR="$BPM_OUTPUT" libdir_relative=lib prefix=/usr install + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSES/* -t "$BPM_OUTPUT"/usr/share/licenses/libtraceevent/ +}