mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-22 19:44:21 +01:00
fac8181314
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
124 lines
3.6 KiB
Bash
124 lines
3.6 KiB
Bash
#!/bin/bash
|
|
|
|
# Slackware build script for WordNet
|
|
|
|
# Written by Michael Gabilondo
|
|
# This work is in the public domain
|
|
|
|
# Modified and now maintained by B. Watson. If you live in a country
|
|
# whose laws don't recognize "public domain", then for you this is
|
|
# licensed under the WTFPL.
|
|
|
|
# 20240831 bkw: BUILD=3
|
|
# - new maintainer.
|
|
# - add .desktop and icon from debian, and doinst.sh.
|
|
# - add missing docs to doc dir, *especially* COPYING.
|
|
# - move data files to /usr/share/wordnet. putting them
|
|
# in /usr/dict/ and /usr/lib/wnres is terrible.
|
|
# - remove the profile.d/ scripts, they weren't needed.
|
|
# - do not include tk.h and tkDecls.h in the package.
|
|
|
|
# Note to self:
|
|
# Upstream has released a version 3.1 of just the data files:
|
|
# https://wordnetcode.princeton.edu/wn3.1.dict.tar.gz
|
|
# ...which just contains the dict/ dir of the source. However,
|
|
# replacing 3.0's dict/ with this doesn't work (missing frames.vrb
|
|
# file, among others). Since I don't know anything about this,
|
|
# didn't upgrade to the 3.1 database. If you do know, please let
|
|
# me know.
|
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
PRGNAM=WordNet
|
|
VERSION=${VERSION:-3.0}
|
|
BUILD=${BUILD:-3}
|
|
TAG=${TAG:-_SBo}
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
case "$( uname -m )" in
|
|
i?86) ARCH=i586 ;;
|
|
arm*) ARCH=arm ;;
|
|
*) ARCH=$( uname -m ) ;;
|
|
esac
|
|
fi
|
|
|
|
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}
|
|
|
|
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
|
|
cd $TMP
|
|
rm -rf $PRGNAM-$VERSION
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
|
|
cd $PRGNAM-$VERSION
|
|
chown -R root:root .
|
|
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
|
|
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
|
|
|
|
patch -p1 < $CWD/usr_share.diff
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
./configure \
|
|
--prefix=/usr \
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
--exec-prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--localstatedir=/var \
|
|
--mandir=/usr/man \
|
|
--datadir=/usr/share/wordnet \
|
|
--build=$ARCH-slackware-linux
|
|
|
|
make CFLAGS="$CFLAGS -DUSE_INTERP_RESULT"
|
|
make install-strip DESTDIR=$PKG
|
|
gzip -9 $PKG/usr/man/man*/*
|
|
|
|
# 20240901 bkw: this stuff doesn't belong in the package, it's already
|
|
# in Slackware's own tk package (in /usr/include rather than /usr/include/tk).
|
|
rm -rf $PKG/usr/include/tk
|
|
|
|
# 20240831 bkw: .desktop taken from https://packages.debian.org/sid/wordnet
|
|
# icon from same source, but resized to 128x128.
|
|
mkdir -p $PKG/usr/share/{applications,icons/hicolor/{48x48,128x128}/apps}
|
|
cat $CWD/wordnet.desktop > $PKG/usr/share/applications/wordnet.desktop
|
|
cat $CWD/wn.png > $PKG/usr/share/icons/hicolor/128x128/apps/wn.png
|
|
convert -resize 48x48 $CWD/wn.png $PKG/usr/share/icons/hicolor/48x48/apps/wn.png
|
|
mkdir -p $PKG/usr/share/pixmaps
|
|
ln -s ../icons/hicolor/48x48/apps/wn.png $PKG/usr/share/pixmaps/wn.png
|
|
|
|
# 20240831 bkw: LICENSE is identical to COPYING, NEWS is 0 bytes.
|
|
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
|
|
mkdir -p $PKGDOC
|
|
mv $PKG/usr/doc/{html,pdf,ps} $PKGDOC
|
|
cp -a AUTHORS COPYING ChangeLog README $PKGDOC
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
|
|
|
|
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
|