--- fvwm.SlackBuild 2018-11-28 21:34:17.066290029 +0100 +++ /home/didier/fvwm/fvwm.SlackBuild 2018-11-28 20:51:05.107118028 +0100 @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -# Copyright 2011, 2012, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2011, 2012, 2015, 2016, 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -20,12 +20,12 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Adapted for Slint - Didier Spaier - +cd $(dirname $0) ; CWD=$(pwd) PKGNAM=fvwm VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1slint} +BUILD=${BUILD:-2} + # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -36,6 +36,14 @@ 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 + NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} if [ "$ARCH" = "i586" ]; then @@ -52,8 +60,7 @@ LIBDIRSUFFIX="" fi -CWD=$(pwd) -TMP=${TMP:-$PWD} +TMP=${TMP:-/tmp} PKG=$TMP/package-$PKGNAM rm -rf $PKG @@ -61,7 +68,7 @@ cd $TMP rm -rf $PKGNAM-$VERSION -tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1 +tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1 cd $PKGNAM-$VERSION || exit 1 chown -R root:root . find . \ @@ -70,8 +77,6 @@ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -autoreconf -vif - CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ @@ -87,18 +92,21 @@ make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 -# Add some ancient icons . The fvwm95 sample config still uses these. +# Add some ancient icons. The fvwm95 sample config still uses these. ( cd $PKG ; tar xzf $CWD/ancient-icons.tar.gz ) # This script is called from the xinitrc: -mkdir -p $PKG/usr/bin -cp $CWD/startfvwm2 $PKG/usr/bin +zcat $CWD/startfvwm2.gz > $PKG/usr/bin/startfvwm2 chmod 755 $PKG/usr/bin/startfvwm2 +# This stuff appears to be misplaced junk: +rm -rf $PKG/usr/share/doc + # Add a few more things: mkdir -p $PKG/etc/X11/xinit -cp $CWD/xinitrc.fvwm2 $PKG/etc/X11/xinit +zcat $CWD/xinitrc.fvwm2.gz > $PKG/etc/X11/xinit/xinitrc.fvwm2 chmod 755 $PKG/etc/X11/xinit/xinitrc.fvwm2 +#zcat $CWD/system.fvwm2rc.gz > $PKG/etc/system.fvwm2rc.new find $PKG | xargs file | grep -e "executable" -e "shared object" \ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null @@ -118,15 +126,16 @@ ) fi - # Install some documentation: mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION -cp -a COPYING* NEWS $PKG/usr/doc/$PKGNAM-$VERSION +cp -a \ + COPYING* NEWS \ + $PKG/usr/doc/$PKGNAM-$VERSION # Move the html doc into place, as the htmldir configure option is not -# honored (will be in version 2.6.9). Some code cleaning is done to -# avoid dead links and provide current useful documentation. -# Acces to all the documentation is provided through +# honored (will be in version 2.6.9). Some edit is done in the source +# files to avoid dead links and provide current useful documentation. +# Acces to all the documentation is provided through this command: # /usr/doc/$PKGNAM-$VERSION/index.html mv $PKG/usr/share/doc/fvwm/* $PKG/usr/doc/$PKGNAM-$VERSION rm -r $PKG/usr/share/doc @@ -139,6 +148,7 @@ rm -f *.html fvwm/*.html cp -a $CWD/htmlpages/* . ) + # If there's a ChangeLog, installing at least part of the recent history # is useful, but don't let it get totally out of control: if [ -r ChangeLog ]; then