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>
This commit is contained in:
Matteo Bernardini 2022-02-19 20:49:39 +01:00 committed by Willy Sudiarto Raharjo
parent ef8eaae3e8
commit ac6f4b0290
No known key found for this signature in database
GPG key ID: 3F617144D7238786
3 changed files with 95 additions and 13 deletions

View file

@ -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}"

View file

@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd) cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=miniupnpc PRGNAM=miniupnpc
VERSION=${VERSION:-2.1} VERSION=${VERSION:-2.2.3}
BUILD=${BUILD:-1} BUILD=${BUILD:-1}
TAG=${TAG:-_SBo} TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz} PKGTYPE=${PKGTYPE:-tgz}
@ -81,30 +81,46 @@ find -L . \
# Slackware specific info. # Slackware specific info.
patch -p1 < $CWD/slackware-version.patch patch -p1 < $CWD/slackware-version.patch
sed -i 's|share/man|man|' Makefile
sed -i "s|lib${PRGNAM}\.a|lib${PRGNAM}\.so|" setup.py sed -i "s|lib${PRGNAM}\.a|lib${PRGNAM}\.so|" setup.py
# Upstream Cmake causes build problems. We're going to use the makefile instead. # Use already built shared object for Python module
CFLAGS="$SLKCFLAGS" LIBDIR="lib${LIBDIRSUFFIX}" make # Unversioned link is not enough to avoid a rebuild
make install DESTDIR=$PKG LIBDIR="lib${LIBDIRSUFFIX}" 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" \ CFLAGS="$SLKCFLAGS" \
python setup.py install --root=$PKG python setup.py install --root=$PKG
# For python 3.x support. # For python 3.x support.
if [ "${PYTHON3:-no}" == "yes" ]; then if [ "${PYTHON3:-yes}" == "yes" ]; then
CFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \
python3 setup.py build python3 setup.py build
python3 setup.py install --root=$PKG python3 setup.py install --root=$PKG
fi 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 \ 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 | 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 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a Changelog.txt LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION cp -a Changelog.txt LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION

View file

@ -1,8 +1,8 @@
PRGNAM="miniupnpc" PRGNAM="miniupnpc"
VERSION="2.1" VERSION="2.2.3"
HOMEPAGE="http://miniupnp.free.fr/" HOMEPAGE="http://miniupnp.free.fr/"
DOWNLOAD="http://miniupnp.free.fr/files/miniupnpc-2.1.tar.gz" DOWNLOAD="http://miniupnp.free.fr/files/miniupnpc-2.2.3.tar.gz"
MD5SUM="80143183f743d402459095711b1ce793" MD5SUM="4a037c6f22861d58e037fcb0bdc5922e"
DOWNLOAD_x86_64="" DOWNLOAD_x86_64=""
MD5SUM_x86_64="" MD5SUM_x86_64=""
REQUIRES="" REQUIRES=""