aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2022-02-19 20:49:39 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-02-20 15:13:28 +0700
commitac6f4b0290fbedd795ebf8b2c9ee82bcb4e5544b (patch)
treea63158053b4dec993487e5a58637a2acc4643203
parentef8eaae3e872f493228868fc687bc277beb99ff3 (diff)
libraries/miniupnpc: Updated for version 2.2.3.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--libraries/miniupnpc/miniupnpc-cmake.patch66
-rw-r--r--libraries/miniupnpc/miniupnpc.SlackBuild36
-rw-r--r--libraries/miniupnpc/miniupnpc.info6
3 files changed, 95 insertions, 13 deletions
diff --git a/libraries/miniupnpc/miniupnpc-cmake.patch b/libraries/miniupnpc/miniupnpc-cmake.patch
new file mode 100644
index 000000000000..2000af165ac0
--- /dev/null
+++ b/libraries/miniupnpc/miniupnpc-cmake.patch
@@ -0,0 +1,66 @@
+diff -Naur miniupnpc-2.2.3.old/CMakeLists.txt miniupnpc-2.2.3/CMakeLists.txt
+--- miniupnpc-2.2.3.old/CMakeLists.txt 2022-01-28 14:14:29.114014705 +0100
++++ miniupnpc-2.2.3/CMakeLists.txt 2022-01-28 14:19:49.875995027 +0100
+@@ -219,24 +219,30 @@
+ # set (UPNPC_INSTALL_TARGETS ${UPNPC_INSTALL_TARGETS} testminixml minixmlvalid testupnpreplyparse testigddescparse testminiwget)
+ endif ()
+
++configure_file(miniupnpc.pc.in miniupnpc.pc @ONLY)
++
+ if (NOT UPNPC_NO_INSTALL)
+ install (FILES
+- miniupnpc.h
+- miniwget.h
+- upnpcommands.h
+- igd_desc_parse.h
+- upnpreplyparse.h
+- upnperrors.h
+- upnpdev.h
+- miniupnpctypes.h
+- portlistingparse.h
+- miniupnpc_declspec.h
++ include/miniupnpc.h
++ include/miniwget.h
++ include/upnpcommands.h
++ include/igd_desc_parse.h
++ include/upnpreplyparse.h
++ include/upnperrors.h
++ include/upnpdev.h
++ include/miniupnpctypes.h
++ include/portlistingparse.h
++ include/miniupnpc_declspec.h
+ DESTINATION include/miniupnpc
+ )
+
+ install(FILES miniupnpc-config.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/miniupnpc
+ )
++
++ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/miniupnpc.pc
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
++ )
+ endif()
+
+ # vim: ts=2:sw=2:expandtab
+diff -Naur miniupnpc-2.2.3.old/miniupnpc.pc.in miniupnpc-2.2.3/miniupnpc.pc.in
+--- miniupnpc-2.2.3.old/miniupnpc.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ miniupnpc-2.2.3/miniupnpc.pc.in 2022-01-28 14:16:38.206423709 +0100
+@@ -0,0 +1,18 @@
++# this template is filled-in by CMake `configure_file(... @ONLY)`
++# the `@....@` are filled in by CMake configure_file(),
++# from variables set in your CMakeLists.txt or by CMake itself
++#
++# Good tutoral for understanding .pc files:
++# https://people.freedesktop.org/~dbn/pkg-config-guide.html
++
++prefix="@CMAKE_INSTALL_PREFIX@"
++exec_prefix="${prefix}"
++libdir="${prefix}/lib"
++includedir="${prefix}/include"
++
++Name: @PROJECT_NAME@
++Description: @CMAKE_PROJECT_DESCRIPTION@
++URL: @CMAKE_PROJECT_HOMEPAGE_URL@
++Version: @PROJECT_VERSION@
++Libs: -L"${libdir}" -lminiupnpc
++Cflags: -I"${includedir}"
diff --git a/libraries/miniupnpc/miniupnpc.SlackBuild b/libraries/miniupnpc/miniupnpc.SlackBuild
index 5b41b208b1d8..4d10ea3b80d4 100644
--- a/libraries/miniupnpc/miniupnpc.SlackBuild
+++ b/libraries/miniupnpc/miniupnpc.SlackBuild
@@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=miniupnpc
-VERSION=${VERSION:-2.1}
+VERSION=${VERSION:-2.2.3}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -81,30 +81,46 @@ find -L . \
# Slackware specific info.
patch -p1 < $CWD/slackware-version.patch
-sed -i 's|share/man|man|' Makefile
sed -i "s|lib${PRGNAM}\.a|lib${PRGNAM}\.so|" setup.py
-# Upstream Cmake causes build problems. We're going to use the makefile instead.
-CFLAGS="$SLKCFLAGS" LIBDIR="lib${LIBDIRSUFFIX}" make
-make install DESTDIR=$PKG LIBDIR="lib${LIBDIRSUFFIX}"
+# 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
+
+patch -p1 < $CWD/miniupnpc-cmake.patch
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DNO_GETADDRINFO=FALSE \
+ -DUPNPC_BUILD_SAMPLE=TRUE \
+ -DUPNPC_BUILD_SHARED=TRUE \
+ -DUPNPC_BUILD_STATIC=FALSE \
+ -DUPNPC_BUILD_TESTS=TRUE \
+ -DUPNPC_NO_INSTALL=FALSE ..
+ make
+ make install DESTDIR=$PKG
+cd ..
CFLAGS="$SLKCFLAGS" \
python setup.py install --root=$PKG
# For python 3.x support.
-if [ "${PYTHON3:-no}" == "yes" ]; then
+if [ "${PYTHON3:-yes}" == "yes" ]; then
CFLAGS="$SLKCFLAGS" \
python3 setup.py build
python3 setup.py install --root=$PKG
fi
-# Remove static library.
-rm -f $PKG/usr/lib${LIBDIRSUFFIX}/lib${PRGNAM}.a
-
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find $PKG/usr/man -type f -exec chmod 0644 '{}' \;
+mkdir -p $PKG/usr/man/man3
+gzip -c9 man3/miniupnpc.3 > $PKG/usr/man/man3/miniupnpc.3.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a Changelog.txt LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
diff --git a/libraries/miniupnpc/miniupnpc.info b/libraries/miniupnpc/miniupnpc.info
index 6078f474711f..787e380d0152 100644
--- a/libraries/miniupnpc/miniupnpc.info
+++ b/libraries/miniupnpc/miniupnpc.info
@@ -1,8 +1,8 @@
PRGNAM="miniupnpc"
-VERSION="2.1"
+VERSION="2.2.3"
HOMEPAGE="http://miniupnp.free.fr/"
-DOWNLOAD="http://miniupnp.free.fr/files/miniupnpc-2.1.tar.gz"
-MD5SUM="80143183f743d402459095711b1ce793"
+DOWNLOAD="http://miniupnp.free.fr/files/miniupnpc-2.2.3.tar.gz"
+MD5SUM="4a037c6f22861d58e037fcb0bdc5922e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""