2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2013-11-22 08:34:22 +01:00
|
|
|
# Slackware build script for The Hessling Editor
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2024-04-12 15:50:28 +02:00
|
|
|
# Copyright 2012-2022 Richard Narron, California, USA
|
2016-08-25 11:17:39 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# 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.
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2012-08-13 21:53:45 +02:00
|
|
|
PRGNAM=THE
|
2024-04-12 15:50:28 +02:00
|
|
|
VERSION=${VERSION:-3.3}
|
2024-04-19 16:54:46 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2012-08-13 21:53:45 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2024-04-13 04:21:44 +02:00
|
|
|
TARFILE=the-${VERSION}
|
2022-04-16 03:32:31 +02:00
|
|
|
|
2012-08-13 21:53:45 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-25 11:17:39 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2012-08-13 21:53:45 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2012-08-13 21:53:45 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-25 11:17:39 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2012-08-13 21:53:45 +02:00
|
|
|
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
|
|
|
|
|
|
|
|
cd $TMP
|
2022-04-16 03:32:31 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION $TARFILE
|
|
|
|
tar xvf $CWD/$TARFILE.tar.gz
|
|
|
|
mv $TARFILE $PRGNAM-$VERSION
|
2012-08-13 21:53:45 +02:00
|
|
|
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2018-06-19 23:13:11 +02:00
|
|
|
\( -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 {} \;
|
|
|
|
|
2024-04-12 15:50:28 +02:00
|
|
|
# make the ncurses version of THE and the documentation
|
2018-06-19 23:13:11 +02:00
|
|
|
mkdir ncurses
|
|
|
|
cd ncurses
|
2012-08-13 21:53:45 +02:00
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
2018-06-19 23:13:11 +02:00
|
|
|
../configure \
|
2022-04-16 03:32:31 +02:00
|
|
|
--with-curses=ncurses \
|
2012-08-13 21:53:45 +02:00
|
|
|
--with-rexx=regina \
|
|
|
|
--build=$ARCH-slackware-linux \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--prefix=/usr \
|
2013-11-22 08:34:22 +01:00
|
|
|
--sysconfdir=/etc
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2013-11-22 08:34:22 +01:00
|
|
|
make
|
2024-04-19 16:54:46 +02:00
|
|
|
make -j1 install DESTDIR=$PKG
|
2024-04-12 15:50:28 +02:00
|
|
|
|
|
|
|
rm -rf doc/html
|
|
|
|
make html
|
2022-04-16 03:32:31 +02:00
|
|
|
|
2024-04-12 15:50:28 +02:00
|
|
|
rm -f $PKG/usr/bin/the
|
|
|
|
ln -fs the-con $PKG/usr/bin/the
|
|
|
|
ln -fs the-con $PKG/usr/bin/nthe
|
2012-08-13 21:53:45 +02:00
|
|
|
|
2022-04-16 03:32:31 +02:00
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
|
|
|
|
install -m0644 the64.gif the64.png doc/html/*.html \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION/html
|
2018-06-19 23:13:11 +02:00
|
|
|
|
|
|
|
cd $TMP/$PRGNAM-$VERSION
|
2024-04-12 15:50:28 +02:00
|
|
|
install -m0644 COPYING FAQ HISTORY INSTALL README* THE_Help.txt TODO \
|
2022-04-16 03:32:31 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
2023-01-12 21:52:34 +01:00
|
|
|
|
2024-04-12 15:50:28 +02:00
|
|
|
# Try to make the X11 version of THE by using PDCurses (XCurses)
|
|
|
|
|
|
|
|
if ldconfig -p | grep -q libXCurses.so; then
|
|
|
|
mkdir xcurses
|
|
|
|
cd xcurses
|
|
|
|
|
|
|
|
# for XCurses, create pdcurses-x11.pc pkg-config
|
|
|
|
XLIBDIR=lib${LIBDIRSUFFIX}
|
|
|
|
XVERSION=$(xcurses-config --version)
|
|
|
|
mkdir -p pkgconfig
|
|
|
|
sed -e "s/XLIBDIR/${XLIBDIR}/" \
|
|
|
|
-e "s/XVERSION/${XVERSION}/" \
|
|
|
|
< $CWD/libpdcurses-x11.pc \
|
|
|
|
> pkgconfig/libpdcurses-x11.pc
|
|
|
|
|
|
|
|
PKG_CONFIG_PATH=pkgconfig \
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
../configure \
|
|
|
|
--with-curses=pdcurses-x11 \
|
|
|
|
--with-rexx=regina \
|
|
|
|
--build=$ARCH-slackware-linux \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc
|
|
|
|
|
|
|
|
make the-x11
|
|
|
|
install -m0755 the-x11 $PKG/usr/bin
|
|
|
|
ln -fs the-x11 $PKG/usr/bin/xthe
|
|
|
|
fi
|
2018-06-19 23:13:11 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2015-01-27 01:01:06 +01:00
|
|
|
install -m0644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION
|
2012-08-13 21:53:45 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|