diff --git a/USAGE b/USAGE deleted file mode 100644 index 9f76607..0000000 --- a/USAGE +++ /dev/null @@ -1,45 +0,0 @@ -Project: miniupnp -Project web page: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ -Author: Thomas Bernard -Copyright (c) 2005-2011 Thomas Bernard -This software is subject to the conditions detailed in the -LICENSE file provided within this distribution. - -This file was contributed by Domingo Becker, domingobecker@gmail.com - -UPnPc usage -===== ===== - -From the command line: - -For listing all forwarded ports through UPnP in the current router: - -upnpc -l - -For adding a new port forward rule to the current router, for example, -to forward tcp traffic on port 81 to internal ip port 80: - -upnpc -a 10.0.0.3 80 81 tcp - -You don't have to worry about overwriting previous rules, because the -new ones will replace existing ones. - -If upnpc fails to add the rule, it may be because the port was added -before in a static forwarding rule. - -Traffic on port 1900 is blocked by default on Fedora, and even if -you open it, all traffic gets blocked because the nature of SSDP protocol. -You will need to open incoming traffic from udp port 1900, because the -packet sent to the router was from YourIP to 239.255.255.250 and the answer -sent by the router is from RouterIP to YourIP. As a result, conntrack -module can't track that kind of traffic and blocks all incoming answers. -To add the iptables rule manually, do the following: - -iptables -I INPUT -p udp --sport 1900 -j ACCEPT - -You may also add this custom rule to system-config-firewall. - -I hope you enjoy. - -Domingo Becker - diff --git a/miniupnpc-version.patch b/miniupnpc-version.patch deleted file mode 100644 index a854575..0000000 --- a/miniupnpc-version.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- CMakeLists.txt.orig 2018-05-07 11:07:00.000000000 +0000 -+++ CMakeLists.txt 2019-10-22 13:34:43.486818800 +0000 -@@ -119,12 +119,11 @@ endif () - if (UPNPC_BUILD_SHARED) - add_library (libminiupnpc-shared SHARED ${MINIUPNPC_SOURCES}) - set_target_properties (libminiupnpc-shared PROPERTIES OUTPUT_NAME "miniupnpc") -- set_target_properties (libminiupnpc-shared PROPERTIES VERSION ${MINIUPNPC_VERSION}) - set_target_properties (libminiupnpc-shared PROPERTIES SOVERSION ${MINIUPNPC_API_VERSION}) - target_link_libraries (libminiupnpc-shared PRIVATE miniupnpc-private) - target_compile_definitions(libminiupnpc-shared PRIVATE MINIUPNP_EXPORTS) - -- target_include_directories(libminiupnpc-static INTERFACE ../${CMAKE_CURRENT_SOURCE_DIR}) -+ target_include_directories(libminiupnpc-shared INTERFACE ../${CMAKE_CURRENT_SOURCE_DIR}) - if (WIN32) - target_link_libraries(libminiupnpc-shared INTERFACE ws2_32 iphlpapi) - endif() diff --git a/miniupnpc.spec b/miniupnpc.spec index e637bdf..8431233 100644 --- a/miniupnpc.spec +++ b/miniupnpc.spec @@ -1,169 +1,182 @@ -%global basepy3dir %(echo ../`basename %{py3dir}`) -%global major 17 -%filter_provides_in %{python_sitearch}/.*\.so$ - -Summary: Library and tool to control NAT in UPnP-enabled routers -Name: miniupnpc -Version: 2.1 -Release: 1%{?dist} -License: BSD -Group: System Environment/Libraries -URL: http://miniupnp.free.fr/ -Source: https://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz -BuildRequires: cmake -BuildRequires: python3-devel -# Do not create libminiupnpc.so.%%{version} and libminiupnpc.so.%%{major} linking to it -Patch0: %{name}-version.patch -Source1: USAGE +# Needed for RHEL/CentOS 8 +%undefine __cmake_in_source_build + +# Set a common one for all architectures and not _target_platform, fixes aarch64 +%global __cmake_builddir build + +%filter_provides_in %{python3_sitearch}/.*\.so$ + +Summary: Library and tool to control NAT in UPnP-enabled routers +Name: miniupnpc +Version: 2.2.5 +Release: 3%{?dist} +License: BSD +URL: http://miniupnp.free.fr/ + +BuildRequires: cmake >= 3.5.0 +BuildRequires: gcc +BuildRequires: make +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +Source0: http://miniupnp.free.fr/files/%{name}-%{version}.tar.gz %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. - -This package includes upnpc, a UPnP client application for configuring -port forwarding in UPnP enabled routers. - -%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 python3-%{name} -Summary: Python3 interface to %{name} -Group: System Environment/Libraries -Requires: %{name}%{?_isa} = %{version}-%{release} -BuildRequires: python3-devel - -%description -n python3-%{name} +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. + +This package includes upnpc, a UPnP client application for configuring port +forwarding in UPnP enabled routers. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains the header files and development documentation for +%{name}. + +%package -n python3-%{name} +Summary: Python3 interface to %{name} + +%description -n python3-%{name} This package contains python3 interfaces to %{name}. %prep -%setup -q -%patch0 -p0 -cp %{SOURCE1} . +%autosetup -p2 -sed -i "s|\(\tMAKE=\$(MAKE) python3 setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile +# Use already built shared object for Python module +# Unversioned link is not enough to avoid a rebuild +sed -i -e 's|build/libminiupnpc.a|build/libminiupnpc.so.%{version}|g' setup.py %build -mkdir -p build -pushd build -%cmake \ - -DUPNPC_BUILD_STATIC=OFF \ - -DUPNPC_BUILD_TESTS=ON \ - .. - make upnpc-shared all -popd -make pythonmodule3 -make upnpc-shared +%cmake \ + -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ + -DCMAKE_SKIP_RPATH:BOOL=YES \ + -DNO_GETADDRINFO=FALSE \ + -DUPNPC_BUILD_SAMPLE=TRUE \ + -DUPNPC_BUILD_SHARED=TRUE \ + -DUPNPC_BUILD_STATIC=FALSE \ + -DUPNPC_BUILD_TESTS=TRUE \ + -DUPNPC_NO_INSTALL=FALSE + +%cmake_build +%py3_build %install -make install DESTDIR=$RPM_BUILD_ROOT -C build -make DESTDIR=$RPM_BUILD_ROOT installpythonmodule3 -install -D -m644 man3/miniupnpc.3 $RPM_BUILD_ROOT/%{_mandir}/man3/miniupnpc.3 -install -D -m 0755 upnpc-shared $RPM_BUILD_ROOT%{_bindir}/upnpc +%cmake_install +%py3_install + +mv %{buildroot}%{_bindir}/upnpc-shared %{buildroot}%{_bindir}/upnpc +mv %{buildroot}%{_bindir}/listdevices %{buildroot}%{_bindir}/upnp-listdevices +rm -f %{buildroot}%{_bindir}/external-ip.sh %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} +%license LICENSE +%doc Changelog.txt README %{_bindir}/upnpc -%doc USAGE - -%files devel -%{_includedir}/miniupnpc +%{_bindir}/upnp-listdevices +%{_libdir}/libminiupnpc.so.17 +%{_libdir}/libminiupnpc.so.%{version} + +%files devel +%{_includedir}/%{name} +%{_libdir}/cmake/%{name}/libminiupnpc-shared-noconfig.cmake +%{_libdir}/cmake/%{name}/libminiupnpc-shared.cmake +%{_libdir}/cmake/%{name}/miniupnpc-config.cmake %{_libdir}/libminiupnpc.so -%{_mandir}/man3/miniupnpc.3* +%{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/%{name}.3* -%files -n python3-%{name} -%{python3_sitearch}/miniupnpc-%{version}-py?.?.egg-info +%files -n python3-%{name} +%{python3_sitearch}/miniupnpc-%{version}-py3.*.egg-info/ %{python3_sitearch}/miniupnpc*.so %changelog -* Tue Oct 22 2019 r4sas - 2.1-1 -- update to 2.1, remove python2 build rules +* Thu Jul 20 2023 Fedora Release Engineering - 2.2.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jun 16 2023 Python Maint - 2.2.5-2 +- Rebuilt for Python 3.12 + +* Wed Jun 14 2023 Simone Caronni - 2.2.5-1 +- Update to 2.2.5. + +* Tue Jun 13 2023 Python Maint - 2.2.4-4 +- Rebuilt for Python 3.12 + +* Thu Jan 19 2023 Fedora Release Engineering - 2.2.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Oct 28 2022 Simone Caronni - 2.2.4-2 +- Restore test client binary. -* Wed Jun 08 2016 François Kooman - 2.0-1 -- update to 2.0 +* Tue Oct 25 2022 Simone Caronni - 2.2.4-1 +- Update to 2.2.4. -* Thu Feb 04 2016 Fedora Release Engineering - 1.9-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild +* Thu Jul 21 2022 Fedora Release Engineering - 2.2.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild -* Tue Nov 10 2015 Fedora Release Engineering - 1.9-7 -- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 +* Mon Jun 13 2022 Python Maint - 2.2.3-3 +- Rebuilt for Python 3.11 -* Sat Oct 31 2015 pcpa - 1.9-6 -- Correct buffer overflow in XML parsing (#1270842, #1270182) +* Sat Jan 29 2022 Simone Caronni - 2.2.3-2 +- Build fixes. -* Wed Jun 17 2015 Fedora Release Engineering - 1.9-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild +* Fri Jan 28 2022 Simone Caronni - 2.2.3-1 +- Update to 2.2.3. +- Update SPEC file (license, tabs/spaces, trim changelog, etc.) +- Switch to CMake build. +- Drop static libraries. +- Drop test client and obsolete documentation. +- Do not use static library when building Python module. -* Sun Aug 17 2014 Fedora Release Engineering - 1.9-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild +* Thu Jan 20 2022 Fedora Release Engineering - 2.2.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild -* Sat Jun 07 2014 Fedora Release Engineering - 1.9-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild +* Thu Jul 22 2021 Fedora Release Engineering - 2.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild -* Wed May 28 2014 Kalev Lember - 1.9-2 -- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 +* Fri Jun 04 2021 Python Maint - 2.2.2-2 +- Rebuilt for Python 3.10 -* Wed Apr 16 2014 pcpa - 1.9-1 -- Update to latest upstream release (#1062206) -- Correct possible DoS crash vector (patch already in tarball) (#1085618) +* Wed Mar 03 2021 pcpa - 2.2.2-1 +- Update to version 2.2.2 -* Tue Aug 13 2013 pcpa - 1.8-1 -- Update to latest upstream release (#996357) -- Build extra python3 module +* Tue Jan 26 2021 Fedora Release Engineering - 2.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild -* Sat Aug 03 2013 Fedora Release Engineering - 1.6-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild +* Fri Nov 13 2020 Kalev Lember - 2.2.0-1 +- Update to 2.2.0 -* Tue Mar 05 2013 Domingo Becker - 1.6-9 -- Added upnpc, a client side tool, to the main package. -- Added USAGE file with instructions on how to use upnpc. +* Tue Jul 28 2020 Fedora Release Engineering - 2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild -* Thu Feb 14 2013 Fedora Release Engineering - 1.6-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild +* Tue May 26 2020 Miro Hrončok - 2.1-6 +- Rebuilt for Python 3.9 -* Fri Jul 20 2012 Fedora Release Engineering - 1.6-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild +* Wed Jan 29 2020 Fedora Release Engineering - 2.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild -* 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). +* Fri Nov 15 2019 Miro Hrončok - 2.1-4 +- Subpackage python2-miniupnpc has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal -* Sat May 26 2012 pcpa - 1.6-5 -- Build python module (817311#c14). +* Mon Aug 19 2019 Miro Hrončok - 2.1-3 +- Rebuilt for Python 3.8 -* Mon May 21 2012 pcpa - 1.6-4 -- Use %%name for source and patch names. -- Enable %%check. +* Thu Jul 25 2019 Fedora Release Engineering - 2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild -* 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 Feb 06 2019 Kalev Lember - 2.1-1 +- Update to 2.1 -* 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. +* Wed Feb 06 2019 Kalev Lember - 2.0-13 +- Fix FTBFS (#1604853) -* Sat Apr 28 2012 pcpa - 1.6-1 -- Initial libminiupnpc spec. +* Fri Feb 01 2019 Fedora Release Engineering - 2.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild