--- urlscan.SlackBuild 2019-11-11 21:44:15.894051000 +0100 +++ urlscan.SlackBuild.Slint 2018-12-16 23:10:29.754084000 +0100 @@ -1,91 +1,94 @@ #!/bin/sh - +# # Slackware build script for urlscan -# Copyright 2019 abooksigun -# All rights reserved. # -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: +# Copyright 2016-2018 Corrado Franco (http://conraid.net) +# All rights reserved. # -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# This program 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 +# (at your option) any later version, with the following exception: +# the text of the GPL license may be omitted. + +# This program 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. Compiling, +# interpreting, executing or merely reading the text of the program +# may result in lapses of consciousness and/or very being, up to and +# including the end of all existence and the Universe as we know it. +# See the GNU General Public License for more details. + +# You may have received a copy of the GNU General Public License along +# with this program (most likely, a file named COPYING). If not, see +# . # -# 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. +# Latest version of this SlackBuild at https://github.com/conraid/SlackBuilds + +# Modified by Didier Spaier for Slint +# DOWNLOAD: https://github.com/firecat53/urlscan/archive/0.8.6.tar.gz + +# Note to self: there are newer version, but requirin a newer version of +# urwid (currently 1.0.3) + + +set -eu + +CWD=$(pwd) + +PKGNAM=urlscan +VERSION=0.8.6 -PRGNAM=urlscan -VERSION=${VERSION:-0.9.4} BUILD=${BUILD:-1} -TAG=${TAG:-_SBo} +TAG=${TAG:-slint} +TMP=$CWD +PKG=$TMP/package-$PKGNAM +OUTPUT=$CWD -if [ -z "$ARCH" ]; then +DOCFILES="COPYING README" + +if [ -z ${ARCH:=""} ]; then case "$( uname -m )" in - i?86) ARCH=i586 ;; - arm*) ARCH=arm ;; - *) ARCH=$( uname -m ) ;; + i?86) ARCH=i686 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; esac fi - -CWD=$(pwd) -TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM -OUTPUT=${OUTPUT:-/tmp} - -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 +[ "$ARCH" = "x86_64" ] && LIBDIRSUFFIX="64" || LIBDIRSUFFIX="" rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -cd $PRGNAM-$VERSION +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz +cd $PKGNAM-$VERSION + + + chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +chmod -R u+w,go+r-w,a+X-s . -python3 setup.py install --root=$PKG --optimize=1 +# Fix man path +sed -e 's|share/man/|man/|' -e "s|share/doc/urlscan|doc/urlscan-$VERSION|" -i setup.py -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 -cp -r $PKG/usr/share/man $PKG/usr -rm -r $PKG/usr/share +python setup.py install --root=$PKG -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true +find $PKG | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip -g 2> /dev/null || true + +if [ -d $PKG/usr/man ]; then + find $PKG/usr/man -type f -exec chmod 644 {} \; -exec gzip -9 {} \; + for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +fi -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -t $PKG/usr/doc/$PRGNAM-$VERSION README.rst COPYING requirements.txt -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION +cat $CWD/$PKGNAM.SlackBuild > $PKG/usr/doc/$PKGNAM-$VERSION/$PKGNAM.SlackBuild +pandoc README.rst -o $PKG/usr/doc/$PKGNAM-$VERSION/README.html -mkdir -p $PKG/install +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/$PKGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}