diff options
Diffstat (limited to 'system/unhide/unhide.SlackBuild')
-rw-r--r-- | system/unhide/unhide.SlackBuild | 119 |
1 files changed, 67 insertions, 52 deletions
diff --git a/system/unhide/unhide.SlackBuild b/system/unhide/unhide.SlackBuild index 703ba56020..25e1372c6f 100644 --- a/system/unhide/unhide.SlackBuild +++ b/system/unhide/unhide.SlackBuild @@ -1,27 +1,26 @@ #!/bin/bash -# SlackBuild script for Unhide. +# SlackBuild script for unhide. -# This script is of public domain. It can be distributed, modified and used as desired. -# Based on the PorteusBuild written by the same author at www.porteus.org/forum +# Original author: Rubén Llorente <email removed> +# Updated and maintained by B. Watson <urchlay@slackware.uk> -# Rubén Llorente <porting@use.startmail.com> +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# 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. +# 20230804 bkw: +# - take over maintenance. +# - relicense as WTFPL with permission from Rubén (via mailing list). +# - update for v20220611. +# - add GUI (unhideGui.py), .desktop file, doinst.sh. +# - minor fixes for man pages. +# - symlink man pages, unhide => unhide-linux, to match the binary. +# - add NEWS to doc dir. cd $(dirname $0) ; CWD=$(pwd) PRGNAM=unhide -VERSION=${VERSION:-20121229} +SRCNAM=Unhide +VERSION=${VERSION:-20220611} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -34,9 +33,6 @@ if [ -z "$ARCH" ]; then 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 "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -48,16 +44,12 @@ 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 @@ -65,40 +57,63 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tgz -cd $PRGNAM-$VERSION +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.gz +cd $SRCNAM-$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 {} \; - -# gcc --static unhide.c -o unhide #### This is an obsolete version. -gcc $SLKCFLAGS -Wall --static -pthread unhide-linux*.c unhide-output.c -o unhide-linux -gcc $SLKCFLAGS -Wall --static unhide_rb.c -o unhide_rb -gcc $SLKCFLAGS -Wall --static unhide-tcp.c unhide-tcp-fast.c unhide-output.c -o unhide-tcp -ln -s unhide-linux unhide - -# We put the binaries and documents in their right places -mkdir -p $PKG/usr/sbin -install -m 0700 unhide-tcp unhide-linux unhide unhide_rb $PKG/usr/sbin - -# Copy man pages -mkdir -p $PKG/usr/man/{,es/,fr/}man8 -cp man/unhide{,-tcp}.8 $PKG/usr/man/man8 -cp man/es/unhide.8 $PKG/usr/man/es/man8 -cp man/fr/unhide.8 $PKG/usr/man/fr/man8 -find $PKG/usr/man -type f -exec gzip -9 {} \; - -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp COPYING LEEME.txt LISEZ-MOI.TXT README.txt TODO changelog $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# Fix the GUI. Patch by SlackBuild maintainer. +patch -p1 < $CWD/fixgui.diff + +# Fix typos and formatting errors in man pages, from Debian: +# https://packages.debian.org/sid/unhide +patch -p1 < $CWD/fix-man.diff + +# No Makefile or anything, commands come from README.txt: +GCC="gcc $SLKCFLAGS -Wall --static" +$GCC -pthread unhide-linux*.c unhide-output.c -o unhide-linux +$GCC unhide_rb.c -o unhide_rb +$GCC unhide-tcp.c unhide-tcp-fast.c unhide-output.c -o unhide-tcp + +SBIN=$PKG/usr/sbin +mkdir -p $SBIN +install -s -m 0755 unhide-tcp unhide-linux unhide_rb $SBIN +ln -s unhide-linux $SBIN/unhide + +for i in "" es fr; do + dir=$PKG/usr/man/$i/man8 + mkdir -p $dir + for j in unhide unhide-tcp; do + gzip -9 < man/$i/$j.8 > $dir/$j.8.gz + done + ln -s unhide.8.gz $dir/unhide-linux.8.gz +done + +# 20230803 bkw: the GUI isn't well-documented, but seems to work, at +# least after a bit of patching. +mkdir -p $PKG/usr/bin +install -m0755 unhideGui.py $PKG/usr/bin +PYDIR=$PKG/usr/share/$PRGNAM +mkdir -p $PYDIR +cp -a ToolTip.py $PYDIR + +# 20230804 bkw: wrote a .desktop file for the GUI. Couldn't think of +# an idea for an icon, so I just used the magnifying glass icon +# from WindowMaker. +mkdir -p $PKG/usr/share/applications +cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp COPYING LEEME.txt LISEZ-MOI.TXT README.txt NEWS TODO changelog $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild +cat $CWD/README > $PKGDOC/README mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE |