From 02e44040b590987de9640b454687b645da56c98b Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 27 Dec 2025 15:49:57 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 12 ++++++++++++ pkg.info | 25 +++++++++++++++++++++++++ source.sh | 19 +++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source.sh 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..a82bde6 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Git repository +REPO="https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git" + +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | sort -V | tail -n1) + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..398727a --- /dev/null +++ b/pkg.info @@ -0,0 +1,25 @@ +name: usbutils +description: A collection of USB tools to query connected USB devices +version: "019" +revision: 1 +url: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git/ +license: GPL2-only,GPL2-or-later,GPL3-only,LGPL2.1-or-later,MIT +architecture: any +type: source +depends: + - glibc + - hwdata + - libudev + - libusb +optional_depends: + - coreutils + - python3 + - sh +make_depends: + - meson + - udev +downloads: + - url: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbutils.git/snapshot/usbutils-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: f0df341a2125a4bdf2f88c77c3828af9f24c2d58e30928c45b23f41e1315df7a diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..783343f --- /dev/null +++ b/source.sh @@ -0,0 +1,19 @@ +# 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 build function is executed in the source directory +# This function is used to compile the source code +build() { + meson setup build --prefix=/usr + meson compile -C build +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + meson install -C build --destdir="$BPM_OUTPUT" + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSES/*.txt -t "$BPM_OUTPUT"/usr/share/licenses/usbutils/ +}