File libmspack.spec of Package libmspack.9084

#
# spec file for package libmspack
#
# Copyright (c) 2018 SUSE LINUX 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 https://bugs.opensuse.org/
#


Name:           libmspack
Version:        0.5
Release:        0
# "alpha" in the version string just says that it is an alpha version.
%define _version %{version}alpha
Summary:        Library That Implements Different Microsoft Compressions
License:        LGPL-2.1-only
Group:          System/Libraries
Url:            http://www.cabextract.org.uk/libmspack/
# Warning, OBS download service does not work at http://www.cabextract.org.uk/
#Source:        http://www.cabextract.org.uk/libmspack/%{name}-%{_version}.tar.gz
Source:         %{name}-%{_version}.tar.gz
Source2:        baselibs.conf
# PATCH-FIX-UPSTREAM libmspack-resize-buffer.patch https://github.com/kyz/libmspack/commit/40ef1b4093d77ad3a5cfcee1f5cb6108b3a3bcc2 -- CAB block input buffer is one byte too small.
Patch0:         %{name}-resize-buffer.patch
# PATCH-FIX-UPSTREAM libmspack-fix-bounds-checking.patch https://github.com/kyz/libmspack/commit/72e70a921f0f07fee748aec2274b30784e1d312a --  Fix off-by-one bounds check.
Patch1:         %{name}-fix-bounds-checking.patch
# PATCH-FIX-UPSTREAM libmspack-reject-blank-filenames.patch https://github.com/kyz/libmspack/commit/8759da8db6ec9e866cb8eb143313f397f925bb4f --  Avoid returning etries that are blank.
Patch2:         %{name}-reject-blank-filenames.patch
# PATCH-FIX-UPSTREAM libmspack-fix-test-install.patch https://github.com/kyz/libmspack/commit/7cadd489698be117c47efcadd742651594429e6d --  Add anti "../" and leading slash protection to chmextract.
Patch3:         %{name}-fix-test-install.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pkg-config

%description
The purpose of libmspack is to provide both compression and
decompression of some loosely related file formats used by Microsoft.
Currently the most common formats are implemented.

%package -n libmspack0
Summary:        Library That Implements Different Microsoft Compressions
# OpenSUSE <= 10.3, SLES <= 10:
Group:          System/Libraries
Provides:       libmspack = %{version}-%{release}
Obsoletes:      libmspack < %{version}-%{release}

%description -n libmspack0
The purpose of libmspack is to provide both compression and
decompression of some loosely related file formats used by Microsoft.
Currently the most common formats are implemented.

%package devel
Summary:        Static libraries, header files and documentation for libmspack
Group:          Development/Libraries/C and C++
Requires:       libmspack0 = %{version}

%description devel
The libmspack-devel package contains the header files and static
libraries necessary for developing programs using libmspack.

%prep
%setup -q -n %{name}-%{_version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
%configure\
	--disable-static
make %{?_smp_mflags}

%install
%makeinstall
rm $RPM_BUILD_ROOT%{_libdir}/*.*a

%post -n libmspack0 -p /sbin/ldconfig

%postun -n libmspack0 -p /sbin/ldconfig

%files -n libmspack0
%defattr(-,root,root)
%{_libdir}/*.so.*
%doc AUTHORS COPYING.LIB ChangeLog README TODO

%files devel
%defattr(-,root,root)
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*

%changelog
openSUSE Build Service is sponsored by