public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/7zip] epel9: Initial package; Resolves: RHBZ#
@ 2026-07-01 17:10 Michel Lind
  0 siblings, 0 replies; only message in thread
From: Michel Lind @ 2026-07-01 17:10 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/7zip
            Branch : epel9
            Commit : 538276af4a24d220a808307751d1f755496b3242
            Author : Michel Lind <salimma@fedoraproject.org>
            Date   : 2025-05-06T22:50:31-05:00
            Stats  : +165/-0 in 6 file(s)
            URL    : https://src.fedoraproject.org/rpms/7zip/c/538276af4a24d220a808307751d1f755496b3242?branch=epel9

            Log:
            Initial package; Resolves: RHBZ#

Signed-off-by: Michel Lind <salimma@fedoraproject.org>

---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d94f561
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/7zip-24.09.tar.zst

diff --git a/7zip-find-so-in-libexec.diff b/7zip-find-so-in-libexec.diff
new file mode 100644
index 0000000..1213bc5
--- /dev/null
+++ b/7zip-find-so-in-libexec.diff
@@ -0,0 +1,11 @@
+--- a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
++++ b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
+@@ -1751,7 +1751,7 @@ FString GetModuleDirPrefix()
+ 
+   s = fas2fs(g_ModuleDirPrefix);
+   if (s.IsEmpty())
+-    s = FTEXT(".") FSTRING_PATH_SEPARATOR;
++    s = FTEXT("/usr/libexec/7zip") FSTRING_PATH_SEPARATOR;
+   return s;
+   /*
+   setenv("_7ZIP_HOME_DIR", "/test/", 0);

diff --git a/7zip.spec b/7zip.spec
new file mode 100644
index 0000000..f873aeb
--- /dev/null
+++ b/7zip.spec
@@ -0,0 +1,126 @@
+%global make_opts DEBUG_BUILD=1 DISABLE_RAR=1 LOCAL_FLAGS="%{optflags}" -f makefile.gcc
+# the last build right now is 16.02-32
+%global obs_ver 16.03
+ 
+Name:           7zip
+Version:        24.09
+Release:        %autorelease
+Summary:        A file archiver
+
+# from DOC/License.txt
+# CPP/7zip/Compress/Rar* files: the "GNU LGPL" with "unRAR license restriction"
+# => we are shipping a source tarball with this stripped
+# CPP/7zip/Compress/LzfseDecoder.cpp: the "BSD 3-clause License"
+# C/ZstdDec.c: the "BSD 3-clause License"
+# C/Xxh64.c: the "BSD 2-clause License"
+# Some files are "public domain" files, if "public domain" status is stated in source file.
+# the "GNU LGPL" for all other files. If there is no license information in 
+# => this is LGPL-2.1-or-later from the text in that file
+License:        LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND LicenseRef-Fedora-Public-Domain
+URL:            https://7-zip.org
+# strip the source with strip-rar-support.sh
+# Source:         https://github.com/ip7z/7zip/archive/%%{version}/%%{name}-%%{version}.tar.gz
+Source:         %{name}-%{version}.tar.zst
+Source:         strip-rar-support.sh
+# patch where 7z.so is loaded from so we don't need to do shenanigans like having the 7z binary
+# there and invoking via a wrapper
+Patch:          7zip-find-so-in-libexec.diff
+
+BuildRequires:  gcc-c++
+BuildRequires:  make
+
+# p7zip-plugins ships 7z
+Provides:       p7zip-plugins = %{version}-%{release}
+Obsoletes:      p7zip-plugins < %{obs_ver}
+
+%global _description %{expand:
+7-Zip is a file archiver with a high compression ratio. The main features
+of 7-Zip are:
+
+* High compression ratio in 7z format with LZMA and LZMA2 compression
+* Supported formats:
+  * Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
+  * Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT,
+    GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2,
+    RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.
+* For ZIP and GZIP formats, 7-Zip provides a compression ratio that is
+  2-10 % better than the ratio provided by PKZip and WinZip
+* Strong AES-256 encryption in 7z and ZIP formats
+* Powerful command line version}
+
+%description %{_description}
+
+
+%package        reduced
+Summary:        Standalone version of 7-Zip console that supports only 7z (reduced version)
+
+%description    reduced %{_description}
+
+
+%package        standalone
+Summary:        Standalone version of 7-Zip console that supports only some formats
+# p7zip ships 7za
+Provides:       p7zip = %{version}-%{release}
+Obsoletes:      p7zip < %{obs_ver}
+
+%description    standalone %{_description}
+
+This version supports only 7z/xz/cab/zip/gzip/bzip2/tar.
+
+
+%package        standalone-all
+Summary:        Standalone version of 7-Zip console that supports all formats
+
+%description    standalone-all %{_description}
+
+
+%prep
+%autosetup -p1
+
+
+%build
+# 7z.so
+%make_build %make_opts -C CPP/7zip/Bundles/Format7zF/
+
+# 7z
+%make_build %make_opts LOCAL_FLAGS="%{optflags} -DZ7_EXTERNAL_CODECS" -C CPP/7zip/UI/Console/
+
+# 7za
+%make_build %make_opts -C CPP/7zip/Bundles/Alone/
+
+# 7z4
+%make_build %make_opts -C CPP/7zip/Bundles/Alone7z/
+
+# 7zz
+%make_build %make_opts -C CPP/7zip/Bundles/Alone2/
+
+
+%install
+install -Dpm 755 ./CPP/7zip/UI/Console/_o/7z %{buildroot}%{_bindir}/7z
+install -Dpm 755 ./CPP/7zip/Bundles/Format7zF/_o/7z.so %{buildroot}%{_libexecdir}/%{name}/7z.so
+install -Dpm 755 ./CPP/7zip/Bundles/Alone/_o/7za %{buildroot}%{_bindir}/7za
+install -Dpm 755 ./CPP/7zip/Bundles/Alone7z/_o/7zr %{buildroot}%{_bindir}/7zr
+install -Dpm 755 ./CPP/7zip/Bundles/Alone2/_o/7zz %{buildroot}%{_bindir}/7zz
+
+
+%files
+%license DOC/License.txt DOC/copying.txt
+%doc DOC/readme.txt DOC/7zC.txt DOC/7zFormat.txt DOC/lzma.txt 
+%{_bindir}/7z
+%{_libexecdir}/%{name}/
+
+%files reduced
+%license DOC/License.txt DOC/copying.txt
+%{_bindir}/7zr
+
+%files standalone
+%license DOC/License.txt DOC/copying.txt
+%{_bindir}/7za
+
+%files standalone-all
+%license DOC/License.txt DOC/copying.txt
+%{_bindir}/7zz
+
+
+%changelog
+%autochangelog

diff --git a/series b/series
new file mode 100644
index 0000000..6c6be1c
--- /dev/null
+++ b/series
@@ -0,0 +1 @@
+7zip-find-so-in-libexec.diff

diff --git a/sources b/sources
new file mode 100644
index 0000000..cf5f764
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (7zip-24.09.tar.zst) = 47e8f709209c4333bf2707a4b4953128a84669fce75fed3fc2d4d7b3b29db758481115f1d640d1becab200fcb6a83b84fd5fb448f7ac01ff9d99cc37674a2323

diff --git a/strip-rar-support.sh b/strip-rar-support.sh
new file mode 100755
index 0000000..575f8b4
--- /dev/null
+++ b/strip-rar-support.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+# strip-rar-support.sh
+
+if [[ $# -ne 1 ]]; then
+  echo Usage: strip-rar-support.sh 7zip-\$version.tar.gz
+  exit 1
+fi
+
+ORIG_TARBALL=$1
+SRC_DIR=${ORIG_TARBALL%.tar.gz}
+TEMP_DIR=$(mktemp -d)
+
+tar -C $TEMP_DIR -xf $ORIG_TARBALL
+
+pushd ${TEMP_DIR}/${SRC_DIR}
+echo $PWD
+rm -rf CPP/7zip/Archive/Rar/
+rm -f CPP/7zip/Compress/Rar*.*
+rm -f CPP/7zip/Crypto/Rar*.*
+rm -f DOC/unRarLicense.txt
+popd
+
+tar --zstd -cf $PWD/${SRC_DIR}.tar.zst -C $TEMP_DIR ${SRC_DIR}
+
+rm -R ${TEMP_DIR}

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-01 17:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-01 17:10 [rpms/7zip] epel9: Initial package; Resolves: RHBZ# Michel Lind

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox