File zlib.spec of Package zlib.import4664

#
# spec file for package zlib
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#



Name:           zlib
License:        Other uncritical OpenSource License
Group:          System/Libraries
Provides:       libz
Obsoletes:      libz
# bug437293
%ifarch ppc64
Obsoletes:      zlib-64bit
%endif
#
Version:        1.2.5
Release:        9.<RELEASE10>
Summary:        Data Compression Library
Url:            http://www.zlib.net/
Source:         zlib-%{version}.tar.bz2
Source1:        LICENSE
Source2:        baselibs.conf
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/Packaging/Patches
Patch0:         zlib-1.2.2-format.patch
# PATCH-FIX-UPSTREAM zlib-lfs.patch dimstar@opensuse.org -- Properly define large file support. Patch taken from gentoo
Patch1:         zlib-lfs.patch
# PATCH-FIX-JENGELH-PARALLEL-MAKE zlib-parallel.patch meissner@novell.com -- shared library links with libz.a
Patch2:         zlib-parallel.patch
# PATCH-FIX-UPSTREAM: bnc#679345 --return NULL checks from 1.2.3 removed by upstream
Patch3:         zlib-1.2.5-gzopen-null-check.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pkgconfig

%description
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt
(deflate format) and rfc1952.txt (gzip format). These documents are
also available in other formats from
ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html.

%package devel
License:        Other uncritical OpenSource License
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Languages/C and C++
Requires:       glibc-devel
Requires:       zlib = %{version}
Provides:       libz:/usr/include/zlib.h
# bug437293
%ifarch ppc64
Obsoletes:      zlib-devel-64bit
%endif
#

%description devel
This package contains all necessary include files and libraries needed
to develop applications that require the provided includes and
libraries.

%package devel-static
License:        Other uncritical OpenSource License
Summary:        Include Files and Libraries mandatory for Development
Group:          Development/Languages/C and C++
Requires:       %{name}-devel = %{version}
Provides:       %{name}-devel:%{_libdir}/libz.a

%description devel-static
This package contains all necessary include files and libraries needed
to develop applications that require the provided includes and
libraries.

%prep
%setup -q
%patch0
%patch1
%patch2 -p1
%patch3 -p1

%build
# Marcus: breaks example64 in 32bit builds.
%define do_profiling 0
%if %{do_profiling}
profiledir=$(mktemp -d)
trap "rm -rf $profiledir" EXIT
./configure --shared
%{__make} CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_generate}=$profiledir" %{?_smp_mflags}
time make check
make clean
%{__make} CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_feedback}=$profiledir" %{?_smp_mflags}
%else
export CFLAGS="%optflags"
./configure --shared
%{__make} %{?_smp_mflags}
%endif

%check
time make check

%install
mkdir -p %{buildroot}{/%{_lib},%{_libdir}}
mkdir -p %{buildroot}%{_mandir}/man3
mkdir -p %{buildroot}%{_includedir}
make install \
	prefix=%{buildroot}%{_prefix} \
	libdir=%{buildroot}/%{_lib}
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/libz.so) %{buildroot}%{_libdir}/libz.so
%{__rm} -v %{buildroot}/%{_lib}/libz.so
# static lib
mv %{buildroot}/%{_lib}/libz.a %{buildroot}%{_libdir}
# Move .pc file to %{_libdir}
mv %{buildroot}/%{_lib}/pkgconfig %{buildroot}%{_libdir}
# manpage
install -m 644 zlib.3 %{buildroot}%{_mandir}/man3
install -m 644 zutil.h %{buildroot}%{_includedir}

%clean
rm -rf %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
/%{_lib}/libz.so.1.2.*
/%{_lib}/libz.so.1

%files devel
%defattr(-,root,root)
%doc README ChangeLog
%doc %{_mandir}/man3/zlib.3.gz
%{_includedir}/zlib.h
%{_includedir}/zconf.h
%{_includedir}/zutil.h
%{_libdir}/libz.so
%{_libdir}/pkgconfig/zlib.pc

%files devel-static
%defattr(-,root,root)
%{_libdir}/libz.a

%changelog