#!/bin/bash # # libupnp.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # libupnp.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="libupnp" PACKAGE_EXT="gz" VERSION=${VERSION:="1.14.19"} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc elif [ -f ../../source/runtime/slackbuildrc ]; then . ../../source/runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/pupnp/pupnp/archive/refs/tags/release-$VERSION.tar.$PACKAGE_EXT" get_source $SRC $URL unpack_source $SRC pupnp-release-$VERSION # upstream derives project/pkgconfig version from autotools macros and this is broken: # https://github.com/pupnp/pupnp/issues/442 # https://gitlab.archlinux.org/archlinux/packaging/packages/libupnp/-/issues/1 sed "s/\${PUPNP_VERSION_STRING}/$VERSION/g" -i CMakeLists.txt cmake \ -B build \ -D CMAKE_BUILD_TYPE=None \ -D CMAKE_INSTALL_PREFIX=/usr \ -D UPNP_BUILD_STATIC=OFF \ -D blocking_tcp_connections=OFF \ -D reuseaddr=ON \ -W no-dev cmake --build build DESTDIR="$PKG" cmake --install build mkdir -p $DOCS cp -a COPYING ChangeLog README.md THANKS $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi