miniupnpc/miniupnpc.spec
2016-04-24 19:06:59 +00:00

118 lines
3.4 KiB
RPMSpec

#
# spec file for package miniupnpc
#
# Copyright (c) 2016 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/
#
%define soname 16
Name: miniupnpc
Version: 2.0
Release: 0
Summary: Universal Plug'n'Play (UPnP) Client
License: BSD-3-Clause
Group: Productivity/Networking/Other
Url: http://miniupnp.free.fr/
Source: http://miniupnp.free.fr/files/miniupnpc-%{version}.tar.gz
Source99: baselibs.conf
BuildRequires: python-devel
Requires: libminiupnpc%{soname} = %{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The MiniUPnP project offers software which supports the UPnP Internet Gateway
Device (IGD) specifications.
%package -n libminiupnpc%{soname}
Summary: Universal Plug'n'Play (UPnP) Client Library
Group: System/Libraries
%description -n libminiupnpc%{soname}
The MiniUPnP project offers software which supports the UPnP Internet Gateway
Device (IGD) specifications.
%package -n libminiupnpc-devel
Summary: Universal Plug'n'Play (UPnP) Client Library
Group: Development/Libraries/C and C++
Requires: libminiupnpc%{soname} = %{version}-%{release}
%description -n libminiupnpc-devel
The MiniUPnP project offers software which supports the UPnP Internet Gateway
Device (IGD) specifications.
%package -n python-miniupnpc
Summary: Universal Plug'n'Play (UPnP) Client Module for Python
Group: Development/Libraries/Python
Requires: libminiupnpc%{soname} = %{version}-%{release}
%py_requires
%description -n python-miniupnpc
The MiniUPnP project offers software which supports the UPnP Internet Gateway
Device (IGD) specifications.
%prep
%setup -q
%build
export CFLAGS="%{optflags}"
make %{?_smp_mflags} \
CC="gcc" \
OPTFLAGS="%{optflags}" \
PYTHON="python"
python ./setup.py build
%install
make \
INSTALLPREFIX="%{buildroot}%{_prefix}" \
INSTALLDIRINC="%{buildroot}%{_includedir}/miniupnpc" \
INSTALLDIRLIB="%{buildroot}%{_libdir}" \
INSTALLDIRBIN="%{buildroot}%{_bindir}" \
INSTALL="install" \
install
python ./setup.py install \
--prefix="%{_prefix}" \
--root=%{buildroot} \
--record-rpm="rpmfiles.lst"
# Remove static libs
rm -f %{buildroot}%{_libdir}/*.a
# The man page should be non executable
chmod -x %{buildroot}%{_mandir}/man3/miniupnpc.3.gz
%post -n libminiupnpc%{soname} -p /sbin/ldconfig
%postun -n libminiupnpc%{soname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/upnpc
%{_bindir}/external-ip
%{_mandir}/man3/miniupnpc.3.*
%files -n libminiupnpc%{soname}
%defattr(-,root,root)
%doc LICENSE Changelog.txt README
%{_libdir}/libminiupnpc.so.%{soname}
%files -n libminiupnpc-devel
%defattr(-,root,root)
%{_includedir}/miniupnpc/
%{_libdir}/libminiupnpc.so
%files -n python-miniupnpc -f rpmfiles.lst
%defattr(-,root,root)
%changelog