|
| 1 | +#!/SBUILD ver @v1.0.0 |
| 2 | +#SELF: https://raw.githubusercontent.com/pkgforge/soarpkgs/refs/heads/main/binaries/7z/static.official.stable.yaml |
| 3 | +_disabled: false |
| 4 | + |
| 5 | +pkg: "7z" |
| 6 | +pkg_id: "github.com.ip7z.7zip" |
| 7 | +pkgver: "25.01" |
| 8 | +pkg_type: "static" |
| 9 | +ghcr_pkg: "pkgforge-dev/7z" |
| 10 | +category: |
| 11 | + - "ConsoleOnly" |
| 12 | + - "Utility" |
| 13 | +description: "Command line archiver utility" |
| 14 | +homepage: |
| 15 | + - "https://7-zip.org" |
| 16 | + - "https://github.com/ip7z/7zip" |
| 17 | + - "https://sourceforge.net/projects/sevenzip" |
| 18 | + - "https://www.7-zip.org" |
| 19 | +license: |
| 20 | + - id: "BSD" |
| 21 | + url: "https://github.com/ip7z/7zip/raw/e5431fa6f5505e385c6f9367260717e9c47dc2ee/DOC/License.txt" |
| 22 | +note: |
| 23 | + - "[DO NOT RUN] (Meant for pkgforge CI Only)" |
| 24 | + - "Pre Built Binary Fetched from Upstream. Check/Report @ https://github.com/ip7z/7zip" |
| 25 | +provides: |
| 26 | + - "7z" |
| 27 | +repology: |
| 28 | + - "7z" |
| 29 | +src_url: |
| 30 | + - "https://github.com/ip7z/7zip" |
| 31 | +tag: |
| 32 | + - "7zip" |
| 33 | + - "archive" |
| 34 | + - "archiver" |
| 35 | + - "archivers" |
| 36 | + - "Archiving/Compression" |
| 37 | + - "Productivity/Archiving/Compression" |
| 38 | + - "system" |
| 39 | + - "Tools" |
| 40 | + - "utils" |
| 41 | +x_exec: |
| 42 | + host: |
| 43 | + - "aarch64-Linux" |
| 44 | + - "x86_64-Linux" |
| 45 | + shell: "bash" |
| 46 | + pkgver: | |
| 47 | + curl -qfsSL "https://api.gh.pkgforge.dev/repos/ip7z/7zip/releases?per_page=100" | jq -r '[.[] | select(.draft == false)] | .[0].tag_name | gsub("\\s+"; "")' | tr -d '"'\''[:space:]' |
| 48 | + run: | |
| 49 | + #Download |
| 50 | + case "$(uname -m)" in |
| 51 | + aarch64) |
| 52 | + #curl -qfsSL "https://www.7-zip.org/$(curl -qfsSL "https://www.7-zip.org/download.html" | grep -o 'href="[^"]*"' | sed 's/href="//' | grep 'linux-arm64.tar.xz' | sed 's/"$//' | sort | tail -n 1)" -o "${SBUILD_TMPDIR}/${PKG}.archive" |
| 53 | + soar dl "https://github.com/ip7z/7zip@${PKGVER}" --match "linux,arm64,tar.xz" --exclude "amd64,x86,x64,sha256,sha512,bsd,macos,windows" -o "${SBUILD_TMPDIR}/${PKG}.archive" --yes |
| 54 | + ;; |
| 55 | + x86_64) |
| 56 | + #curl -qfsSL "https://www.7-zip.org/$(curl -qfsSL "https://www.7-zip.org/download.html" | grep -o 'href="[^"]*"' | sed 's/href="//' | grep 'linux-x64.tar.xz' | sed 's/"$//' | sort | tail -n 1)" -o "${SBUILD_TMPDIR}/${PKG}.archive" |
| 57 | + soar dl "https://github.com/ip7z/7zip@${PKGVER}" --match "linux,x64,tar.xz" --exclude "aarch,arm" -o "${SBUILD_TMPDIR}/${PKG}.archive" --yes |
| 58 | + ;; |
| 59 | + esac |
| 60 | + #Extract |
| 61 | + while E_X=$(find "${SBUILD_TMPDIR}" -type f -exec file -i "{}" + | |
| 62 | + grep -Ei "archive|compressed|gzip|x-compress|x-tar" | |
| 63 | + grep -iv "application/.*executable" | |
| 64 | + cut -d: -f1 | head -n1); [ -n "${E_X}" ] |
| 65 | + do |
| 66 | + 7z e "${E_X}" -o"${SBUILD_TMPDIR}/." -y && { |
| 67 | + file -i "${E_X}" | grep -q "application/.*executable" && break |
| 68 | + rm -f "${E_X}" |
| 69 | + } || break |
| 70 | + done |
| 71 | + #Copy |
| 72 | + #find "${SBUILD_TMPDIR}" -maxdepth 1 -type f -exec file -i "{}" \; | grep -Ei "application/.*executable|inode/symlink|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath --no-symlinks | xargs -I "{}" rsync -achvL "{}" "${SBUILD_OUTDIR}" |
| 73 | + find "${SBUILD_TMPDIR}" -maxdepth 1 -type f -name '7zzs' -exec file -i "{}" \; | grep -Ei "application/.*executable|inode/symlink|text/x-perl|text/.*script" | cut -d":" -f1 | xargs realpath --no-symlinks | xargs -I "{}" rsync -achvL "{}" "${SBUILD_OUTDIR}/7z" |
0 commit comments