academic/WordNet: New maintainer, fixes.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-09-01 05:41:19 -04:00 committed by Willy Sudiarto Raharjo
parent 6b4a531611
commit fac8181314
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
9 changed files with 168 additions and 34 deletions

View File

@ -1,3 +1,5 @@
WordNet (large lexical database of English)
WordNet(r) is a large lexical database of English, developed under
the direction of George A. Miller. Nouns, verbs, adjectives and
adverbs are grouped into sets of cognitive synonyms (synsets), each

View File

@ -2,14 +2,36 @@
# Slackware build script for WordNet
# Written by Michael Gabilondo <mgabilo{at}gmail{dot}com>
# 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:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -21,9 +43,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
@ -56,11 +75,10 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$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 {} \;
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" \
@ -71,31 +89,36 @@ CXXFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--datadir=/usr/share/wordnet \
--build=$ARCH-slackware-linux
make CFLAGS="$CFLAGS -DUSE_INTERP_RESULT"
make install DESTDIR=$PKG
make install-strip DESTDIR=$PKG
gzip -9 $PKG/usr/man/man*/*
# Make sure WNHOME is set in the users' environments
mkdir -p $PKG/etc/profile.d
cat $CWD/profile.d/WordNet.sh > $PKG/etc/profile.d/WordNet.sh
cat $CWD/profile.d/WordNet.csh > $PKG/etc/profile.d/WordNet.csh
chmod 0755 $PKG/etc/profile.d/*
# 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
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# 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
( cd $PKG/usr/man
find . -type f -exec gzip -9 {} \;
for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
( cd $PKG/usr/doc ; mv html pdf ps $PRGNAM-$VERSION )
# 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

View File

@ -1,10 +1,10 @@
PRGNAM="WordNet"
VERSION="3.0"
HOMEPAGE="https://wordnet.princeton.edu/"
DOWNLOAD="http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.bz2"
DOWNLOAD="https://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.bz2"
MD5SUM="89b4db7c6840ce69a8e315a3f83d996b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Glenn Becker"
EMAIL="glenn.becker@gmail.com"
MAINTAINER="B. Watson"
EMAIL="urchlay@slackware.uk"

View File

@ -0,0 +1,9 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
fi
fi

View File

@ -1,2 +0,0 @@
#!/bin/csh
setenv WNHOME /usr

View File

@ -1,3 +0,0 @@
#!/bin/sh
WNHOME=/usr
export WNHOME

View File

@ -0,0 +1,90 @@
diff -Naur WordNet-3.0/configure WordNet-3.0.patched/configure
--- WordNet-3.0/configure 2007-01-20 14:59:45.000000000 -0500
+++ WordNet-3.0.patched/configure 2024-08-31 17:12:29.805494808 -0400
@@ -4286,7 +4286,7 @@
cat >>confdefs.h <<_ACEOF
-#define DEFAULTPATH "$ac_prefix/dict"
+#define DEFAULTPATH "$datadir/dict"
_ACEOF
diff -Naur WordNet-3.0/dict/Makefile WordNet-3.0.patched/dict/Makefile
--- WordNet-3.0/dict/Makefile 2007-01-20 16:21:51.000000000 -0500
+++ WordNet-3.0.patched/dict/Makefile 2024-08-31 17:19:08.301457306 -0400
@@ -136,7 +136,7 @@
sharedstatedir = ${prefix}/com
sysconfdir = ${prefix}/etc
target_alias =
-dictdir = $(prefix)/dict
+dictdir = $(datadir)/dict
dict_DATA = adj.exc adv.exc cntlist cntlist.rev data.adj data.adv data.noun data.verb frames.vrb index.adj index.adv index.noun index.sense index.verb log.grind.3.0 noun.exc sentidx.vrb sents.vrb verb.Framestext verb.exc lexnames
all: all-am
diff -Naur WordNet-3.0/dict/Makefile.am WordNet-3.0.patched/dict/Makefile.am
--- WordNet-3.0/dict/Makefile.am 2006-12-18 16:30:07.000000000 -0500
+++ WordNet-3.0.patched/dict/Makefile.am 2024-08-31 17:20:04.197452046 -0400
@@ -1,2 +1,2 @@
-dictdir = $(prefix)/dict
+dictdir = $(datadir)/dict
dict_DATA = adj.exc adv.exc cntlist cntlist.rev data.adj data.adv data.noun data.verb frames.vrb index.adj index.adv index.noun index.sense index.verb log.grind.3.0 noun.exc sentidx.vrb sents.vrb verb.Framestext verb.exc lexnames
diff -Naur WordNet-3.0/dict/Makefile.in WordNet-3.0.patched/dict/Makefile.in
--- WordNet-3.0/dict/Makefile.in 2007-01-20 15:54:18.000000000 -0500
+++ WordNet-3.0.patched/dict/Makefile.in 2024-08-31 17:20:20.053450553 -0400
@@ -136,7 +136,7 @@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-dictdir = $(prefix)/dict
+dictdir = $(datadir)/dict
dict_DATA = adj.exc adv.exc cntlist cntlist.rev data.adj data.adv data.noun data.verb frames.vrb index.adj index.adv index.noun index.sense index.verb log.grind.3.0 noun.exc sentidx.vrb sents.vrb verb.Framestext verb.exc lexnames
all: all-am
diff -Naur WordNet-3.0/include/wn.h WordNet-3.0.patched/include/wn.h
--- WordNet-3.0/include/wn.h 2007-01-03 16:51:35.000000000 -0500
+++ WordNet-3.0.patched/include/wn.h 2024-08-31 17:15:16.912479082 -0400
@@ -29,7 +29,7 @@
#else
#define DICTDIR "/dict"
#ifndef DEFAULTPATH
-#define DEFAULTPATH "/usr/local/WordNet-3.0/dict"
+#define DEFAULTPATH "/usr/share/wordnet/dict"
#endif
#define DATAFILE "%s/data.%s"
#define INDEXFILE "%s/index.%s"
diff -Naur WordNet-3.0/lib/wnres/Makefile.am WordNet-3.0.patched/lib/wnres/Makefile.am
--- WordNet-3.0/lib/wnres/Makefile.am 2006-11-14 16:25:17.000000000 -0500
+++ WordNet-3.0.patched/lib/wnres/Makefile.am 2024-08-31 17:29:05.214401131 -0400
@@ -1,3 +1,3 @@
EXTRA_DIST = license.txt wn.xbm wnb.man wngloss.man
-wnresdir = $(prefix)/lib/wnres
+wnresdir = $(datadir)/wnres
wnres_DATA = license.txt wn.xbm wnb.man wngloss.man
diff -Naur WordNet-3.0/lib/wnres/Makefile.in WordNet-3.0.patched/lib/wnres/Makefile.in
--- WordNet-3.0/lib/wnres/Makefile.in 2007-01-20 15:54:22.000000000 -0500
+++ WordNet-3.0.patched/lib/wnres/Makefile.in 2024-08-31 17:29:21.413399606 -0400
@@ -137,7 +137,7 @@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = license.txt wn.xbm wnb.man wngloss.man
-wnresdir = $(prefix)/lib/wnres
+wnresdir = $(datadir)/wnres
wnres_DATA = license.txt wn.xbm wnb.man wngloss.man
all: all-am
diff -Naur WordNet-3.0/src/wnb WordNet-3.0.patched/src/wnb
--- WordNet-3.0/src/wnb 2006-12-18 17:38:20.000000000 -0500
+++ WordNet-3.0.patched/src/wnb 2024-08-31 17:14:51.677481457 -0400
@@ -103,9 +103,9 @@
if {$tcl_platform(platform) == "unix"} {
if {[lsearch -exact [array names env] WNHOME] == -1} {
- set resourcedir "/usr/local/WordNet-3.0/lib/wnres"
+ set resourcedir "/usr/share/wordnet/wnres"
} else {
- set resourcedir "$env(WNHOME)/lib/wnres"
+ set resourcedir "$env(WNHOME)/wnres"
}
set configfile "$env(HOME)/.wnrc"
if [ file exists $configfile ] {

BIN
academic/WordNet/wn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -0,0 +1,15 @@
#====================================================
# WordNet GUI desktop entry specification
#
# license: GPL v2 or later
#====================================================
[Desktop Entry]
Type=Application
Name=WordNet
GenericName=lexical database of English
Comment=electronic lexical database of English language
Icon=wn
Exec=/usr/bin/wnb
Terminal=false
Categories=Education;Dictionary;