summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEinhard Leichtfuß2018-12-28 04:58:29 +0100
committerEinhard Leichtfuß2018-12-28 05:07:42 +0100
commit1822cd8e28e087c93dd2868a3f786f85c4cc4af9 (patch)
tree06011d3004038702c561036060ceab00a2b41fc6
parent522e62d218262f64d4756630b009ceccd31d63a7 (diff)
downloadaur-1822cd8e28e087c93dd2868a3f786f85c4cc4af9.tar.gz
Extract license from the Dictionary
Instead of downloading it separately.
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD33
-rwxr-xr-xextract_license.sed13
-rwxr-xr-x[-rw-r--r--]fix_misspellings.sed (renamed from sedfile)1
4 files changed, 40 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ef7b1cca24c1..e0961a239d5c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,22 +1,22 @@
pkgbase = dict-foldoc
pkgdesc = The Free On-line Dictionary of Computing for dictd et al.
- pkgver = 20181127_231140
- pkgrel = 1
+ pkgver = 20181224_000006
+ pkgrel = 2
url = https://foldoc.org/
install = dict-foldoc.install
arch = any
- license = FDL1.1+
+ license = custom: FDL1.1+
makedepends = dictd
makedepends = sed
optdepends = dictd: dict client and server
provides = dictd-foldoc
conflicts = dictd-foldoc
- source = Dictionary-20181127_231140::https://foldoc.org/Dictionary
- source = sedfile
- source = https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt
+ source = Dictionary-20181224_000006::https://foldoc.org/Dictionary
+ source = fix_misspellings.sed
+ source = extract_license.sed
sha512sums = SKIP
- sha512sums = 94f123fc5d7042e918db098f03f31356953ef3cd09ee388d348797d7c61d414a2f3058009e7050490c52b83d529913f862bde29cfa9ddd9b3e273664d01ee4fd
- sha512sums = 021a3205572254b975b3d3ad8b616010b9419cb1e3d68c54c64e36b898a1409e3561e8a2023e3efc324d1034d10ff316975e8008a56211f9fe43f316a15061d4
+ sha512sums = b68d7356cfa5664de8ca87aa941c208edcec8e79761d616728ff5f9dfbc4878c07cae91fff79872044e889d25d4b63b1b5c36917867d47a8d157815f2840a711
+ sha512sums = fa8c9b2f35ebc01dd5222a953d9507e40a36d3602fcd89f425f727f1e47e068da4e789eed400756b998cd36dfc06c408741c757fb8ec09bc7fbe79bd0304aa21
pkgname = dict-foldoc
diff --git a/PKGBUILD b/PKGBUILD
index b9cc8877bc9a..140dabc3803b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,37 +1,39 @@
-# Maintainer: Einhard Leichtfuß <archer@respiranto.de>
+# Maintainer: Einhard Leichtfuß <alguien@respiranto.de>
# Contributor: Jan Keith Darunday <jkcdarunday@gmail.com>
# Contributor: Enrico Morelli <morelli@cerm.unifi.it>
pkgname=dict-foldoc
-pkgver=20181127_231140
-pkgrel=1
+pkgver=20181224_000006
+pkgrel=2
pkgdesc="The Free On-line Dictionary of Computing for dictd et al."
arch=('any')
url="https://foldoc.org/"
-license=('FDL1.1+')
+license=('custom: FDL1.1+')
optdepends=('dictd: dict client and server')
makedepends=('dictd' 'sed')
provides=('dictd-foldoc')
conflicts=('dictd-foldoc')
-install=$pkgname.install
+install=${pkgname}.install
# Calculate the version now in order to make sources belonging to different
# versions distinguishable.
-_datestr="$(curl -sI foldoc.org/Dictionary | grep "Last-Modified" \
- | cut -c 21-)"
+_datestr="$(curl -sI foldoc.org/Dictionary \
+ | sed -nE 's/^[Ll]ast-[Mm]odified: (.*)$/\1/p')"
_var_pkgver=$(date --utc --date="$_datestr" +%Y%m%d_%H%M%S)
_srcfile=Dictionary-${_var_pkgver}
source=("${_srcfile}::https://foldoc.org/Dictionary"
- 'sedfile'
- 'https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt')
+ 'fix_misspellings.sed'
+ 'extract_license.sed')
sha512sums=('SKIP'
- '94f123fc5d7042e918db098f03f31356953ef3cd09ee388d348797d7c61d414a2f3058009e7050490c52b83d529913f862bde29cfa9ddd9b3e273664d01ee4fd'
- '021a3205572254b975b3d3ad8b616010b9419cb1e3d68c54c64e36b898a1409e3561e8a2023e3efc324d1034d10ff316975e8008a56211f9fe43f316a15061d4')
+ 'b68d7356cfa5664de8ca87aa941c208edcec8e79761d616728ff5f9dfbc4878c07cae91fff79872044e889d25d4b63b1b5c36917867d47a8d157815f2840a711'
+ '5dc4a4e112ca7046a0e0bbc9f3d3464916764e00d72a47794b91a5aac9608b1cf15e4659788529b9f904c8aee3949e6f360ab5872308f524549f742a3b780a1f')
prepare()
{
+ ./extract_license.sed < $_srcfile > LICENSE
+
# Correct some misspellings.
- sed -i -f sedfile "${_srcfile}"
+ ./fix_misspellings.sed -i $_srcfile
}
pkgver()
@@ -42,10 +44,12 @@ pkgver()
build()
{
_datestr=$(date --utc --date=${pkgver%_*} +%Y-%m-%d)
- cat "${_srcfile}" | dictfmt -f \
+
+ dictfmt < $_srcfile -f \
--allchars -u http://foldoc.org/Dictionary \
-s "The Free On-line Dictionary of Computing (${_datestr})" \
--utf8 foldoc
+
dictzip -v foldoc.dict
}
@@ -54,6 +58,5 @@ package()
install -m 755 -d "${pkgdir}/usr/share/dictd"
install -m 644 -t "${pkgdir}/usr/share/dictd/" foldoc.{dict.dz,index}
install -m 755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
- install -m 644 fdl-1.1.txt \
- "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}/" LICENSE
}
diff --git a/extract_license.sed b/extract_license.sed
new file mode 100755
index 000000000000..0fa0c844c505
--- /dev/null
+++ b/extract_license.sed
@@ -0,0 +1,13 @@
+#!/usr/bin/env -S sed -nEf
+
+/^GNU Free Documentation License$/ {
+ :a
+ p
+ n
+
+ # Stop on next entry.
+ /^\S/ q
+
+ # Continue printing GFDL.
+ b a
+}
diff --git a/sedfile b/fix_misspellings.sed
index 95ed94575282..fed78a007606 100644..100755
--- a/sedfile
+++ b/fix_misspellings.sed
@@ -1,3 +1,4 @@
+#!/usr/bin/env -S sed -Ef
s/ cheifly/ chiefly/
s/amd the need/and the need/
s/propriatery/proprietary/