SHA256
1
0
forked from pool/xz

Accepting request 1164582 from home:dancermak:branches:Base:System

Revert Epoch, introduce multibuild and switch to using tar_scm for fetching the sources

OBS-URL: https://build.opensuse.org/request/show/1164582
OBS-URL: https://build.opensuse.org/package/show/Base:System/xz?expand=0&rev=157
This commit is contained in:
Danilo Spinella
2024-04-04 12:23:38 +00:00
committed by Git OBS Bridge
parent 3f14a8b2e3
commit 6e6c8a9fd4
9 changed files with 107 additions and 71 deletions

92
xz.spec
View File

@@ -15,6 +15,13 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "lang"
%bcond_without lang
%else
%bcond_with lang
%endif
# avoid bootstrapping problem
%if 0%{?suse_version} == 1500
@@ -23,23 +30,38 @@
%bcond_with static
%endif
%define _binary_payload w9.bzdio
%global real_ver 5.4.6
Name: xz
Version: 5.4.6
Epoch: 1
Version: 5.6.1.revertto5.4
Release: 0
Summary: A Program for Compressing Files with the LempelZivMarkov algorithm
License: 0BSD AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later
Group: Productivity/Archiving/Compression
URL: https://tukaani.org/xz/
Source0: https://github.com/tukaani-project/xz/releases/download/v%{version}/xz-%{version}.tar.gz
Source1: https://github.com/tukaani-project/xz/releases/download/v%{version}/xz-%{version}.tar.gz.sig
Source0: %{name}-%{real_ver}.tar.zst
Source2: baselibs.conf
Source3: https://tukaani.org/misc/jia_tan_pubkey.txt#/%{name}.keyring
Source4: xznew
Source5: xznew.1
BuildRequires: pkgconfig
Provides: lzma = %{version}
Obsoletes: lzma < %{version}
BuildRequires: zstd
# for autoreconf
BuildRequires: autoconf
BuildRequires: automake
# required by autoconf for autopoint
BuildRequires: gettext-tools
# needed by autopoint
BuildRequires: findutils
BuildRequires: libtool
%if %{with lang}
# required to update manpage translations
BuildRequires: po4a
BuildArch: noarch
%endif
Provides: lzma = %{real_ver}
Obsoletes: lzma < %{real_ver}
%{?suse_build_hwcaps_libs}
%description
@@ -55,13 +77,16 @@ The xz command is a program for compressing files.
decompressing speed.
* Very similar command line interface to what gzip and bzip2 have.
%if %{with lang}
%lang_package
%else
%package -n liblzma5
Summary: LempelZivMarkov chain algorithm compression library
License: 0BSD
Group: System/Libraries
Provides: liblzma5 = %{version}
Provides: liblzma5 = %{real_ver}
%description -n liblzma5
Library for encoding/decoding LZMA files.
@@ -70,11 +95,11 @@ Library for encoding/decoding LZMA files.
Summary: Development package for the LZMA library
License: 0BSD
Group: Development/Libraries/C and C++
Requires: liblzma5 = %{version}
Provides: lzma-devel = %{version}
Obsoletes: lzma-devel < %{version}
Provides: lzma-alpha-devel = %{version}
Obsoletes: lzma-alpha-devel < %{version}
Requires: liblzma5 = %{real_ver}
Provides: lzma-devel = %{real_ver}
Obsoletes: lzma-devel < %{real_ver}
Provides: lzma-alpha-devel = %{real_ver}
Obsoletes: lzma-alpha-devel < %{real_ver}
%description devel
This package contains the header files and libraries needed for
@@ -85,25 +110,32 @@ compiling programs using the LZMA library.
Summary: Static version of LZMA library
License: SUSE-Public-Domain
Group: Development/Libraries/C and C++
Requires: lzma-devel = %{version}
Requires: lzma-devel = %{real_ver}
%description static-devel
Static library for the LZMA library
%endif
# without lang
%endif
%prep
%autosetup
%autosetup -n %{name}-%{real_ver}
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags} -D_REENTRANT -pipe -fPIE"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
autoreconf -fi
# Either we build it without pic enabled, or we build one at a time
%if %{with static}
%configure \
--with-pic \
--docdir=%{_docdir}/%{name} \
--disable-shared CONFIG_SHELL=/bin/sh
%make_build
cp ./src/liblzma/.libs/liblzma.a liblzma.a
%endif
@@ -120,6 +152,11 @@ cp ./src/liblzma/.libs/liblzma.a liblzma.a
%make_build
%endif
%if %{with lang}
# update manpage translations
./po4a/update-po
%endif
%check
%make_build check
@@ -134,10 +171,22 @@ install -Dpm 0644 liblzma.a %{buildroot}%{_libdir}/
%endif
rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%if %{without lang}
%post -n liblzma5 -p /sbin/ldconfig
%postun -n liblzma5 -p /sbin/ldconfig
%endif
%if %{with lang}
%files lang -f %{name}.lang
# exclude everything of the other packages
%exclude %_docdir
%exclude %_bindir
%exclude %_mandir/man1
%exclude %{_includedir}
%exclude %_libdir
%exclude /usr/src/debug/
%exclude /usr/lib/debug/
%dir %{_mandir}/fr
%dir %{_mandir}/de
%dir %{_mandir}/ko
@@ -145,7 +194,9 @@ rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%dir %{_mandir}/ro
%dir %{_mandir}/uk
%endif
%endif
%if %{without lang}
%files
%license COPYING COPYING.GPLv2
%{_docdir}/%{name}
@@ -198,6 +249,14 @@ rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%{_mandir}/man1/xzmore.1%{?ext_man}
%{_mandir}/man1/xznew.1%{?ext_man}
# covered by -lang subpackage
%exclude %{_mandir}/fr
%exclude %{_mandir}/de
%exclude %{_mandir}/ko
%exclude %{_mandir}/ro
%exclude %{_mandir}/uk
%exclude /usr/share/locale
%files -n liblzma5
%{_libdir}/liblzma.so.5*
@@ -214,4 +273,7 @@ rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%{_libdir}/liblzma.a
%endif
# without lang end
%endif
%changelog