diff options
author | Einhard Leichtfuß | 2021-06-29 00:03:25 +0200 |
---|---|---|
committer | Einhard Leichtfuß | 2021-06-29 00:21:38 +0200 |
commit | ff8b7a7d9c2bc3ac9f26a30d97b310bd4d3c7a2b (patch) | |
tree | dc9f2c5bae38a68472c8333d5bd236fbe4889c80 /PKGBUILD | |
parent | b0aecb2472cb779c8aaac6259f66e15dfa1108a0 (diff) | |
download | aur-ff8b7a7d9c2bc3ac9f26a30d97b310bd4d3c7a2b.tar.gz |
Address gcc errors, and other improvements
As reported by `Musse', the now default `-Werror=format-security' caused
building to fail due to usage of {,f}printf(3) with variable format
strings.
This did actually not affect this package security-wise before; the
affected files were built, but neither run nor included in the package.
Changes:
* Only build what is needed.
- The files affected by the security issues (and, thus, the gcc
errors) are not built anymore.
- Less make dependencies.
* `makedepends' is now correct, building in chroot works.
* Apply Debian patches; e.g.,
* Port that one script from python2 to python3.
* Fix the mentioned security issues--which would not affect this
package anyways.
- Remove the need for one of the sed calls.
* The affected file is not built anymore, though.
* Do not use pre-autogenerated Makefiles et al..
* Other minor changes.
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 97 |
1 files changed, 74 insertions, 23 deletions
@@ -4,60 +4,111 @@ pkgname=dict-wn pkgver=3.1 _debver=3.0 -pkgrel=4 +_debsubver=36 +pkgrel=5 pkgdesc="WordNet for dictd et al." arch=('any') url="https://wordnet.princeton.edu/" -license=('custom: WordNet License' 'GPL') +license=('custom: WordNet License' 'GPL2' 'GPL') optdepends=('dictd: dict client and server') -makedepends=('dictd' 'tk' 'python2' 'ghostscript') +makedepends=('dictd' 'python') provides=('dictd-wn') conflicts=('dictd-wn') install="${pkgname}.install" -# The tarball from debian is required for wordnet_structures.py . -source=("http://wordnetcode.princeton.edu/wn${pkgver}.dict.tar.gz" - "http://ftp.de.debian.org/debian/pool/main/w/wordnet/wordnet_${_debver}.orig.tar.gz") +# The tarballs from debian are required for +# - `wordnet_structures.py' ("orig"), +# - patches ("debian"). +source=("https://wordnetcode.princeton.edu/wn${pkgver}.dict.tar.gz" + "https://deb.debian.org/debian/pool/main/w/wordnet/wordnet_${_debver}.orig.tar.gz" + "https://deb.debian.org/debian/pool/main/w/wordnet/wordnet_${_debver}-${_debsubver}.debian.tar.xz") sha512sums=('16dca17a87026d8a0b7b4758219cd21a869c3ef3da23ce7875924546f2eacac4c2f376cb271b798b2c458fe8c078fb43d681356e3d9beef40f4bd88d3579394f' - 'f153ea6be57ef57b18e4f0857e2ce0493ee75171f60df4b3aa669f4279c1b2ad91641da166b450d95a89166d50d6dc0d9f199710fa2f1ab934882028760d6917') + 'f153ea6be57ef57b18e4f0857e2ce0493ee75171f60df4b3aa669f4279c1b2ad91641da166b450d95a89166d50d6dc0d9f199710fa2f1ab934882028760d6917' + 'ca9a445e0f447073f5aa13fdeefe339f8c34d0510d7a9ac5b1bf0167d5d5fa23f796267fb34aec963f47b0611565454b33c798ad4424c9cd84eef5f665fd514b') + prepare() { cd WordNet-${_debver} - # Use the new data. - cp -rf ../dict/. dict/ - # Apparently, the naming conventions changed. - # Use the old ones. + # Apply Debian patches. + # - Note: Lots of these affect files that we do not use. + local _patchdir=../debian/patches + local _patchfile + while IFS= read -r _patchfile + do + patch -p1 < "${_patchdir}/${_patchfile}" + done < "${_patchdir}/series" + + + # Remove autogenerated autotools and libtool files. + rm aclocal.m4 compile config.guess config.h.in config.sub configure \ + depcomp install-sh missing ylwrap ltmain.sh + find . -name Makefile.in -delete + + + # Use the new data, but the old Makefiles. + # - The new data do not include Makefiles. + # - extglob's do not work in PKGBUILDs. + mv dict/Makefile.am ../dict/ + mv dict/dbfiles/Makefile.am ../dict/dbfiles/ + rm -rf dict + mv -T ../dict/ dict + + # Both versions have `dict/verb.Framestext' and a copy of it as + # - dict/frames.vrb (v3.0) and + # - dict/dbfiles/verb.Framestext (v3.1), respectively. + # The build system is written for v3.0, hence adjust accordingly. mv -f dict/dbfiles/verb.Framestext dict/frames.vrb - # Pretend old version. - mv -f dict/log.grind.{"${pkgver}","${_debver}"} + # Version 3.1 does not contain a grind logfile. + sed -Ei '/dict_DATA *=/ s/ \<log.grind.3.0\>//' dict/Makefile.am + + + # Tcl and Tk are not needed for our purposes. + # `configure' fails if they are not installed and the macros not deleted. + sed -Ei '/^SC_(PATH|LOAD)_T(CL|K)CONFIG/ d' configure.ac - # Use python2, pass the url and the name with the new version. - sed -Ei 's`python (wordnet_structures.py)`python2 \1 --wn_url="https://wordnet.princeton.edu" --db_desc_short="WordNet (r) '"${pkgver}"' (2011)"`' contrib/wordnet_structures/Makefile.in - # Tcl_Interp structure does by default not contain result. - sed -Ei '/^#include <tcl.h>$/ i #define USE_INTERP_RESULT' src/stubs.c + # Pass the url and the name with the new version. + # - Note: The Wordnet license as presented by `dict -i wn' continues to + # claim version 3.0 and a copyright date of 2006. + # - The separately downloaded dataset does not contain a license. + # - The web license also mentions version 3.0. + # - https://wordnet.princeton.edu/license-and-commercial-use + sed -Ei 's`python3? wordnet_structures\.py`& --wn_url="https://wordnet.princeton.edu" --db_desc_short="WordNet (r) '"${pkgver}"' (2011)"`' \ + contrib/wordnet_structures/Makefile.am } + build() { - cd WordNet-${_debver} - ./configure + cd "WordNet-${_debver}" + + # Note: `./autogen.sh' passes arguments on to `./configure'. + libtoolize + ./autogen.sh + - # Builiding fails with -jN where N>1. - make -j1 + # The make structure does not facilitate building parts only. + # This is why several direct calls to `make' seem required. + + # Building fails with -jN where N>1. + make -j1 -C src/grind/ grind + + make -C dict/dbfiles/ + make -C contrib/wordnet_structures/ } + package() { - cd WordNet-${_debver} + cd "WordNet-${_debver}" install -m 0755 -d "${pkgdir}/usr/share/dictd" install -m 0644 -t "${pkgdir}/usr/share/dictd/" \ contrib/wordnet_structures/wn.{dict.dz,index} - # Note, that the documentation will be for the old version. + # Note: The documentation is for the old version. install -m 0755 -d "${pkgdir}/usr/share/doc/${pkgname}" install -m 0644 -t "${pkgdir}/usr/share/doc/${pkgname}/" \ AUTHORS COPYING NEWS README |