Accepting request 505452 from home:pluskalm:branches:Base:System

- Simplify spec file conditions
- Clenup profiled building
- Use full lists of files

OBS-URL: https://build.opensuse.org/request/show/505452
OBS-URL: https://build.opensuse.org/package/show/Base:System/xz?expand=0&rev=89
This commit is contained in:
Marcus Meissner 2017-06-22 18:04:11 +00:00 committed by Git OBS Bridge
parent 8bbe0cfdfe
commit 8f9b6826d8
2 changed files with 78 additions and 42 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jun 21 14:11:44 UTC 2017 - mpluskal@suse.com
- Simplify spec file conditions
- Clenup profiled building
- Use full lists of files
-------------------------------------------------------------------
Tue Feb 21 09:03:18 UTC 2017 - adrian@suse.de

107
xz.spec
View File

@ -18,18 +18,12 @@
# avoid bootstrapping problem
%define _binary_payload w9.bzdio
%if 0%{?suse_version} < 1130
%define do_profiling 0
%endif
%ifarch aarch64 %{arm} %{sparc}
%define do_profiling 0
%endif
%bcond_without static_libs
Name: xz
Version: 5.2.3
Release: 0
Summary: A Program for Compressing Files
License: LGPL-2.1+ and GPL-2.0+
License: LGPL-2.1+ AND GPL-2.0+
Group: Productivity/Archiving/Compression
Url: http://tukaani.org/xz/
Source0: http://tukaani.org/xz/%{name}-%{version}.tar.gz
@ -40,12 +34,9 @@ Source3: xz.keyring
Source4: xznew
Source5: xznew.1
BuildRequires: pkgconfig
Recommends: %{name}-lang
Provides: lzma = %{version}
Obsoletes: lzma < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?lang_package:1} > 0
Recommends: %{name}-lang
%endif
%description
The xz command is a very powerful program for compressing files.
@ -82,7 +73,6 @@ Obsoletes: lzma-alpha-devel < %{version}
This package contains the header files and libraries needed for
compiling programs using the LZMA library.
%if %{with static_libs}
%package static-devel
Summary: Static version of LZMA library
Group: Development/Libraries/C and C++
@ -90,40 +80,34 @@ Requires: lzma-devel = %{version}
%description static-devel
Static library for the LZMA library
%endif
%prep
%setup -q
%build
%global optflags %{optflags} -D_REENTRANT -pipe -fPIE
export CFLAGS="%{optflags} -D_REENTRANT -pipe -fPIE"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
%configure \
%if ! %{with static_libs}
--disable-static \
%endif
--with-pic \
--docdir=%{_docdir}/%{name}
%if 0%{do_profiling}
profiledir=$(mktemp -d)
trap "rm -rf $profiledir" EXIT
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_generate}=$profiledir"
time make check
make clean %{?_smp_mflags}
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_feedback}=$profiledir"
%if %{do_profiling}
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_generate}"
make check %{?_smp_mflags}
make clean
make %{?_smp_mflags} CFLAGS="%{optflags} %{cflags_profile_feedback}"
%else
make %{?_smp_mflags}
%endif
%check
time make check
make %{?_smp_mflags} check
%install
%make_install
rm -v %{buildroot}%{_libdir}/liblzma.la
find %{buildroot} -type f -name "*.la" -delete -print
%find_lang %{name}
install -D -m 0755 %{SOURCE4} %{buildroot}%{_bindir}/xznew
install -D -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/xznew.1
install -Dpm 0755 %{SOURCE4} %{buildroot}%{_bindir}/xznew
install -Dpm 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/xznew.1
%post -n liblzma5 -p /sbin/ldconfig
%postun -n liblzma5 -p /sbin/ldconfig
@ -134,24 +118,69 @@ install -D -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/xznew.1
%files
%defattr(-, root, root)
%{_docdir}/%{name}
%{_bindir}/*
%{_mandir}/man?/*
%{_bindir}/lzcat
%{_bindir}/lzcmp
%{_bindir}/lzdiff
%{_bindir}/lzegrep
%{_bindir}/lzfgrep
%{_bindir}/lzgrep
%{_bindir}/lzless
%{_bindir}/lzma
%{_bindir}/lzmadec
%{_bindir}/lzmainfo
%{_bindir}/lzmore
%{_bindir}/unlzma
%{_bindir}/unxz
%{_bindir}/xz
%{_bindir}/xzcat
%{_bindir}/xzcmp
%{_bindir}/xzdec
%{_bindir}/xzdiff
%{_bindir}/xzegrep
%{_bindir}/xzfgrep
%{_bindir}/xzgrep
%{_bindir}/xzless
%{_bindir}/xzmore
%{_bindir}/xznew
%{_mandir}/man1/lzcat.1%{ext_man}
%{_mandir}/man1/lzcmp.1%{ext_man}
%{_mandir}/man1/lzdiff.1%{ext_man}
%{_mandir}/man1/lzegrep.1%{ext_man}
%{_mandir}/man1/lzfgrep.1%{ext_man}
%{_mandir}/man1/lzgrep.1%{ext_man}
%{_mandir}/man1/lzless.1%{ext_man}
%{_mandir}/man1/lzma.1%{ext_man}
%{_mandir}/man1/lzmadec.1%{ext_man}
%{_mandir}/man1/lzmainfo.1%{ext_man}
%{_mandir}/man1/lzmore.1%{ext_man}
%{_mandir}/man1/unlzma.1%{ext_man}
%{_mandir}/man1/unxz.1%{ext_man}
%{_mandir}/man1/xz.1%{ext_man}
%{_mandir}/man1/xzcat.1%{ext_man}
%{_mandir}/man1/xzcmp.1%{ext_man}
%{_mandir}/man1/xzdec.1%{ext_man}
%{_mandir}/man1/xzdiff.1%{ext_man}
%{_mandir}/man1/xzegrep.1%{ext_man}
%{_mandir}/man1/xzfgrep.1%{ext_man}
%{_mandir}/man1/xzgrep.1%{ext_man}
%{_mandir}/man1/xzless.1%{ext_man}
%{_mandir}/man1/xzmore.1%{ext_man}
%{_mandir}/man1/xznew.1%{ext_man}
%files -n liblzma5
%defattr(-, root, root)
%{_libdir}/lib*.so.5*
%{_libdir}/liblzma.so.5*
%files devel
%defattr(-, root, root)
%{_includedir}/*.h
%{_includedir}/lzma
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/lzma.h
%dir %{_includedir}/lzma/
%{_includedir}/lzma/*
%{_libdir}/liblzma.so
%{_libdir}/pkgconfig/liblzma.pc
%if %{with static_libs}
%files static-devel
%defattr(-, root, root)
%{_libdir}/*.a
%endif
%{_libdir}/liblzma.a
%changelog