SHA256
1
0
forked from pool/xz

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

- switch to obs_scm
- don't abuse %bcond for multibuild
- add rpmlintrc for dubious rpmlint warning
- add a package suffix for the multibuild lang flavor

OBS-URL: https://build.opensuse.org/request/show/1164597
OBS-URL: https://build.opensuse.org/package/show/Base:System/xz?expand=0&rev=158
This commit is contained in:
Danilo Spinella
2024-04-04 14:51:12 +00:00
committed by Git OBS Bridge
parent 6e6c8a9fd4
commit 02fb01d80f
7 changed files with 41 additions and 30 deletions

47
xz.spec
View File

@@ -17,9 +17,11 @@
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "lang"
%bcond_without lang
%global with_lang 1
%global psuffix -lang
%else
%bcond_with lang
%global with_lang 0
%global psuffix %{nil}
%endif
@@ -33,17 +35,18 @@
%global real_ver 5.4.6
Name: xz
Name: xz%{psuffix}
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: %{name}-%{real_ver}.tar.zst
Source2: baselibs.conf
Source4: xznew
Source5: xznew.1
Source0: xz-%{real_ver}.tar.zst
Source1: xznew
Source2: xznew.1
Source3: xz-rpmlintrc
Source4: baselibs.conf
BuildRequires: pkgconfig
BuildRequires: zstd
# for autoreconf
@@ -54,7 +57,7 @@ BuildRequires: gettext-tools
# needed by autopoint
BuildRequires: findutils
BuildRequires: libtool
%if %{with lang}
%if %{with_lang}
# required to update manpage translations
BuildRequires: po4a
BuildArch: noarch
@@ -77,9 +80,8 @@ 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
%if %{with_lang}
%{lang_package -n xz}
%else
%package -n liblzma5
@@ -120,7 +122,7 @@ Static library for the LZMA library
%endif
%prep
%autosetup -n %{name}-%{real_ver}
%autosetup -n xz-%{real_ver}
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
@@ -152,7 +154,7 @@ cp ./src/liblzma/.libs/liblzma.a liblzma.a
%make_build
%endif
%if %{with lang}
%if %{with_lang}
# update manpage translations
./po4a/update-po
%endif
@@ -164,26 +166,26 @@ cp ./src/liblzma/.libs/liblzma.a liblzma.a
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
%find_lang %{name} --all-name --with-man
install -Dpm 0755 %{SOURCE4} %{buildroot}%{_bindir}/xznew
install -Dpm 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/xznew.1
install -Dpm 0755 %{SOURCE1} %{buildroot}%{_bindir}/xznew
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/xznew.1
%if %{with static}
install -Dpm 0644 liblzma.a %{buildroot}%{_libdir}/
%endif
rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%if %{without lang}
%if ! %{with_lang}
%post -n liblzma5 -p /sbin/ldconfig
%postun -n liblzma5 -p /sbin/ldconfig
%endif
%if %{with lang}
%files lang -f %{name}.lang
%if %{with_lang}
%files -n xz-lang -f %{name}.lang
# exclude everything of the other packages
%exclude %_docdir
%exclude %_bindir
%exclude %_mandir/man1
%exclude %{_includedir}
%exclude %_libdir
%exclude %{_libdir}
%exclude /usr/src/debug/
%exclude /usr/lib/debug/
@@ -194,9 +196,10 @@ rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%dir %{_mandir}/ro
%dir %{_mandir}/uk
%endif
%endif
%if %{without lang}
# with_lang
%else
%files
%license COPYING COPYING.GPLv2
%{_docdir}/%{name}
@@ -273,7 +276,7 @@ rm -vf %{buildroot}%{_docdir}/%{name}/{COPYING,COPYING.GPLv2}
%{_libdir}/liblzma.a
%endif
# without lang end
# with_lang end
%endif
%changelog