blob: f3ad2e4e769e8d35d2f0e83f5561a0777aa5107f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# Maintainer: dreieck
# PKGBUILD last time manually edited: At least on 2024-05-19.
url="https://chaps.cz/eng/download/idos/zip#kotvaprg"
_zipfile="TTFONT.ZIP"
_fontfile="TT.ttf"
_pkgver() {
# Reason for a $_pkgver(): Have something to run before source download so that we can have version aware source downloads.
_unpackeddir="${srcdir}"
cd "${_unpackeddir}"
# _ver="$(fc-query -f "%{fontversion}" "${_fontfile}")"
# _ver="$(wget -q -O- "${url}" | html2text -b 0 | grep 'Font Timetable, version' | sed 's|^.*version[[:space:]]\([0-9\.]*\)[^0-9].*$|\1|g')"
_ver="$(wget -nv -O- "${url}" | sed -n 's|^.*Font Timetable, version[[:space:]]*\([0-9\.]*\)[^0-9].*$|\1|p')"
_date="$(wget -nv -O- "${url}" | sed -n 's|^.*/updates/ttfont_d#\([0-9]*\)[^0-9].*$|\1|p')"
_exitcode=0
if [ -z "${_ver}" ]; then
echo "$0: Error: Could not determine version." > /dev/stderr
false
_exitcode=1
fi
if [ -z "${_date}" ]; then
echo "$0: Error: Could not determine release date." > /dev/stderr
false
_exitcode=2
fi
echo "${_ver}.${_date}"
return ${_exitcode}
}
_pkgname=ttf-timetable
pkgname="${_pkgname}-latest"
epoch=0
_pkgver="$(_pkgver)" # This should be set _before_ sources get downloaded.
pkgver="${_pkgver}"
pkgrel=7
pkgdesc="Font with train timetable symbols, used by the offline timetable by CHAPS (IDOS, Timetable-Browser) or INPROP (CP, ELIS) (also retailed by České Dráhy or ŽSR)."
arch=('any')
license=('custom')
depends=(
"fontconfig"
"xorg-mkfontscale"
"xorg-mkfontdir"
"xorg-xset"
)
makedepends=(
"fontconfig"
"unzip"
"xorg-mkfontscale"
"xorg-mkfontdir"
"xorg-xset"
)
provides=("${_pkgname}=${pkgver}")
conflicts=("${_pkgname}")
replaces=("${_pkgname}<=${pkgver}")
install='tt.install'
_target="ttfont-${_pkgver}.zip"
source=(
"${_target}::https://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}"
"IDOS-Licence.pdf::https://chaps.cz/files/idos/IDOS-Licence.pdf"
"license-dummy.txt"
"info.url"
"${install}"
)
sha256sums=(
"3cc7ad3458a0382106871ef7872641154043c94c4040e7a4691f1ba65012d29e" # TTFONT.ZIP
"SKIP" # IDOS-Licence.pdf
"c6bb216055d3670d3100b7a74e04ce0644030f365f4349a09e630ef60fbcb9a4" # license-dummy.txt
"4c021678394399056573ae7f85779a7fde86f0c70fec6e64f6e1a379195ef4da" # info.url
"6a00ba2e7e0e7610dd4a4a064716bcf368b4269f75046aee585208dd3d6a998f" # ${install}
)
pkgver() {
printf '%s' "${_pkgver}"
}
package() {
_unpackeddir="${srcdir}"
cd "${_unpackeddir}"
install -D -m644 "${_unpackeddir}/${_fontfile}" "${pkgdir}/usr/share/fonts/timetable/TT.ttf"
ln -s TT.ttf "${pkgdir}/usr/share/fonts/timetable/tt.ttf"
ln -s TT.ttf "${pkgdir}/usr/share/fonts/timetable/timetable.ttf"
install -D -m644 info.url "${pkgdir}/usr/share/doc/${pkgname}/info.url"
install -D -m644 license-dummy.txt "${pkgdir}/usr/share/licenses/${pkgname}/copying.txt"
install -D -m644 "${srcdir}/IDOS-Licence.pdf" "${pkgdir}/usr/share/licenses/${pkgname}/IDOS-Licence.pdf"
}
|