diff options
author | git user | 2023-09-04 13:39:03 +0200 |
---|---|---|
committer | git user | 2023-09-04 13:39:03 +0200 |
commit | d69f764410f6acd78e30e402a4b9226e5a4d0420 (patch) | |
tree | 2503dc6058e2bad46b4c89909f1e1b9a03698a4f | |
parent | 760c63a5b91575a0b273d7f9860e6cd43cc2c29e (diff) | |
download | aur-d69f764410f6acd78e30e402a4b9226e5a4d0420.tar.gz |
Switched to version-aware source download target.
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 69 |
2 files changed, 42 insertions, 32 deletions
@@ -1,7 +1,8 @@ pkgbase = ttf-timetable-latest 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). pkgver = 1.355.20230327 - pkgrel = 2 + pkgrel = 3 + epoch = 0 url = http://chaps.cz/eng/download/idos/zip#kotvaprg install = tt.install arch = any @@ -18,7 +19,7 @@ pkgbase = ttf-timetable-latest provides = ttf-timetable=1.355.20230327 conflicts = ttf-timetable replaces = ttf-timetable<=1.355.20230327 - source = ttfont.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/TTFONT.ZIP + source = ttfont-1.355.20230327.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/TTFONT.ZIP source = IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf source = license-dummy.txt source = info.url @@ -1,14 +1,45 @@ # Maintainer: dreieck -# PKGBUILD last time manually edited: At least on 2023-06-07. +# PKGBUILD last time manually edited: At least on 2023-09-04. + +url="http://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" -pkgver=1.355.20230327 -pkgrel=2 +epoch=0 +_pkgver="$(_pkgver)" # This should be set _before_ sources get downloaded. +pkgver="${_pkgver}" +pkgrel=3 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') -url="http://chaps.cz/eng/download/idos/zip#kotvaprg" license=('custom') depends=( @@ -32,8 +63,10 @@ replaces=("${_pkgname}<=${pkgver}") install='tt.install' +_target="ttfont-${_pkgver}.zip" + source=( - "ttfont.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/TTFONT.ZIP" + "${_target}::http://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}" "IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf" "license-dummy.txt" "info.url" @@ -48,32 +81,8 @@ sha256sums=( "6a00ba2e7e0e7610dd4a4a064716bcf368b4269f75046aee585208dd3d6a998f" ) -_fontfile="TT.ttf" - pkgver() { - _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} + printf '%s' "${_pkgver}" } package() { |