diff options
Diffstat (limited to 'python/PyPDF2/PyPDF2.SlackBuild')
-rw-r--r-- | python/PyPDF2/PyPDF2.SlackBuild | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/python/PyPDF2/PyPDF2.SlackBuild b/python/PyPDF2/PyPDF2.SlackBuild index 810500e285..e7fd2ff9c7 100644 --- a/python/PyPDF2/PyPDF2.SlackBuild +++ b/python/PyPDF2/PyPDF2.SlackBuild @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for PyPDF2. # Copyright 2009-2011 Marco Bonetti <sid77@slackware.it> # Copyright 2015-2017 Brenton Earl <brent@exitstatusone.com> +# Copyright 2023 Vijay Marcel # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,10 +24,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=PyPDF2 VERSION=${VERSION:-1.26.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,7 +40,11 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +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} @@ -44,28 +52,15 @@ OUTPUT=${OUTPUT:-/tmp} DOCS="CHANGELOG LICENSE README.md" SAMPLES="Scripts/ Sample_Code/ Resources/" -if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" -elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" -fi - set -e -rm -rf $PKG -mkdir -p $TMP $PKG $OUTPUT +rm -rvf $PKG +mkdir -pv $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION +rm -rvf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION + chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -73,7 +68,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -python setup.py install --root=$PKG +python2 setup.py install --prefix=/usr --root=$PKG --optimize=1 +python3 setup.py install --prefix=/usr --root=$PKG --optimize=1 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 @@ -81,9 +77,10 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -ar $DOCS $SAMPLES $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 0644 {} \+ 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 |