summaryrefslogtreecommitdiff
path: root/p7zip.spec
diff options
context:
space:
mode:
Diffstat (limited to 'p7zip.spec')
-rw-r--r--p7zip.spec104
1 files changed, 104 insertions, 0 deletions
diff --git a/p7zip.spec b/p7zip.spec
new file mode 100644
index 0000000..ed5c4b5
--- /dev/null
+++ b/p7zip.spec
@@ -0,0 +1,104 @@
+Name: p7zip
+Version: 16.02
+Release: 7
+Summary: Very high compression ratio file archiver
+License: LGPLv2 and (LGPLv2+ or CPL)
+URL: https://sourceforge.net/projects/p7zip/
+Source0: https://sourceforge.net/projects/p7zip/files/p7zip/%{version}/%{name}_%{version}_src_all.tar.bz2
+Patch0: CVE-2017-17969.patch
+Patch1: CVE-2016-9296.patch
+Patch2: CVE-2018-5996.patch
+Patch3: CVE-2018-10115.patch
+Patch4: fix-build-failed-with-gcc-10.patch
+Patch5: 0001-add-PIE-compiler-options.patch
+
+BuildRequires: gcc-c++
+%ifarch %{ix86}
+BuildRequires: nasm
+%endif
+%ifarch x86_64
+BuildRequires: yasm
+%endif
+
+%description
+p7zip is a port of 7za.exe for Unix. 7-Zip is a file archiver with a very high
+compression ratio. The original version can be found at http://www.7-zip.org/.
+
+%prep
+%autosetup -n %{name}_%{version} -p1
+
+# move license files
+mv DOC/License.txt DOC/copying.txt .
+
+%build
+%ifarch %{ix86}
+cp -f makefile.linux_x86_asm_gcc_4.X makefile.machine
+%endif
+%ifarch x86_64
+cp -f makefile.linux_amd64_asm makefile.machine
+%endif
+%ifarch ppc ppc64
+cp -f makefile.linux_any_cpu_gcc_4.X makefile.machine
+%endif
+
+%make_build all2 \
+ OPTFLAGS="%{build_cxxflags}" \
+ LDFLAGS="%{build_ldflags}" \
+ DEST_HOME=%{_prefix} \
+ DEST_BIN=%{_bindir} \
+ DEST_SHARE=%{_libexecdir}/p7zip \
+ DEST_MAN=%{_mandir}
+
+%check
+%make_build test OPTFLAGS="%{build_cxxflags}" LDFLAGS="%{build_ldflags}"
+
+%install
+make install \
+ DEST_DIR=%{buildroot} \
+ DEST_HOME=%{_prefix} \
+ DEST_BIN=%{_bindir} \
+ DEST_SHARE=%{_libexecdir}/p7zip \
+ DEST_MAN=%{_mandir}
+
+# remove redundant DOC dir
+mv %{buildroot}%{_docdir}/p7zip/DOC/* %{buildroot}%{_docdir}/p7zip
+rmdir %{buildroot}%{_docdir}/p7zip/DOC/
+
+%files
+%{_docdir}/p7zip
+%doc contrib/
+%license copying.txt License.txt
+%{_bindir}/7za
+%{_bindir}/7z
+%dir %{_libexecdir}/p7zip/
+%{_libexecdir}/p7zip/7za
+%{_libexecdir}/p7zip/7z
+%{_libexecdir}/p7zip/7z.so
+%{_libexecdir}/p7zip/7zCon.sfx
+%{_libexecdir}/p7zip/Codecs
+#{_libexecdir}/p7zip/Formats/
+%{_mandir}/man1/7za.1*
+%{_mandir}/man1/7z.1*
+%exclude %{_mandir}/man1/7zr.1*
+
+%changelog
+* Sun Jan 05 2025 Liu Fushou <liufushou@live.cn> - 16.02-7
+- Add 7z binary for extracting rar files
+
+* Sat Aug 31 2024 Funda Wang <fundawang@yeah.net> - 16.02-6
+- use correct build flags
+
+* Tue Jun 06 2023 chenchen <chen_aka_jan@163.com> - 16.02-5
+- add PIE compiler options
+
+* Fri Jul 30 2021 sunguoshuai <sunguoshuai@huawei.com> - 16.02-4
+- fix build failed with gcc 10
+
+* Sat Jul 10 2021 wangyue <wangyue92@huawei.com> - 16.02-3
+- Add gcc-c++ to build dependency
+
+* Tue Jun 08 2021 wangyue <wangyue92@huawei.com> - 16.02-2
+- Fix CVE-2016-9296 CVE-2017-17969 CVE-2018-10115 CVE-2018-5996
+
+* Tue Jan 26 2021 Wei Xiong <myeuler@163.com>
+- Package init