File libzip.spec of Package libzip

#
# spec file for package libzip
#
# Copyright (c) 2014 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/
#


%define soname 2

Name:           libzip
Version:        0.11.2
Release:        0
Summary:        C library for reading, creating, and modifying zip archives
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Source0:        http://www.nih.at/libzip/%{name}-%{version}.tar.xz
Source1:        baselibs.conf
Url:            http://www.nih.at/libzip
BuildRequires:  autoconf >= 2.68
BuildRequires:  libtool
BuildRequires:  pkg-config
# for tests
BuildRequires:  timezone
# for tests
BuildRequires:  unzip
BuildRequires:  xz
BuildRequires:  zlib-devel
Provides:       libzip-util = %{version}
Obsoletes:      libzip-util < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#PATCH-FIX-OPENSUSE: close on exec, upstream is aware, will be probably fixes next release
Patch1:         libzip-ocloexec.patch
#PATCH-FIX-OPENSUSE: deprecate old autoconf macros
Patch2:         libzip-autoconf-268.patch

%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 libzip%soname
Summary:        C library for reading, creating, and modifying zip archives
Group:          Development/Libraries/C and C++

%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
Summary:        C library for reading, creating, and modifying zip archives
Group:          Development/Libraries/C and C++
Requires:       glibc-devel
Requires:       libzip%{soname} = %{version}

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

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

%build
autoreconf -fiv
%configure --disable-static --with-pic
make %{?_smp_mflags}

%check
TZ=Europe/Vienna make %{?_smp_mflags} check VERBOSE=1

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

%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