File libzim.spec of Package libzim

#
# spec file for package libzim
#
# Copyright (c) 2021 Samu Voutilainen <kiwix@smar.fi>
#
# 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.

%define sover 9

Name:           libzim
Version:        6.3.0
Release:        0
Summary:        Reference implementation for the ZIM file format
License:        GPL-2.0
Group:          Productivity/Other
Url:            https://github.com/openzim/libzim
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  c++_compiler
BuildRequires:  libicu-devel
BuildRequires:  libxapian-devel
BuildRequires:  libzstd-devel
BuildRequires:  lzma-devel
BuildRequires:  meson
BuildRequires:  ninja
BuildRequires:  uuid-devel
#BuildRequires:  pkg-config
#BuildRequires:  pkgconfig(icu-i18n)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The ZIM library is the reference implementation for the ZIM file format. It's a
solution to read and write ZIM files on many systems and architectures. More
information about the ZIM format and the openZIM project at https://openzim.org/.

%package -n %{name}%{sover}
Summary:        Shared library for libzim
Group:          System/Libraries

%description -n %{name}%{sover}
The ZIM library is the reference implementation for the ZIM file format. It's a
solution to read and write ZIM files on many systems and architectures. More
information about the ZIM format and the openZIM project at https://openzim.org/.

This package contains shared library of the reference implementaation of ZIM file
format.

%package devel
Summary:        Development files for libzim
Group:          Development/Languages/C and C++
Requires:       %{name}%{sover} == %{version}

%description devel
The ZIM library is the reference implementation for the ZIM file format. It's a
solution to read and write ZIM files on many systems and architectures. More
information about the ZIM format and the openZIM project at https://openzim.org/.

This package contains development files for libzim.

%prep
%setup -q

%build
%meson
%meson_build

%install
%meson_install

%check
%meson_test

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

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

%files -n %{name}%{sover}
%defattr(-,root,root,-)

%{_libdir}/libzim.so.*

%files devel
%defattr(-,root,root,0755)

%{_includedir}/zim

%{_libdir}/libzim.so
%{_libdir}/pkgconfig/libzim.pc

%changelog