File libnih.spec of Package libnih

#
# spec file for package libnih
#
# Copyright (c) 2021 SUSE LLC
#
# 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/
#


%define __filter_GLIBC_PRIVATE 1
%define _version 1.0
%define sover  1
Name:           libnih
Version:        1.0.3
Release:        0
Summary:        Small library for C application development
License:        GPL-2.0-or-later
Group:          System/Libraries
URL:            https://launchpad.net/libnih
Source:         https://launchpad.net/%{name}/%{_version}/%{version}/+download/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE libnih-lstat-fallback.patch xnox@debian.org -- Fallback to lstat if dirent.d_-ype is not available (fixes non-ext filesystems).
Patch0:         libnih-lstat-fallback.patch
# PATCH-FIX-OPENSUSE libnih-dbus-codegen-empty-lists.patch stgraber@ubuntu.com, steve.langasek@canonical.com -- Update D-Bus code generator to allow for empty lists for type 'as'.
Patch1:         libnih-dbus-codegen-empty-lists.patch
# PATCH-FIX-OPENSUSE libnih-test-child-ignore-spurious-sigcont.patch aurel32@debian.org -- Fix wrong ptrace expectations in test_child.c, causing the testsuite to fail with glibc >= 2.24.
Patch2:         libnih-test-child-ignore-spurious-sigcont.patch
# PATCH-FIX-OPENSUSE libnih-fix-test-parse.patch sor.alexei@meowr.ru -- Fix test_parse build failure.
Patch3:         libnih-fix-test-parse.patch
# PATCH-FIX-OPENSUSE libnih-fno-common.patch -- Fix build with -fno-common.
Patch4:         libnih-fno-common.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gettext
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(expat)

%description
libnih is a light-weight "standard library" of C functions to ease
the development of other libraries and applications, especially
those normally found in /lib.

%package -n %{name}%{sover}
Summary:        Small library for C application development
Group:          System/Libraries

%description -n %{name}%{sover}
libnih is a light-weight "standard library" of C functions to ease
the development of other libraries and applications, especially
those normally found in /lib.

%package devel
Summary:        Development files of libnih
Group:          Development/Libraries/C and C++
Requires:       %{name}%{sover} = %{version}
Requires:       glibc-devel
Requires:       pkgconfig(dbus-1)
Requires:       pkgconfig(expat)

%description devel
The libtaglib development package includes the header files, libraries,
configuration files and development tools necessary for compiling and
linking application which will use libnih.

%prep
%autosetup -p1

%build
autoreconf -fi
%configure \
  --disable-static
%make_build

%install
%make_install \
  pkgconfigdir=%{_libdir}/pkgconfig

find %{buildroot} -type f -name "*.la" -delete -print

%check
%make_build check

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

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

%files -n %{name}%{sover}
%license COPYING
%doc AUTHORS HACKING NEWS README TODO
%{_libdir}/%{name}*.so.1*

%files devel
%{_bindir}/nih-dbus-tool
%{_libdir}/%{name}*.so
%{_libdir}/pkgconfig/%{name}*.pc
%{_datadir}/aclocal/%{name}.m4
%{_includedir}/nih*/
%{_includedir}/%{name}*.h
%{_mandir}/man?/nih-dbus-tool.?%{?ext_man}

%changelog
openSUSE Build Service is sponsored by