Browse Source

update to 2.1, change used python to 3rd version

master
R4SAS 5 years ago committed by GitHub
parent
commit
85386b4382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      miniupnpc.spec

39
miniupnpc.spec

@ -1,22 +1,17 @@
%if 0%{?fedora} >= 18
%global with_python3 1
%global basepy3dir %(echo ../`basename %{py3dir}`) %global basepy3dir %(echo ../`basename %{py3dir}`)
%else %global major 17
%global with_python3 0
%endif
%global major 16
%filter_provides_in %{python_sitearch}/.*\.so$ %filter_provides_in %{python_sitearch}/.*\.so$
Summary: Library and tool to control NAT in UPnP-enabled routers Summary: Library and tool to control NAT in UPnP-enabled routers
Name: miniupnpc Name: miniupnpc
Version: 2.0 Version: 2.1
Release: 1%{?dist} Release: 1%{?dist}
License: BSD License: BSD
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://miniupnp.free.fr/ URL: http://miniupnp.free.fr/
Source: https://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz Source: https://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz
BuildRequires: cmake BuildRequires: cmake
BuildRequires: python2-devel BuildRequires: python3-devel
# Do not create libminiupnpc.so.%%{version} and libminiupnpc.so.%%{major} linking to it # Do not create libminiupnpc.so.%%{version} and libminiupnpc.so.%%{major} linking to it
Patch0: %{name}-version.patch Patch0: %{name}-version.patch
# Link to and find libminiupnpc # Link to and find libminiupnpc
@ -41,15 +36,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
This package contains the header files and development documentation This package contains the header files and development documentation
for %{name}. 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}.
%if %{with_python3}
%package -n python3-%{name} %package -n python3-%{name}
Summary: Python3 interface to %{name} Summary: Python3 interface to %{name}
Group: System Environment/Libraries Group: System Environment/Libraries
@ -58,7 +44,6 @@ BuildRequires: python3-devel
%description -n python3-%{name} %description -n python3-%{name}
This package contains python3 interfaces to %{name}. This package contains python3 interfaces to %{name}.
%endif
%prep %prep
%setup -q %setup -q
@ -66,10 +51,7 @@ This package contains python3 interfaces to %{name}.
%patch1 -p1 %patch1 -p1
cp %{SOURCE1} . cp %{SOURCE1} .
sed -i "s|\(\tpython setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile
%if %{with_python3}
sed -i "s|\(\tpython3 setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile sed -i "s|\(\tpython3 setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile
%endif
# version not updated in setup.py # version not updated in setup.py
sed -i 's/"1\.7"/"%{version}"/' setup.py sed -i 's/"1\.7"/"%{version}"/' setup.py
@ -87,18 +69,12 @@ pushd build
.. ..
make upnpc-shared all make upnpc-shared all
popd popd
make pythonmodule
%if %{with_python3}
make pythonmodule3 make pythonmodule3
%endif
make upnpc-shared make upnpc-shared
%install %install
make install DESTDIR=$RPM_BUILD_ROOT -C build make install DESTDIR=$RPM_BUILD_ROOT -C build
make DESTDIR=$RPM_BUILD_ROOT installpythonmodule
%if %{with_python3}
make DESTDIR=$RPM_BUILD_ROOT installpythonmodule3 make DESTDIR=$RPM_BUILD_ROOT installpythonmodule3
%endif
install -D -m644 man3/miniupnpc.3 $RPM_BUILD_ROOT/%{_mandir}/man3/miniupnpc.3 install -D -m644 man3/miniupnpc.3 $RPM_BUILD_ROOT/%{_mandir}/man3/miniupnpc.3
install -D -m 0755 upnpc-shared $RPM_BUILD_ROOT%{_bindir}/upnpc install -D -m 0755 upnpc-shared $RPM_BUILD_ROOT%{_bindir}/upnpc
@ -122,17 +98,14 @@ make CFLAGS="%{optflags} -DMINIUPNPC_SET_SOCKET_TIMEOUT" check
%{_libdir}/libminiupnpc.so %{_libdir}/libminiupnpc.so
%{_mandir}/man3/miniupnpc.3* %{_mandir}/man3/miniupnpc.3*
%files -n python-%{name}
%{python_sitearch}/miniupnpc-%{version}-py?.?.egg-info
%{python_sitearch}/miniupnpc.so
%if %{with_python3}
%files -n python3-%{name} %files -n python3-%{name}
%{python3_sitearch}/miniupnpc-%{version}-py?.?.egg-info %{python3_sitearch}/miniupnpc-%{version}-py?.?.egg-info
%{python3_sitearch}/miniupnpc*.so %{python3_sitearch}/miniupnpc*.so
%endif
%changelog %changelog
* Tue Oct 22 2019 r4sas <r4sas@i2pmail.org> - 2.1-1
- update to 2.1, remove python2 build rules
* Wed Jun 08 2016 François Kooman <fkooman@tuxed.net> - 2.0-1 * Wed Jun 08 2016 François Kooman <fkooman@tuxed.net> - 2.0-1
- update to 2.0 - update to 2.0

Loading…
Cancel
Save