commit 39e440bbb16b3ee78ab3340bf997c96146e6b234 Author: EnumDev Date: Fri May 9 19:27:06 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..69e30ac --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Package name +PKGNAME="os-prober" + +# Get version number from debian sources api +VERSION=$(curl -s -L https://sources.debian.org/api/src/os-prober/ | jq -r '.versions[0].version') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..1f4bd6f --- /dev/null +++ b/pkg.info @@ -0,0 +1,7 @@ +name: os-prober +description: Utility to detect other OSes on a set of drives +version: 1.83 +url: https://joeyh.name/code/os-prober/ +license: GPL2-or-later +architecture: any +type: source diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..f623373 --- /dev/null +++ b/source.sh @@ -0,0 +1,36 @@ +# 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://deb.debian.org/debian/pool/main/o/os-prober/os-prober_${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() { + make +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + install -Dm755 os-prober linux-boot-prober -t "$BPM_OUTPUT"/usr/bin + install -Dm755 newns "$BPM_OUTPUT"/usr/lib/os-prober/newns + install -Dm755 common.sh "$BPM_OUTPUT"/usr/share/os-prober/common.sh + + for dir in os-probes os-probes/mounted os-probes/init linux-boot-probes linux-boot-probes/mounted; do + install -dm755 "$BPM_OUTPUT"/usr/lib/${dir} + install -m755 -t "$BPM_OUTPUT"/usr/lib/${dir} ${dir}/common/* + [[ -d "${dir}"/x86 ]] && cp -r ${dir}/x86/* "$BPM_OUTPUT"/usr/lib/${dir} + done + + install -Dm755 os-probes/mounted/powerpc/20macosx "$BPM_OUTPUT"/usr/lib/os-probes/mounted/20macosx + install -dm755 "$BPM_OUTPUT"/var/lib/os-prober +}