File c-rbtree.spec of Package c-rbtree

#
# spec file for package c-rbtree
#
# 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/
#


Name:           c-rbtree
%define lname	libcrbtree0
Version:        3.30
Release:        0
Summary:        Red-black tree implemention in C11
License:        Apache-2.0
Group:          Development/Libraries/C and C++
Url:            https://github.com/c-util/c-rbtree

Source:         %name-%version.tar.xz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  meson
BuildRequires:  pkg-config

%description
A library that implements a self-balancing red-black tree.

%package -n %lname
Summary:        Red-black tree implementation in C11
Group:          System/Libraries

%description -n %lname
A library that implements a self-balancing red-black tree.

%package devel
Summary:        Development files for c-rbtree, an rbtree implementation
Group:          Development/Libraries/C and C++
Requires:       %lname = %version

%description devel
A library that implements a self-balancing red-black tree.

%prep
%setup -q

%build
%meson --includedir="%_includedir/%name"
%meson_build

%install
%meson_install
perl -i -pe 's{Version:\s*3}{Version: %version}' %buildroot/%_libdir/pkgconfig/*.pc

%post   -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig

%files -n %lname
%defattr(-,root,root)
%_libdir/libcrbtree.so.*

%files devel
%defattr(-,root,root)
%_includedir/%name/
%_libdir/libcrbtree.so
%_libdir/pkgconfig/*.pc
%doc COPYING LICENSE* NEWS

%changelog
openSUSE Build Service is sponsored by