File libzip.spec of Package libzip

#
# spec file for package libzip
#
# 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/
#

# norootforbuild


Name:           libzip
Version:        0.10
Release:        3
Summary:        C library for reading, creating, and modifying zip archives
License:        BSD3c
Group:          Development/Libraries/C and C++
Source0:        http://www.nih.at/libzip/%{name}-%{version}.tar.bz2
Url:            http://www.nih.at/libzip
BuildRequires:  zlib-devel
BuildRequires:  pkg-config
Provides:       libzip-util = %{version}
Obsoletes:      libzip-util < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Patch0:         libzip-0.8.hg20080403-visibility.patch
#PATCH-FIX-UPSTREAM: for for failing tests by Thomas Klausner
Patch1:         libzip.test.diff

%description
libzip is a C library for reading, creating, and modifying zip
archives. Files can be added from data buffers, files, or compressed. This
package contains a set of small utilities built using libzip
 * zipmerge - merge source zip archives into the target one
 * zipcmp - compares the zip archives and check if they contains same files
 * ziptorrent - manipulate with a restricted file format used for using bittorrent on zip files.

%package -n libzip2
License:        BSD3c
Summary:        C library for reading, creating, and modifying zip archives
Group:          Development/Libraries/C and C++

%define soname 2

%description -n libzip%{soname}
This is libzip, a C library for reading, creating, and modifying zip
archives.  Files can be added from data buffers, files, or compressed
data copied directly from other zip archives.  Changes made without
closing the archive can be reverted.  The API is documented by man
pages.

%package devel
License:        BSD3c
Summary:        C library for reading, creating, and modifying zip archives
Group:          Development/Libraries/C and C++
Requires:       libzip%{soname} = %{version} glibc-devel

%description devel
libzip is a C library for reading, creating, and modifying zip
archives. This package contains devel files.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1

%build
autoreconf -fiv
%configure --disable-static --with-pic
%{__make} %{?jobs:-j%jobs}

%check
export MALLOC_CHECK_=2
%{__make} --debug=j %{?jobs:-j%jobs} check
unset MALLOC_CHECK_

%install
%{__make} install DESTDIR=%{buildroot}
%__cp lib/zipconf.h %buildroot/%_includedir/zipconf.h
rm -f %{buildroot}%{_libdir}/libzip.la

%clean
rm -rf %{buildroot}

%post -n libzip%{soname} -p /sbin/ldconfig

%postun -n libzip%{soname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS NEWS README THANKS TODO
%{_bindir}/ziptorrent
%{_bindir}/zipcmp
%{_bindir}/zipmerge
%{_mandir}/man1/*.1*

%files -n libzip%{soname}
%defattr(-,root,root)
%{_libdir}/libzip.so.%{soname}*

%files devel
%defattr(-,root,root)
%{_libdir}/%{name}.so
%{_includedir}/zip.h
%{_includedir}/zipconf.h
%{_libdir}/%{name}/
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man3/*.3*

%changelog
openSUSE Build Service is sponsored by