From 784e26254a7e154e8afaad6e04b57282df7655aa Mon Sep 17 00:00:00 2001 From: EnumDev Date: Mon, 3 Nov 2025 16:57:47 +0200 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 9 +++++++ pkg.info | 26 ++++++++++++++++++ source.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 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..7bc2845 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Sourceforge project +REPO="refind" + +# Get version using best_release.json +VERSION=$(curl -s -L https://sourceforge.net/projects/"$REPO"/best_release.json | jq '.platform_releases.linux.filename' | cut -d'/' -f3 | grep -oE '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}(\.[0-9]{1,})?') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..d6675e1 --- /dev/null +++ b/pkg.info @@ -0,0 +1,26 @@ +name: refind +description: EFI Boot Manager +version: 0.14.2 +revision: 1 +url: https://www.rodsbooks.com/refind/ +license: BSD-2-Clause,CC-BY-SA-3.0,CC-BY-SA-4.0,GPL2-only,GPL2-or-later,GPL3-or-later,LGPL2.1-or-later,LGPL3-or-later OR CC-BY-SA-3.0 +architecture: any +type: source +depends: + - bash + - dosfstools + - efibootmgr +optional_depends: + - gptfdisk + - imagemagick + - openssl + - python3 + - sbsigntools + - sudo +make_depends: + - gnu-efi +downloads: + - url: https://downloads.sourceforge.net/project/refind/${BPM_PKG_VERSION}/refind-src-${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: f7d93ce80da76b86c567281ea225b6a87907ce86ff77233c9357a522c115c8f0 diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..80805d1 --- /dev/null +++ b/source.sh @@ -0,0 +1,69 @@ +# 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" + # Remove the path prefix from the css reference, so that the css can live in the same directory + sed -e 's|../Styles/||g' -i docs/refind/*.html + # Hardcode RefindDir, so that refind-install can find refind_x64.efi + sed -e 's|RefindDir=\"\$ThisDir/refind\"|RefindDir="/usr/share/refind/"|g' -i refind-install + # add vendor line to the sbat file + printf 'refind.%s,%s,%s,refind,%s,%s\n' 'tide' '1' 'Tide Linux' "${epoch:+${epoch}:}${BPM_PKG_VERSION}" 'https://git.enumerated.dev/tidelinux/refind' >> refind-sbat.csv +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + unset CFLGAS CXXFLAGS CPPFLAGS LDFLAGS + + make + make gptsync + make fs +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + # Install EFI binaries + install -Dm644 refind/*.efi -t "$BPM_OUTPUT"/usr/share/refind/ + install -Dm644 drivers_*/*.efi -t "$BPM_OUTPUT"/usr/share/refind/drivers_x64/ + install -Dm644 gptsync/*.efi -t "$BPM_OUTPUT"/usr/share/refind/tools_x64/ + + # Install sample config + install -Dm644 refind.conf-sample -t "$BPM_OUTPUT"/usr/share/refind/ + + # Install refind keys + install -Dm644 keys/*{cer,crt} -t "$BPM_OUTPUT"/usr/share/refind/keys/ + + # Create keys directory + install -dm700 "$BPM_OUTPUT"/etc/refind.d/keys + + # Install fonts + install -Dm644 fonts/*.png -t "$BPM_OUTPUT"/usr/share/refind/fonts/ + + # Install icons + install -Dm644 icons/*.png -t "$BPM_OUTPUT"/usr/share/refind/icons + install -Dm644 icons/svg/*.svg -t "$BPM_OUTPUT"/usr/share/refind/icons/svg/ + + # Install scripts + install -Dm755 {refind-{install,mkdefault,sb-healthcheck},mkrlconf,mvrefind} -t "$BPM_OUTPUT"/usr/bin/ + install -Dm755 fonts/mkfont.sh "$BPM_OUTPUT"/usr/bin/refind-mkfont + + # Install man pages + install -Dm644 docs/man/*.8 -t "$BPM_OUTPUT"/usr/share/man/man8/ + + # Install documentation + install -Dm644 docs/refind/*.{html,png,svg,txt} -t "$BPM_OUTPUT"/usr/share/doc/refind/html/ + install -Dm644 docs/Styles/*.css -t "$BPM_OUTPUT"/usr/share/doc/refind/html/ + install -Dm644 images/refind-banner.{png,svg} -t "$BPM_OUTPUT"/usr/share/doc/refind/html/ + install -Dm644 {CREDITS,NEWS,README}.txt -t "$BPM_OUTPUT"/usr/share/doc/refind/ + install -Dm644 fonts/README.txt "$BPM_OUTPUT"/usr/share/doc/refind/README.refind-mkfont.txt + install -Dm644 icons/README "$BPM_OUTPUT"/usr/share/doc/refind/README.icons.txt + install -Dm644 keys/README.txt "$BPM_OUTPUT"/usr/share/doc/refind/README.keys.txt + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE.txt "$BPM_OUTPUT"/usr/share/licenses/refind/LICENSE.txt +}