SHA256
3
0
forked from pool/xz

- add optional -static library package, intended to publish pixz for

CentOS / RHEL, default off

OBS-URL: https://build.opensuse.org/package/show/Base:System/xz?expand=0&rev=61
This commit is contained in:
Marcus Meissner 2013-11-25 12:24:18 +00:00 committed by Git OBS Bridge
parent 43d70c1007
commit 9c36d60610
2 changed files with 45 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Nov 24 16:25:53 UTC 2013 - andreas.stieger@gmx.de
- add optional -static library package, intended to publish pixz for
CentOS / RHEL, default off
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Oct 16 08:53:16 UTC 2013 - mvyskocil@suse.com Wed Oct 16 08:53:16 UTC 2013 - mvyskocil@suse.com

42
xz.spec
View File

@ -16,16 +16,25 @@
# #
%if 0%{?centos_version} || 0%{?rhel_version}
%if 0%{?centos_version} <= 600 || 0%{?rhel_version <= 600}
%bcond_without static_libs
%endif
%else
%bcond_with static_libs
%endif
Name: xz Name: xz
Summary: A Program for Compressing Files 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 Group: Productivity/Archiving/Compression
Version: 5.0.5 Version: 5.0.5
Release: 0 Release: 0
Url: http://tukaani.org/lzma/ Url: http://tukaani.org/xz/
Source0: http://tukaani.org/xz/%{name}-%{version}.tar.gz Source0: http://tukaani.org/xz/%{name}-%{version}.tar.gz
Source1: http://tukaani.org/xz/%{name}-%{version}.tar.gz.sig Source1: http://tukaani.org/xz/%{name}-%{version}.tar.gz.sig
Source2: baselibs.conf Source2: baselibs.conf
# from http://tukaani.org/misc/lasse_collin_pubkey.txt#/xz.keyring
Source3: xz.keyring Source3: xz.keyring
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pkgconfig BuildRequires: pkgconfig
@ -85,22 +94,43 @@ Obsoletes: lzma-alpha-devel < %version
This package contains the header files and libraries needed for This package contains the header files and libraries needed for
compiling programs using the LZMA library. compiling programs using the LZMA library.
%if %{with static_libs}
%package static
Summary: Static version of LZMA library
Group: Development/Libraries/C and C++
Requires: lzma-devel = %version
%description static
Static library for the LZMA library
%endif
%prep %prep
%setup -q %setup -q
%build %build
%global optflags %{optflags} -D_REENTRANT -pipe
%if %{do_profiling} %if %{do_profiling}
profiledir=$(mktemp -d) profiledir=$(mktemp -d)
trap "rm -rf $profiledir" EXIT trap "rm -rf $profiledir" EXIT
export CFLAGS="%optflags %{cflags_profile_generate}=$profiledir" export CFLAGS="%optflags %{cflags_profile_generate}=$profiledir"
%endif %endif
%configure --disable-static --with-pic --docdir=%_docdir/%name %configure \
%if ! %{with static_libs}
--disable-static \
%endif
--with-pic \
--docdir=%_docdir/%name
make %{?_smp_mflags} make %{?_smp_mflags}
%if %{do_profiling} %if %{do_profiling}
time make check time make check
make clean make clean
export CFLAGS="%optflags %{cflags_profile_feedback}=$profiledir" export CFLAGS="%optflags %{cflags_profile_feedback}=$profiledir"
%configure --disable-static --with-pic --docdir=%_docdir/%name %configure \
%if ! %{with static_libs}
--disable-static \
%endif
--with-pic \
--docdir=%_docdir/%name
make %{?_smp_mflags} make %{?_smp_mflags}
%endif %endif
@ -143,4 +173,10 @@ make install DESTDIR=$RPM_BUILD_ROOT
%{_libdir}/lib*.so %{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%if %{with static_libs}
%files static
%defattr(-, root, root)
%{_libdir}/*.a
%endif
%changelog %changelog