File uriparser.spec of Package uriparser.9488

#
# spec file for package liburiparser1
#
# 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 http://bugs.opensuse.org/
#

# build --with=cpptest to run unit tests
%bcond_with cpptest

%define so_ver 1
Name:           uriparser
Version:        0.8.5
Release:        0
Summary:        A strictly RFC 3986 compliant URI parsing library
License:        BSD-3-Clause
Group:          Development/Libraries/C and C++
Url:            https://uriparser.github.io
Source:         https://github.com/uriparser/uriparser/archive/%{name}-%{version}.tar.gz
Source1:        baselibs.conf
Patch0:         uriparser-doxygen.patch
Patch1:         CVE-2018-19198.patch
Patch2:         CVE-2018-19200.patch
Patch3:         CVE-2018-19199.patch
Patch4:         CVE-2018-20721.patch
BuildRequires:  automake
BuildRequires:  doxygen
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(libxdot)
%if %{with cpptest}
BuildRequires:  cpptest-devel > 1.1.0
%endif
Provides:       uriparse = %{version}-%{release}
Obsoletes:      uriparse < %{version}-%{release}

%description
uriparser is a strictly RFC 3986 compliant URI parsing library
and supports Unicode.

There is a command line tool, uriparse, which allows parsing URIs and
show how the liburiparser splits it into components.

%package -n liburiparser%{so_ver}
Summary:        A strictly RFC 3986 compliant URI parsing library
License:        BSD-3-Clause
Group:          System/Libraries

%description -n liburiparser%{so_ver}
uriparser is a strictly RFC 3986 compliant URI parsing library
and supports Unicode.

%package devel
Summary:        Development files for a URI parsing library
License:        BSD-3-Clause and LGPL-2.1
Group:          Development/Libraries/C and C++
Requires:       liburiparser%{so_ver} = %{version}
Requires:       glibc-devel
Provides:       liburiparser-devel = %{version}-%{release}
Obsoletes:      liburiparser-devel < %{version}-%{release}

%description devel
uriparser is a strictly RFC 3986 compliant URI parsing library
and supports Unicode.

This subpackage contains the header files for the library.

%prep
%setup -q -n %{name}-%{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
#file is dated in the future..
#find . -type f -exec touch {} +
# This is ridiculous but the patch doesn't apply at all for no reasons
sed -i "s|# .qhp output|HTML_TIMESTAMP=NO|g" doc/Doxyfile.in

%build
autoreconf -fiv
%configure \
    --disable-static \
%if ! %{with cpptest}
    --disable-test \
%endif
    --docdir=%{_docdir}/%{name}-devel

make %{?_smp_mflags}

%install
%make_install
rm -f %{buildroot}%{_libdir}/*.la
# Currently documentation is useless - revisit at later date
rm -rf %{buildroot}%{_docdir}/%{name}-devel/html

%check
export MALLOC_CHECK_=2 MALLOC_PERTURB_=$((${RANDOM:-256} % 256))
make check || ( cat ./test-suite.log && false )
unset MALLOC_CHECK_ MALLOC_PERTURB_

%post -n liburiparser%{so_ver} -p /sbin/ldconfig

%postun -n liburiparser%{so_ver} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%license COPYING
%{_bindir}/uriparse

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

%files devel
%defattr(-,root,root)
%license COPYING
%doc ChangeLog README.md THANKS TODO.txt GOALS.txt AUTHORS
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%{_libdir}/liburiparser.so
%{_libdir}/pkgconfig/liburiparser.pc
# %%{_docdir}/%%{name}-devel/html/*
%dir %{_docdir}/%{name}-devel
#%%dir %%{_docdir}/%%{name}-devel/html

%changelog
openSUSE Build Service is sponsored by