From d6788062f0e50e3e8a942730f6deb5377bc42979 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 30 Aug 2025 22:29:39 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 12 ++++++++++ pkg.info | 8 +++++++ source-files/gcc-15-fix.patch | 38 ++++++++++++++++++++++++++++++++ source.sh | 41 +++++++++++++++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source-files/gcc-15-fix.patch 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..5364263 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Git repository +REPO="git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git" + +# Get tag name using 'git ls-remote' +TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | cut -d'/' -f3 | grep -E 'v[0-9]{1,}.[0-9]{1,}.[0-9]{1,}' | tail -1) + +# 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..594df51 --- /dev/null +++ b/pkg.info @@ -0,0 +1,8 @@ +name: f2fs-tools +description: Userland tools for the f2fs filesystem +version: 1.16.0 +url: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/ +license: GPL2-only +architecture: any +depends: ["util-linux","glibc"] +type: source diff --git a/source-files/gcc-15-fix.patch b/source-files/gcc-15-fix.patch new file mode 100644 index 0000000..0007e3e --- /dev/null +++ b/source-files/gcc-15-fix.patch @@ -0,0 +1,38 @@ +From 6617d15a660becc23825007ab3fc2d270b5b250f Mon Sep 17 00:00:00 2001 +From: Jaegeuk Kim +Date: Thu, 24 Oct 2024 20:33:38 +0000 +Subject: f2fs-tools: use stdbool.h instead of bool + +The existing bool definition is broken for c23, where bool is now a keyword. + +Signed-off-by: Elliott Hughes +Signed-off-by: Jaegeuk Kim +--- + include/f2fs_fs.h | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h +index 9534da98..0cb92282 100644 +--- a/include/f2fs_fs.h ++++ b/include/f2fs_fs.h +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_CONFIG_H + #include +@@ -119,9 +120,6 @@ typedef uint16_t u16; + typedef uint8_t u8; + typedef u32 block_t; + typedef u32 nid_t; +-#ifndef bool +-typedef u8 bool; +-#endif + typedef unsigned long pgoff_t; + typedef unsigned short umode_t; + +-- +cgit 1.2.3-korg + diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..4b62640 --- /dev/null +++ b/source.sh @@ -0,0 +1,41 @@ +# 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://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/f2fs-tools-${BPM_PKG_VERSION}.tar.gz" +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" + + cd "$BPM_SOURCE" + # Apply patches + patch -Np1 -i "$BPM_WORKDIR"/gcc-15-fix.patch + + autoreconf -fi +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + ./configure --prefix=/usr --disable-static + make +} + +# 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() { + make check +} + +# 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" install + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/f2fs-tools/COPYING +}