File libnatpmp.spec of Package libnatpmp
#
# spec file for package libnatpmp
#
# Copyright (c) 2025 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/
#
Name: libnatpmp
Version: 0.0_git20250403
Release: 0
Summary: NAT-PMP C++ library
License: BSD-3-Clause
Group: System/Libraries
URL: http://miniupnp.free.fr/%{name}.html
Source0: %{name}-%{version}.tar.xz
Patch0: %{name}-make.patch
BuildRequires: gcc-c++
%define soname 1
%define description_text NAT-PMP is the direct concurrent to the UPnP IGD specification. It is providing a way to do NAT traversal. It is part of the Bonjour protocol specifications.
%description
%{description_text}
%package -n %{name}%{soname}
Summary: NAT-PMP C++ library
Group: System/Libraries
%description -n %{name}%{soname}
%{description_text}
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Requires: %{name}%{soname} = %{version}
%description devel
%{description_text}
The %{name}-devel package contains libraries and header files for developing applications that use %{name}.
%prep
%setup -q
%patch -P 0
%build
%make_build
%{__strip} -s libnatpmp.so
%install
%make_install PREFIX=%{buildroot} LIBDIR=%{_lib}
%{__strip} -s %{buildroot}%{_bindir}/natpmpc
%{__chmod} a+x %{buildroot}%{_libdir}/*.so.*
# eliminate files that do not go into the package
find %{buildroot} -name '*.a' -exec %{__rm} -f {} ';'
%check
%post -n %{name}%{soname}
/sbin/ldconfig
%postun -n %{name}%{soname}
/sbin/ldconfig
%files -n %{name}%{soname}
%defattr(-,root,root,-)
%attr(755,root,root) %{_bindir}/natpmpc
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%{_includedir}/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so
%doc Changelog.txt README
%license LICENSE
%changelog