commit ae957eb3de427a4b7023f32126eb8388a91485a7 Author: EnumDev Date: Sat Aug 2 18:42:54 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..c51c74a --- /dev/null +++ b/check-version.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +URL="https://www.7-zip.org/history.txt" + +# Get version number from tag name +VERSION=$(curl -s -L "$URL" | grep -B1 '\-------------------------' | head -n1 | grep -o -E '(([0-9]*)\.([0-9]*))') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..6a95d42 --- /dev/null +++ b/pkg.info @@ -0,0 +1,8 @@ +name: 7zip +description: File archiver with a high compression ratio +version: 25.00 +url: https://www.7-zip.org/ +license: LGPL-2.1-or-later,BSD-3-Clause,unRar +architecture: any +depends: ["gcc","glibc"] +type: source diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..336c8ef --- /dev/null +++ b/source.sh @@ -0,0 +1,45 @@ +# 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://7-zip.org/a/7z${BPM_PKG_VERSION//./}-src.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" -C "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + export CFLAGS="$CFLAGS -Wno-error=unused-macros" + export CPPFLAGS="$CPPFLAGS -Wno-error=unused-macros" + for i in Bundles/{Alone,Alone7z,Format7zF,SFXCon} UI/Console; do + make -C CPP/7zip/$i -f ../../cmpl_gcc.mak \ + LFLAGS_STRIP= \ + CC="cc $CPPFLAGS $CFLAGS $LDFLAGS" \ + CXX="g++ $CPPFLAGS $CXXFLAGS $LDFLAGS" + done +} + +# 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 CPP/7zip/Bundles/Alone{/b/g/7za,7z/b/g/7zr} \ + CPP/7zip/Bundles/Format7zF/b/g/7z.so \ + CPP/7zip/UI/Console/b/g/7z \ + -t "$BPM_OUTPUT"/usr/lib/7zip/ + + install -Dm755 CPP/7zip/Bundles/SFXCon/b/g/7zCon "$BPM_OUTPUT"/usr/lib/7zip/7zCon.sfx + + for _prog in 7za 7zr 7z; do + printf '#!/bin/sh\nexec /usr/lib/7zip/%s "$@"\n' "$_prog" | install -D /dev/stdin "$BPM_OUTPUT"/usr/bin/"$_prog" + done + + # Install package licenses + install -Dm644 "$BPM_SOURCE"/DOC/License.txt "$BPM_OUTPUT"/usr/share/licenses/7zip/License.txt + install -Dm644 "$BPM_SOURCE"/DOC/unRarLicense.txt "$BPM_OUTPUT"/usr/share/licenses/7zip/unRarLicense.txt +}