diff options
Diffstat (limited to 'source')
26 files changed, 1181 insertions, 4 deletions
diff --git a/source/l/python-build/python-build.SlackBuild b/source/l/python-build/python-build.SlackBuild new file mode 100755 index 000000000..22ad3f322 --- /dev/null +++ b/source/l/python-build/python-build.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-build +VERSION=${VERSION:-$(echo build-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf build-$VERSION +tar xvf $CWD/build-$VERSION.tar.?z || exit 1 +cd build-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 -m flit_core.wheel || exit 1 + +python3 -m installer --destdir "$PKG" dist/*.whl || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst LICENSE PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-build/python-build.url b/source/l/python-build/python-build.url new file mode 100644 index 000000000..10aa7b80c --- /dev/null +++ b/source/l/python-build/python-build.url @@ -0,0 +1 @@ +https://pypi.org/project/build/#files diff --git a/source/l/python-build/slack-desc b/source/l/python-build/slack-desc new file mode 100644 index 000000000..bf841404e --- /dev/null +++ b/source/l/python-build/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-build: python-build (A simple, correct PEP 517 package builder) +python-build: +python-build: build will invoke the PEP 517 hooks to build a distribution package. +python-build: It is a simple build tool and does not perform any dependency +python-build: management. +python-build: +python-build: +python-build: +python-build: +python-build: +python-build: diff --git a/source/l/python-flit-core/python-flit-core.SlackBuild b/source/l/python-flit-core/python-flit-core.SlackBuild new file mode 100755 index 000000000..5b3745280 --- /dev/null +++ b/source/l/python-flit-core/python-flit-core.SlackBuild @@ -0,0 +1,100 @@ +#!/bin/bash + +# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-flit-core +VERSION=${VERSION:-$(echo flit_core-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf flit_core-$VERSION +tar xvf $CWD/flit_core-$VERSION.tar.?z || exit 1 +cd flit_core-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +# directory for python packages +PYTHONDIR=$(python3 -c "import sys, os; print(os.path.join('/usr/lib${LIBDIRSUFFIX}', 'python%s' % sys.version[:3], 'site-packages'))") + +mkdir -p ${PKG}${PYTHONDIR} + +unshare -n python3 -m flit_core.wheel || exit 1 + +python3 bootstrap_install.py --installdir ${PKG}${PYTHONDIR} dist/flit_core-*.whl + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst LICENCE PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-flit-core/python-flit-core.url b/source/l/python-flit-core/python-flit-core.url new file mode 100644 index 000000000..ab668377e --- /dev/null +++ b/source/l/python-flit-core/python-flit-core.url @@ -0,0 +1 @@ +https://pypi.org/project/flit_core/#files diff --git a/source/l/python-flit-core/slack-desc b/source/l/python-flit-core/slack-desc new file mode 100644 index 000000000..41be368b8 --- /dev/null +++ b/source/l/python-flit-core/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-flit-core: python-flit-core (Python build system) +python-flit-core: +python-flit-core: Flit is a simple way to put Python packages and modules on PyPI. It +python-flit-core: tries to require less thought about packaging and help you avoid +python-flit-core: common mistakes. +python-flit-core: +python-flit-core: Homepage: https://github.com/pypa/flit +python-flit-core: +python-flit-core: +python-flit-core: +python-flit-core: diff --git a/source/l/python-glad2/python-glad2.SlackBuild b/source/l/python-glad2/python-glad2.SlackBuild new file mode 100755 index 000000000..5a5916f82 --- /dev/null +++ b/source/l/python-glad2/python-glad2.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-glad2 +VERSION=${VERSION:-$(echo glad2-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf glad2-$VERSION +tar xvf $CWD/glad2-$VERSION.tar.?z || exit 1 +cd glad2-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 -m build --wheel --no-isolation || exit 1 + +python3 -m installer --destdir "$PKG" dist/*.whl || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst COPYING PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-glad2/python-glad2.url b/source/l/python-glad2/python-glad2.url new file mode 100644 index 000000000..aff83771e --- /dev/null +++ b/source/l/python-glad2/python-glad2.url @@ -0,0 +1 @@ +https://pypi.org/project/glad2/#files diff --git a/source/l/python-glad2/slack-desc b/source/l/python-glad2/slack-desc new file mode 100644 index 000000000..ebd7eacbd --- /dev/null +++ b/source/l/python-glad2/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-glad2: python-glad2 (Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator) +python-glad2: +python-glad2: Glad uses the official Khronos-XML specs to generate a +python-glad2: GL/GLES/EGL/GLX/WGL Loader made for your needs. +python-glad2: +python-glad2: +python-glad2: +python-glad2: +python-glad2: +python-glad2: +python-glad2: diff --git a/source/l/python-installer/python-installer.SlackBuild b/source/l/python-installer/python-installer.SlackBuild new file mode 100755 index 000000000..bda92b177 --- /dev/null +++ b/source/l/python-installer/python-installer.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright 2022-2023 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-installer +VERSION=${VERSION:-$(echo installer-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf installer-$VERSION +tar xvf $CWD/installer-$VERSION.tar.?z || exit 1 +cd installer-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 -m flit_core.wheel || exit 1 + +PYTHONPATH=src python3 -m installer --destdir "$PKG" dist/*.whl || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst LICENSE PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-installer/python-installer.url b/source/l/python-installer/python-installer.url new file mode 100644 index 000000000..3de6e6142 --- /dev/null +++ b/source/l/python-installer/python-installer.url @@ -0,0 +1 @@ +https://pypi.org/project/installer/#files diff --git a/source/l/python-installer/slack-desc b/source/l/python-installer/slack-desc new file mode 100644 index 000000000..79e1265b2 --- /dev/null +++ b/source/l/python-installer/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-installer: python-installer (Library for installing Python packages from wheels) +python-installer: +python-installer: This is a low-level library for installing a Python package from a +python-installer: wheel distribution. It provides basic functionality and abstractions +python-installer: for handling wheels and installing packages from wheels. +python-installer: +python-installer: +python-installer: +python-installer: +python-installer: +python-installer: diff --git a/source/l/python-lxml/python-lxml.SlackBuild b/source/l/python-lxml/python-lxml.SlackBuild new file mode 100755 index 000000000..609749652 --- /dev/null +++ b/source/l/python-lxml/python-lxml.SlackBuild @@ -0,0 +1,93 @@ +#!/bin/bash + +# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-lxml +VERSION=${VERSION:-$(echo lxml-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf lxml-$VERSION +tar xvf $CWD/lxml-$VERSION.tar.?z || exit 1 +cd lxml-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 setup.py install --root=$PKG || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst *.txt PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-lxml/python-lxml.url b/source/l/python-lxml/python-lxml.url new file mode 100644 index 000000000..53a1ff736 --- /dev/null +++ b/source/l/python-lxml/python-lxml.url @@ -0,0 +1 @@ +https://pypi.org/project/lxml/#files diff --git a/source/l/python-lxml/slack-desc b/source/l/python-lxml/slack-desc new file mode 100644 index 000000000..f310b9b45 --- /dev/null +++ b/source/l/python-lxml/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-lxml: python-lxml (Python bindings for libxml2/libxslt) +python-lxml: +python-lxml: lxml is a Pythonic, mature binding for the libxml2 and libxslt +python-lxml: libraries. It provides safe and convenient access to these libraries +python-lxml: using the ElementTree API. +python-lxml: +python-lxml: It extends the ElementTree API significantly to offer support for +python-lxml: XPath, RelaxNG, XML Schema, XSLT, C14N and much more. +python-lxml: +python-lxml: +python-lxml: diff --git a/source/l/python-pyproject-hooks/python-pyproject-hooks.SlackBuild b/source/l/python-pyproject-hooks/python-pyproject-hooks.SlackBuild new file mode 100755 index 000000000..fd0b7cdf6 --- /dev/null +++ b/source/l/python-pyproject-hooks/python-pyproject-hooks.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright 2023 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-pyproject-hooks +VERSION=${VERSION:-$(echo pyproject_hooks-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf pyproject_hooks-$VERSION +tar xvf $CWD/pyproject_hooks-$VERSION.tar.?z || exit 1 +cd pyproject_hooks-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 -m flit_core.wheel || exit 1 + +python3 -m installer --destdir "$PKG" dist/*.whl || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst LICENSE PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-pyproject-hooks/python-pyproject-hooks.url b/source/l/python-pyproject-hooks/python-pyproject-hooks.url new file mode 100644 index 000000000..3282a85ac --- /dev/null +++ b/source/l/python-pyproject-hooks/python-pyproject-hooks.url @@ -0,0 +1 @@ +https://pypi.org/project/pyproject_hooks/#files diff --git a/source/l/python-pyproject-hooks/slack-desc b/source/l/python-pyproject-hooks/slack-desc new file mode 100644 index 000000000..932fc3edb --- /dev/null +++ b/source/l/python-pyproject-hooks/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-pyproject-hooks: python-pyproject-hooks (Call pyproject.toml-based build backend hooks) +python-pyproject-hooks: +python-pyproject-hooks: This is a low-level library for calling build-backends in +python-pyproject-hooks: pyproject.toml-based project. It provides the basic functionality to +python-pyproject-hooks: help write tooling that generates distribution files from Python +python-pyproject-hooks: projects. +python-pyproject-hooks: +python-pyproject-hooks: +python-pyproject-hooks: +python-pyproject-hooks: +python-pyproject-hooks: diff --git a/source/l/python-tomli-w/python-tomli-w.SlackBuild b/source/l/python-tomli-w/python-tomli-w.SlackBuild new file mode 100755 index 000000000..43613e345 --- /dev/null +++ b/source/l/python-tomli-w/python-tomli-w.SlackBuild @@ -0,0 +1,95 @@ +#!/bin/bash + +# Copyright 2022 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-tomli-w +VERSION=${VERSION:-$(echo tomli_w-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf tomli_w-$VERSION +tar xvf $CWD/tomli_w-$VERSION.tar.?z || exit 1 +cd tomli_w-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +unshare -n python3 -m build --wheel --no-isolation || exit 1 + +python3 -m installer --destdir "$PKG" dist/*.whl || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst LICENSE PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-tomli-w/python-tomli-w.url b/source/l/python-tomli-w/python-tomli-w.url new file mode 100644 index 000000000..9100c98ed --- /dev/null +++ b/source/l/python-tomli-w/python-tomli-w.url @@ -0,0 +1 @@ +https://pypi.org/project/tomli-w/#files diff --git a/source/l/python-tomli-w/slack-desc b/source/l/python-tomli-w/slack-desc new file mode 100644 index 000000000..013e82767 --- /dev/null +++ b/source/l/python-tomli-w/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-tomli-w: python-tomli-w (Python library for writing TOML) +python-tomli-w: +python-tomli-w: Tomli-W is a Python library for writing TOML. It is a write-only +python-tomli-w: counterpart to Tomli, which is a read-only TOML parser. +python-tomli-w: +python-tomli-w: +python-tomli-w: +python-tomli-w: +python-tomli-w: +python-tomli-w: +python-tomli-w: diff --git a/source/l/python-wheel/python-wheel.SlackBuild b/source/l/python-wheel/python-wheel.SlackBuild new file mode 100755 index 000000000..0d1c1139c --- /dev/null +++ b/source/l/python-wheel/python-wheel.SlackBuild @@ -0,0 +1,93 @@ +#!/bin/bash + +# Copyright 2021-2023 Heinz Wiesinger, Amsterdam, The Netherlands +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=python-wheel +VERSION=${VERSION:-$(echo wheel-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i586 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + esac +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +if [ "${ARCH}" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf wheel-$VERSION +tar xvf $CWD/wheel-$VERSION.tar.?z || exit 1 +cd wheel-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +python3 setup.py install --root=$PKG || exit 1 + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + *.md *.rst *.txt PKG-INFO \ + $PKG/usr/doc/$PKGNAM-$VERSION + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz + diff --git a/source/l/python-wheel/python-wheel.url b/source/l/python-wheel/python-wheel.url new file mode 100644 index 000000000..259b81712 --- /dev/null +++ b/source/l/python-wheel/python-wheel.url @@ -0,0 +1 @@ +https://pypi.org/project/wheel/#files diff --git a/source/l/python-wheel/slack-desc b/source/l/python-wheel/slack-desc new file mode 100644 index 000000000..4a443da17 --- /dev/null +++ b/source/l/python-wheel/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' on +# the right side marks the last column you can put a character in. You must make +# exactly 11 lines for the formatting to be correct. It's also customary to +# leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +python-wheel: python-wheel (Python wheel packaging standard reference library) +python-wheel: +python-wheel: This library is the reference implementation of the Python wheel +python-wheel: packaging standard, as defined in PEP 427. +python-wheel: +python-wheel: +python-wheel: +python-wheel: +python-wheel: +python-wheel: +python-wheel: diff --git a/source/n/nftables/5f1676ac9f1aeb36d7695c3c354dade013a1e4f3.patch b/source/n/nftables/5f1676ac9f1aeb36d7695c3c354dade013a1e4f3.patch new file mode 100644 index 000000000..26eb9b2fc --- /dev/null +++ b/source/n/nftables/5f1676ac9f1aeb36d7695c3c354dade013a1e4f3.patch @@ -0,0 +1,248 @@ +From 5f1676ac9f1aeb36d7695c3c354dade013a1e4f3 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso <pablo@netfilter.org> +Date: Tue, 18 Jul 2023 23:10:01 +0200 +Subject: meta: stash context statement length when generating payload/meta + dependency + +... meta mark set ip dscp + +generates an implicit dependency from the inet family to match on meta +nfproto ip. + +The length of this implicit expression is incorrectly adjusted to the +statement length, ie. relational to compare meta nfproto takes 4 bytes +instead of 1 byte. The evaluation of 'ip dscp' under the meta mark +statement triggers this implicit dependency which should not consider +the context statement length since it is added before the statement +itself. + +This problem shows when listing the ruleset, since netlink_parse_cmp() +where left->len < right->len, hence handling the implicit dependency as +a concatenation, but it is actually a bug in the evaluation step that +leads to incorrect bytecode. + +Fixes: 3c64ea7995cb ("evaluate: honor statement length in integer evaluation") +Fixes: edecd58755a8 ("evaluate: support shifts larger than the width of the left operand") +Tested-by: Brian Davidson <davidson.brian@gmail.com> +Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> +--- + src/payload.c | 13 +++++++ + tests/py/inet/meta.t | 5 +++ + tests/py/inet/meta.t.json | 86 ++++++++++++++++++++++++++++++++++++++++++++ + tests/py/inet/meta.t.payload | 40 +++++++++++++++++++++ + 4 files changed, 144 insertions(+) + +diff --git a/src/payload.c b/src/payload.c +index f67b5407..7862745b 100644 +--- a/src/payload.c ++++ b/src/payload.c +@@ -409,6 +409,7 @@ static int payload_add_dependency(struct eval_ctx *ctx, + const struct proto_hdr_template *tmpl; + struct expr *dep, *left, *right; + struct proto_ctx *pctx; ++ unsigned int stmt_len; + struct stmt *stmt; + int protocol; + +@@ -429,11 +430,16 @@ static int payload_add_dependency(struct eval_ctx *ctx, + constant_data_ptr(protocol, tmpl->len)); + + dep = relational_expr_alloc(&expr->location, OP_EQ, left, right); ++ ++ stmt_len = ctx->stmt_len; ++ ctx->stmt_len = 0; ++ + stmt = expr_stmt_alloc(&dep->location, dep); + if (stmt_evaluate(ctx, stmt) < 0) { + return expr_error(ctx->msgs, expr, + "dependency statement is invalid"); + } ++ ctx->stmt_len = stmt_len; + + if (ctx->inner_desc) { + if (tmpl->meta_key) +@@ -543,6 +549,7 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr, + const struct hook_proto_desc *h; + const struct proto_desc *desc; + struct proto_ctx *pctx; ++ unsigned int stmt_len; + struct stmt *stmt; + uint16_t type; + +@@ -559,12 +566,18 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr, + "protocol specification is invalid " + "for this family"); + ++ stmt_len = ctx->stmt_len; ++ ctx->stmt_len = 0; ++ + stmt = meta_stmt_meta_iiftype(&expr->location, type); + if (stmt_evaluate(ctx, stmt) < 0) { + return expr_error(ctx->msgs, expr, + "dependency statement is invalid"); + } + *res = stmt; ++ ++ ctx->stmt_len = stmt_len; ++ + return 0; + } + +diff --git a/tests/py/inet/meta.t b/tests/py/inet/meta.t +index 374738a7..5c062b39 100644 +--- a/tests/py/inet/meta.t ++++ b/tests/py/inet/meta.t +@@ -25,3 +25,8 @@ meta mark set ct mark >> 8;ok + meta mark . tcp dport { 0x0000000a-0x00000014 . 80-90, 0x00100000-0x00100123 . 100-120 };ok + ip saddr . meta mark { 1.2.3.4 . 0x00000100 , 1.2.3.6-1.2.3.8 . 0x00000200-0x00000300 };ok + ip saddr . meta mark { 1.2.3.4 . 0x00000100 , 5.6.7.8 . 0x00000200 };ok ++ ++meta mark set ip dscp;ok ++meta mark set ip dscp | 0x40;ok ++meta mark set ip6 dscp;ok ++meta mark set ip6 dscp | 0x40;ok +diff --git a/tests/py/inet/meta.t.json b/tests/py/inet/meta.t.json +index 92a1f9bf..3ba0fd1d 100644 +--- a/tests/py/inet/meta.t.json ++++ b/tests/py/inet/meta.t.json +@@ -440,3 +440,89 @@ + } + ] + ++# meta mark set ip dscp ++[ ++ { ++ "mangle": { ++ "key": { ++ "meta": { ++ "key": "mark" ++ } ++ }, ++ "value": { ++ "payload": { ++ "field": "dscp", ++ "protocol": "ip" ++ } ++ } ++ } ++ } ++] ++ ++# meta mark set ip dscp | 0x40 ++[ ++ { ++ "mangle": { ++ "key": { ++ "meta": { ++ "key": "mark" ++ } ++ }, ++ "value": { ++ "|": [ ++ { ++ "payload": { ++ "field": "dscp", ++ "protocol": "ip" ++ } ++ }, ++ 64 ++ ] ++ } ++ } ++ } ++] ++ ++# meta mark set ip6 dscp ++[ ++ { ++ "mangle": { ++ "key": { ++ "meta": { ++ "key": "mark" ++ } ++ }, ++ "value": { ++ "payload": { ++ "field": "dscp", ++ "protocol": "ip6" ++ } ++ } ++ } ++ } ++] ++ ++# meta mark set ip6 dscp | 0x40 ++[ ++ { ++ "mangle": { ++ "key": { ++ "meta": { ++ "key": "mark" ++ } ++ }, ++ "value": { ++ "|": [ ++ { ++ "payload": { ++ "field": "dscp", ++ "protocol": "ip6" ++ } ++ }, ++ 64 ++ ] ++ } ++ } ++ } ++] ++ +diff --git a/tests/py/inet/meta.t.payload b/tests/py/inet/meta.t.payload +index ea540907..c53b5077 100644 +--- a/tests/py/inet/meta.t.payload ++++ b/tests/py/inet/meta.t.payload +@@ -133,3 +133,43 @@ inet test-inet input + [ meta load mark => reg 9 ] + [ lookup reg 1 set __set%d ] + ++# meta mark set ip dscp ++inet test-inet input ++ [ meta load nfproto => reg 1 ] ++ [ cmp eq reg 1 0x00000002 ] ++ [ payload load 1b @ network header + 1 => reg 1 ] ++ [ bitwise reg 1 = ( reg 1 & 0x000000fc ) ^ 0x00000000 ] ++ [ bitwise reg 1 = ( reg 1 >> 0x00000002 ) ] ++ [ meta set mark with reg 1 ] ++ ++# meta mark set ip dscp | 0x40 ++inet test-inet input ++ [ meta load nfproto => reg 1 ] ++ [ cmp eq reg 1 0x00000002 ] ++ [ payload load 1b @ network header + 1 => reg 1 ] ++ [ bitwise reg 1 = ( reg 1 & 0x000000fc ) ^ 0x00000000 ] ++ [ bitwise reg 1 = ( reg 1 >> 0x00000002 ) ] ++ [ bitwise reg 1 = ( reg 1 & 0xffffffbf ) ^ 0x00000040 ] ++ [ meta set mark with reg 1 ] ++ ++# meta mark set ip6 dscp ++inet test-inet input ++ [ meta load nfproto => reg 1 ] ++ [ cmp eq reg 1 0x0000000a ] ++ [ payload load 2b @ network header + 0 => reg 1 ] ++ [ bitwise reg 1 = ( reg 1 & 0x0000c00f ) ^ 0x00000000 ] ++ [ byteorder reg 1 = ntoh(reg 1, 2, 2) ] ++ [ bitwise reg 1 = ( reg 1 >> 0x00000006 ) ] ++ [ meta set mark with reg 1 ] ++ ++# meta mark set ip6 dscp | 0x40 ++inet test-inet input ++ [ meta load nfproto => reg 1 ] ++ [ cmp eq reg 1 0x0000000a ] ++ [ payload load 2b @ network header + 0 => reg 1 ] ++ [ bitwise reg 1 = ( reg 1 & 0x0000c00f ) ^ 0x00000000 ] ++ [ byteorder reg 1 = ntoh(reg 1, 2, 2) ] ++ [ bitwise reg 1 = ( reg 1 >> 0x00000006 ) ] ++ [ bitwise reg 1 = ( reg 1 & 0xffffffbf ) ^ 0x00000040 ] ++ [ meta set mark with reg 1 ] ++ +-- +cgit v1.2.3 + diff --git a/source/n/nftables/nftables.SlackBuild b/source/n/nftables/nftables.SlackBuild index d6bed8a4d..f7129abf8 100755 --- a/source/n/nftables/nftables.SlackBuild +++ b/source/n/nftables/nftables.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2014, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2014, 2018, 2023 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=nftables VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} @@ -78,6 +78,9 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ +# Upstream patch: +cat $CWD/5f1676ac9f1aeb36d7695c3c354dade013a1e4f3.patch | patch -p1 --verbose || exit 1 + CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ LIBS="-lncursesw" \ @@ -88,17 +91,22 @@ LIBS="-lncursesw" \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PKGNAM-$VERSION \ - --with-python-bin=python3 \ --with-xtables \ --disable-static \ + --disable-python \ --with-json \ - --enable-python \ --with-cli=readline \ --build=$ARCH-slackware-linux || exit 1 make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 +# Build python module: +( cd py + python3 -m build --wheel --no-isolation + python3 -m installer --destdir="$PKG" dist/*.whl +) + rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \ |