Compare commits

..

No commits in common. '6f8eb55535dfc9a558717fd8fc4a8c7e82610479' and 'a9f86dbb192ddc3aace34c033bed0d80973185c9' have entirely different histories.

  1. 45
      USAGE
  2. 16
      miniupnpc-version.patch
  3. 269
      miniupnpc.spec

45
USAGE

@ -0,0 +1,45 @@
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

16
miniupnpc-version.patch

@ -0,0 +1,16 @@
--- 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()

269
miniupnpc.spec

@ -1,182 +1,169 @@
# Needed for RHEL/CentOS 8 %global basepy3dir %(echo ../`basename %{py3dir}`)
%undefine __cmake_in_source_build %global major 17
%filter_provides_in %{python_sitearch}/.*\.so$
# Set a common one for all architectures and not _target_platform, fixes aarch64
%global __cmake_builddir build Summary: Library and tool to control NAT in UPnP-enabled routers
Name: miniupnpc
%filter_provides_in %{python3_sitearch}/.*\.so$ Version: 2.1
Release: 1%{?dist}
Summary: Library and tool to control NAT in UPnP-enabled routers License: BSD
Name: miniupnpc Group: System Environment/Libraries
Version: 2.2.5 URL: http://miniupnp.free.fr/
Release: 3%{?dist} Source: https://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz
License: BSD BuildRequires: cmake
URL: http://miniupnp.free.fr/ BuildRequires: python3-devel
# Do not create libminiupnpc.so.%%{version} and libminiupnpc.so.%%{major} linking to it
BuildRequires: cmake >= 3.5.0 Patch0: %{name}-version.patch
BuildRequires: gcc Source1: USAGE
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Source0: https://miniupnp.tuxfamily.org/files/%{name}-%{version}.tar.gz
%description %description
miniupnpc is an implementation of a UPnP client library, enabling applications miniupnpc is an implementation of a UPnP client library, enabling
to access the services provided by an UPnP "Internet Gateway Device" present on applications to access the services provided by an UPnP "Internet
the network. In UPnP terminology, it is a UPnP Control Point. 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. This package includes upnpc, a UPnP client application for configuring
port forwarding in UPnP enabled routers.
%package devel
Summary: Development files for %{name} %package devel
Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Development files for miniupnpc
Group: Development/Libraries
%description devel Requires: %{name}%{?_isa} = %{version}-%{release}
This package contains the header files and development documentation for
%{name}. %description devel
This package contains the header files and development documentation
%package -n python3-%{name} for %{name}.
Summary: Python3 interface to %{name}
%package -n python3-%{name}
%description -n python3-%{name} Summary: Python3 interface to %{name}
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: python3-devel
%description -n python3-%{name}
This package contains python3 interfaces to %{name}. This package contains python3 interfaces to %{name}.
%prep %prep
%autosetup -p2 %setup -q
%patch0 -p0
cp %{SOURCE1} .
# Use already built shared object for Python module sed -i "s|\(\tMAKE=\$(MAKE) python3 setup.py install\)$|\1 --root=\$(DESTDIR)/|" Makefile
# Unversioned link is not enough to avoid a rebuild
sed -i -e 's|build/libminiupnpc.a|build/libminiupnpc.so.%{version}|g' setup.py
%build %build
%cmake \ mkdir -p build
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \ pushd build
-DCMAKE_SKIP_RPATH:BOOL=YES \ %cmake \
-DNO_GETADDRINFO=FALSE \ -DUPNPC_BUILD_STATIC=OFF \
-DUPNPC_BUILD_SAMPLE=TRUE \ -DUPNPC_BUILD_TESTS=ON \
-DUPNPC_BUILD_SHARED=TRUE \ ..
-DUPNPC_BUILD_STATIC=FALSE \ make upnpc-shared all
-DUPNPC_BUILD_TESTS=TRUE \ popd
-DUPNPC_NO_INSTALL=FALSE make pythonmodule3
make upnpc-shared
%cmake_build
%py3_build
%install %install
%cmake_install make install DESTDIR=$RPM_BUILD_ROOT -C build
%py3_install make DESTDIR=$RPM_BUILD_ROOT installpythonmodule3
install -D -m644 man3/miniupnpc.3 $RPM_BUILD_ROOT/%{_mandir}/man3/miniupnpc.3
mv %{buildroot}%{_bindir}/upnpc-shared %{buildroot}%{_bindir}/upnpc install -D -m 0755 upnpc-shared $RPM_BUILD_ROOT%{_bindir}/upnpc
mv %{buildroot}%{_bindir}/listdevices %{buildroot}%{_bindir}/upnp-listdevices
rm -f %{buildroot}%{_bindir}/external-ip.sh
%check %check
make CFLAGS="%{optflags} -DMINIUPNPC_SET_SOCKET_TIMEOUT" check make CFLAGS="%{optflags} -DMINIUPNPC_SET_SOCKET_TIMEOUT" check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files %files
%license LICENSE %doc Changelog.txt
%doc Changelog.txt README %doc LICENSE
%doc README
%{_libdir}/libminiupnpc.so.%{major}
%{_bindir}/upnpc %{_bindir}/upnpc
%{_bindir}/upnp-listdevices %doc USAGE
%{_libdir}/libminiupnpc.so.17
%{_libdir}/libminiupnpc.so.%{version} %files devel
%{_includedir}/miniupnpc
%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 %{_libdir}/libminiupnpc.so
%{_libdir}/pkgconfig/%{name}.pc %{_mandir}/man3/miniupnpc.3*
%{_mandir}/man3/%{name}.3*
%files -n python3-%{name} %files -n python3-%{name}
%{python3_sitearch}/miniupnpc-%{version}-py3.*.egg-info/ %{python3_sitearch}/miniupnpc-%{version}-py?.?.egg-info
%{python3_sitearch}/miniupnpc*.so %{python3_sitearch}/miniupnpc*.so
%changelog %changelog
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.5-3 * Tue Oct 22 2019 r4sas <r4sas@i2pmail.org> - 2.1-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - update to 2.1, remove python2 build rules
* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 2.2.5-2
- Rebuilt for Python 3.12
* Wed Jun 14 2023 Simone Caronni <negativo17@gmail.com> - 2.2.5-1
- Update to 2.2.5.
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.2.4-4
- Rebuilt for Python 3.12
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Fri Oct 28 2022 Simone Caronni <negativo17@gmail.com> - 2.2.4-2
- Restore test client binary.
* Tue Oct 25 2022 Simone Caronni <negativo17@gmail.com> - 2.2.4-1 * Wed Jun 08 2016 François Kooman <fkooman@tuxed.net> - 2.0-1
- Update to 2.2.4. - update to 2.0
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.3-4 * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.9-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.2.3-3 * Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-7
- Rebuilt for Python 3.11 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Sat Jan 29 2022 Simone Caronni <negativo17@gmail.com> - 2.2.3-2 * Sat Oct 31 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.9-6
- Build fixes. - Correct buffer overflow in XML parsing (#1270842, #1270182)
* Fri Jan 28 2022 Simone Caronni <negativo17@gmail.com> - 2.2.3-1 * Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-5
- Update to 2.2.3. - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
- 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.
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2-4 * Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.2-3 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.2.2-2 * Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 1.9-2
- Rebuilt for Python 3.10 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Wed Mar 03 2021 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 2.2.2-1 * Wed Apr 16 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.9-1
- Update to version 2.2.2 - Update to latest upstream release (#1062206)
- Correct possible DoS crash vector (patch already in tarball) (#1085618)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-2 * Tue Aug 13 2013 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Update to latest upstream release (#996357)
- Build extra python3 module
* Fri Nov 13 2020 Kalev Lember <klember@redhat.com> - 2.2.0-1 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-10
- Update to 2.2.0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-7 * Tue Mar 05 2013 Domingo Becker <domingobecker@gmail.com> - 1.6-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Added upnpc, a client side tool, to the main package.
- Added USAGE file with instructions on how to use upnpc.
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.1-6 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-8
- Rebuilt for Python 3.9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-5 * Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1-4 * Wed May 30 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-6
- Subpackage python2-miniupnpc has been removed - Add Changelog.txt to documentation.
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal - Correct package version in setup.py.
- Correct rpmlint warning on source rpm.
- Filter provides of private python shared object (817311#c19).
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1-3 * Sat May 26 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-5
- Rebuilt for Python 3.8 - Build python module (817311#c14).
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-2 * Mon May 21 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - Use %%name for source and patch names.
- Enable %%check.
* Wed Feb 06 2019 Kalev Lember <klember@redhat.com> - 2.1-1 * Mon May 7 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-3
- Update to 2.1 - 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 <klember@redhat.com> - 2.0-13 * Wed May 2 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-2
- Fix FTBFS (#1604853) - 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.
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-12 * Sat Apr 28 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Initial libminiupnpc spec.

Loading…
Cancel
Save