File ada-url.spec of Package ada-url

# Should match ADA_LIB_SOVERSION in CMakeLists.txt
%define sover 3
# Workaround obs-tar_scm bug
# https://github.com/openSUSE/obs-service-tar_scm/issues/384
%define a_name ada

Name:		ada-url
Version:	3.4.3
Release:	0
Summary:	WHATWG-compliant and fast URL parser written in modern C++
License:	Apache-2.0 OR MIT
URL:		https://www.ada-url.com/
Source0:    %{a_name}-%{version}.tar.gz
Patch0:     0001-Disable-CPM-CMake-Package-Manager.patch
BuildRequires:	cmake
BuildRequires:  gcc-c++ >= 8
BuildRequires:	cmake(fmt)
BuildRequires:	cmake(cxxopts)
BuildRequires:	cmake(GTest)
BuildRequires:	cmake(benchmark)
BuildRequires:	cmake(simdjson)
BuildRequires:	doxygen
BuildRequires:  fdupes

%description
Ada is a fast and spec-compliant URL parser written in C++.
Specification for URL parser can be found from the WHATWG website.

The Ada library passes the full range of tests from the specification,
across a wide range of platforms.
It fully supports the relevant Unicode Technical Standard.


%package -n lib%{name}%{sover}
Summary:	WHATWG-compliant and fast URL parser written in modern C++

%description -n lib%{name}%{sover}
Ada is a fast and spec-compliant URL parser written in C++.
Specification for URL parser can be found from the WHATWG website.

The Ada library passes the full range of tests from the specification,
across a wide range of platforms.
It fully supports the relevant Unicode Technical Standard.

This package contains the shared library.

%package tools
Summary:	Tools for %{name}

%description tools
This package contains command line utility for parsing URL.

%package devel
Summary:	Development files for %{name}
Requires:	lib%{name}%{sover} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package doc
Summary:	Developer documentation for %{name}
Recommends:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description doc
The %{name}-doc package contains developer documentation for
the %{name} package.

%prep
%autosetup -p1 -n %{a_name}-%{version}

%build
%cmake \
    -DADA_TOOLS=True
    %{nil}
%cmake_build

cd ..
doxygen ./doxygen
%fdupes docs

%install
%cmake_install


%check
%ctest

%post -n lib%{name}%{sover} -p /sbin/ldconfig
%postun -n lib%{name}%{sover} -p /sbin/ldconfig

%files -n lib%{name}%{sover}
%license LICENSE-MIT LICENSE-APACHE
%{_libdir}/libada.so.%{sover}*

%files tools
%doc docs/cli.md
%{_bindir}/adaparse

%files devel
%doc README.md
%{_libdir}/libada.so
%{_libdir}/cmake/ada/
%{_includedir}/ada/
%{_includedir}/ada.h
%{_includedir}/ada_c.h
%{_libdir}/pkgconfig/ada.pc

%files doc
%doc docs/html/

%changelog
openSUSE Build Service is sponsored by