diff options
Diffstat (limited to 'network/uwsgi/uwsgi.SlackBuild')
-rw-r--r-- | network/uwsgi/uwsgi.SlackBuild | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/network/uwsgi/uwsgi.SlackBuild b/network/uwsgi/uwsgi.SlackBuild index 1fb3e662f3..90795bf5ca 100644 --- a/network/uwsgi/uwsgi.SlackBuild +++ b/network/uwsgi/uwsgi.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for uwsgi @@ -22,10 +22,13 @@ # 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) + PRGNAM=uwsgi -VERSION=${VERSION:-2.0.15} +VERSION=${VERSION:-2.0.25.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,7 +38,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# 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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -49,17 +59,19 @@ elif [ "$ARCH" = "i686" ]; then elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi -# Build Python 2.x plugin. -PYTHON=${PYTHON:-yes} +# Python2 plugin. +PYTHON2=${PYTHON2:-yes} -# Set this to "yes" if you want to build a plugin for Python 3.x. Requires -# python3 to be installed. -PYTHON3=${PYTHON3:-no} +# Python3 plugin. +PYTHON3=${PYTHON3:-yes} # Perl PSGI plugin. PSGI=${PSGI:-yes} @@ -92,7 +104,7 @@ EOF # Build uWSGI core. CFLAGS="$SLKCFLAGS" \ -python uwsgiconfig.py --build package +python3 uwsgiconfig.py --build package install -D -m 0755 uwsgi $PKG/usr/bin/uwsgi # Create directory for plugins. @@ -105,17 +117,20 @@ sed -i "s|= /usr|= $PKG/usr|" buildconf/package.ini PLUGINS="cache ping rpc corerouter fastrouter http ugreen signal syslog" # Decide which language plugins to build. -[ "$PYTHON" = "yes" ] && PLUGINS="$PLUGINS python" [ "$PSGI" = "yes" ] && PLUGINS="$PLUGINS psgi" [ "$RACK" = "yes" ] && PLUGINS="$PLUGINS rack" # Build plugins. for PLUGIN in $PLUGINS ; do CFLAGS="$SLKCFLAGS" \ - python uwsgiconfig.py --plugin plugins/$PLUGIN package + python3 uwsgiconfig.py --plugin plugins/$PLUGIN package done - -# Use python3 to build plugin for it. +# Use python2 to build python2 plugin +if [ "$PYTHON2" = "yes" ]; then + CFLAGS="$SLKCFLAGS" \ + python2 uwsgiconfig.py --plugin plugins/python package python +fi +# Use python3 to build python3 plugin if [ "$PYTHON3" = "yes" ]; then CFLAGS="$SLKCFLAGS" \ python3 uwsgiconfig.py --plugin plugins/python package python3 @@ -123,7 +138,7 @@ fi # Create a few symlinks for automatic plugin loading. ( cd $PKG/usr/bin - [ "$PYTHON" = "yes" ] && ln -sf uwsgi uwsgi_python || true + [ "$PYTHON2" = "yes" ] && ln -sf uwsgi uwsgi_python || true [ "$PYTHON3" = "yes" ] && ln -sf uwsgi uwsgi_python3 || true [ "$PSGI" = "yes" ] && ln -sf uwsgi uwsgi_psgi || true [ "$RACK" = "yes" ] && ln -sf uwsgi uwsgi_rack || true @@ -140,4 +155,4 @@ mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |