%global major 8 %filter_provides_in %{python_sitearch}/.*\.so$ Summary: Library and tool to control NAT in UPnP-enabled routers Name: miniupnpc Version: 1.6 Release: 6%{?dist} License: BSD Group: System Environment/Libraries URL: http://miniupnp.free.fr/ Source: http://miniupnp.free.fr/files/%{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: python-devel # Install headers and add extra file to compilation # Patch originally from Mageia Linux Patch0: %{name}-1.6-files.patch # Do not create libminiupnpc.so.1.5 and libminiupnpc.so.8 linking to it Patch1: %{name}-1.6-version.patch # Link to and find libminiupnpc Patch2: %{name}-1.6-tests.patch %description miniupnpc is an implementation of a UPnP client library, enabling applications to access the services provided by an UPnP "Internet Gateway Device" present on the network. In UPnP terminology, it is a UPnP Control Point. %package devel Summary: Development files for miniupnpc Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains the header files and development documentation for %{name}. %package -n python-%{name} Summary: Python interface to %{name} Group: System Environment/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description -n python-%{name} This package contains python interfaces to %{name}. %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 sed -i "s|\(\tpython setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile # version not updated in setup.py sed -i 's/"1\.5"/"%{version}"/' setup.py %build mkdir -p build pushd build %cmake \ -DUPNPC_BUILD_STATIC=OFF \ -DUPNPC_BUILD_TESTS=ON \ .. make upnpc-shared all popd make pythonmodule %install make install DESTDIR=$RPM_BUILD_ROOT -C build make DESTDIR=$RPM_BUILD_ROOT installpythonmodule install -D -m644 man3/miniupnpc.3 $RPM_BUILD_ROOT/%{_mandir}/man3/miniupnpc.3 %check make CFLAGS="%{optflags} -DMINIUPNPC_SET_SOCKET_TIMEOUT" check %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %doc Changelog.txt %doc LICENSE %doc README %{_libdir}/libminiupnpc.so.%{major} %files devel %{_includedir}/miniupnpc %{_libdir}/libminiupnpc.so %{_mandir}/man3/miniupnpc.3* %files -n python-%{name} %{python_sitearch}/miniupnpc-%{version}-py?.?.egg-info %{python_sitearch}/miniupnpc.so %changelog * Wed May 30 2012 pcpa - 1.6-6 - Add Changelog.txt to documentation. - Correct package version in setup.py. - Correct rpmlint warning on source rpm. - Filter provides of private python shared object (817311#c19). * Sat May 26 2012 pcpa - 1.6-5 - Build python module (817311#c14). * Mon May 21 2012 pcpa - 1.6-4 - Use %%name for source and patch names. - Enable %%check. * Mon May 7 2012 pcpa - 1.6-3 - Prefer %%global over %%define. - Add proper documentation to main package. - Ensure library is built before making simple test programs. * Wed May 2 2012 pcpa - 1.6-2 - Rename package to miniupnpc to match source tarball. - Add patch to enable build of tests. - Include manual page to devel package. - Change License to match LICENSE file. * Sat Apr 28 2012 pcpa - 1.6-1 - Initial libminiupnpc spec.