File 7zip.spec of Package 7zip

Name:		7zip
Summary:	7-Zip file archiver with a high compression ratio
Version:	24.08
Release:	1
URL:		https://7-zip.org
Source0:	%{name}_%{version}+dfsg.orig.tar.xz
License:	LGPL-2.1+
Group:		Applications/File
BuildRequires:	make
%if 0%{?sle_version} == 150100
BuildRequires:	gcc8-c++
%else
BuildRequires:	gcc-c++
%endif
Conflicts:	p7zip-plugins
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%define debug_package %{nil}

%description
7-Zip file archiver with a high compression ratio

%prep
%setup -q -n CPP
%if 0%{?sle_version} == 150100
sed -i 's/gcc/gcc-8/g' 7zip/var_gcc.mak
sed -i 's/g++/g++-8/g' 7zip/var_gcc.mak
sed -i 's/-Waddress-of-packed-member/ /g' 7zip/warn_gcc.mak
%endif

%build
make -C 7zip/Bundles/Format7zF -f ../../cmpl_gcc.mak DISABLE_RAR=1
make -C 7zip/Bundles/SFXCon -f ../../cmpl_gcc.mak DISABLE_RAR=1
make -C 7zip/UI/Console -f ../../cmpl_gcc.mak DISABLE_RAR=1

%install
install -d %{buildroot}%{_libexecdir}/%{name}
install -m 0755  7zip/UI/Console/b/g/7z            %{buildroot}%{_libexecdir}/%{name}/
install -m 0644  7zip/Bundles/Format7zF/b/g/7z.so  %{buildroot}%{_libexecdir}/%{name}/
install -m 0644  7zip/Bundles/SFXCon/b/g/7zCon     %{buildroot}%{_libexecdir}/%{name}/7zCon.sfx

install -d %{buildroot}%{_bindir}
ln -sf     %{_libexecdir}/%{name}/7z               %{buildroot}%{_bindir}/7z

%clean
[ %{buildroot} != "/" ] && ( rm -rf %{buildroot} )

%files
%defattr(-,root,root)
%{_bindir}/7z
%{_libexecdir}/%{name}

%changelog
* Sun Nov 17 2024 - Alexander Koblov <alexx2000@mail.ru>
- Initial package, version 24.08
openSUSE Build Service is sponsored by