summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelics@felics-tablet2016-05-19 19:32:34 +0200
committerfelics@felics-tablet2016-05-19 19:32:34 +0200
commit21bfe682085f483064c673b05cf4040e64e64a37 (patch)
tree970f05a555d50426416ecd31e6da5d9c1084d3c7
downloadaur-21bfe682085f483064c673b05cf4040e64e64a37.tar.gz
Initial commit. And updated wrapper script.
-rw-r--r--.SRCINFO34
-rw-r--r--IDOS-Licence.pdfbin0 -> 156075 bytes
-rw-r--r--PKGBUILD84
-rw-r--r--README.datafiles.txt17
-rwxr-xr-xidos-timetable-browser.sh140
-rw-r--r--info.url1
-rw-r--r--license-dummy.txt10
7 files changed, 286 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..87d2771a1724
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+# Generated by mksrcinfo v8
+# Thu May 19 17:30:19 UTC 2016
+pkgbase = idos-timetable-browser-latest
+ pkgdesc = Offline railway and other public transport timetable search engine by CHAPS. (Czech language by default.)
+ pkgver = 1.27_lib2.8.0.1
+ pkgrel = 1
+ url = http://chaps.cz/eng/download/idos/zip#kotvaprg
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = unzip
+ depends = ttf-timetable
+ depends = wine
+ optdepends = idos-timetable-data: For timetable data. (You need at least one to use the software.)
+ optdepends = idos-timetable-lang-: For translations in other languages.
+ provides = idos-timetable-browser=1.27_lib2.8.0.1
+ provides = idos-timetable-lang-cz=1.27_lib2.8.0.1
+ conflicts = idos-timetable-browser
+ replaces = idos-timetable-browser<=1.27_lib2.8.0.1
+ source = ttakt.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/TTAKT.ZIP
+ source = idos-timetable-browser.sh
+ source = IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf
+ source = license-dummy.txt
+ source = info.url
+ source = README.datafiles.txt
+ sha256sums = SKIP
+ sha256sums = 5d6e710d03d5832fcdb67726b3ce91ee1a4fe993f258e8a15c49bd51f5224bb5
+ sha256sums = e904d167ccdcfb2743f4cfd596aaa9dce8b751fb5c8315b972b42b7cbb3189e6
+ sha256sums = c6bb216055d3670d3100b7a74e04ce0644030f365f4349a09e630ef60fbcb9a4
+ sha256sums = d302ccfd82cc9057751f79b6f0f310676b539a201e943ff7c2fd9b9dbaf29b53
+ sha256sums = 6333e453013c7d5a12782c7c58d97582e402b796e47acd3f335520174009929a
+
+pkgname = idos-timetable-browser-latest
+
diff --git a/IDOS-Licence.pdf b/IDOS-Licence.pdf
new file mode 100644
index 000000000000..a1dd43f145d1
--- /dev/null
+++ b/IDOS-Licence.pdf
Binary files differ
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..f7e0c6181890
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+# Maintainer: dreieck
+
+_pkgname=idos-timetable-browser
+pkgname="${_pkgname}-latest"
+pkgver=1.27_lib2.8.0.1
+pkgrel=1
+pkgdesc="Offline railway and other public transport timetable search engine by CHAPS. (Czech language by default.)"
+arch=('i686' 'x86_64')
+url="http://chaps.cz/eng/download/idos/zip#kotvaprg"
+license=('custom')
+
+depends=(
+ "ttf-timetable"
+ "wine"
+)
+
+makedepends=(
+ "unzip"
+)
+
+optdepends=(
+ "idos-timetable-data: For timetable data. (You need at least one to use the software.)"
+ "idos-timetable-lang-: For translations in other languages."
+ # "idos-timetable-lang-de: For German translation."
+ # "idos-timetable-lang-en: For English translation."
+ # "idos-timetable-lang-nl: For Dutch translation."
+)
+
+provides=(
+ "${_pkgname}=${pkgver}"
+ "idos-timetable-lang-cz=${pkgver}"
+)
+
+conflicts=("${_pkgname}")
+
+replaces=("${_pkgname}<=${pkgver}")
+
+
+source=(
+ "ttakt.zip::http://ttakt.chaps.cz/TTAktual/Win/Zip/TTAKT.ZIP"
+ "idos-timetable-browser.sh"
+ "IDOS-Licence.pdf::http://chaps.cz/files/idos/IDOS-Licence.pdf"
+ "license-dummy.txt"
+ "info.url"
+ "README.datafiles.txt"
+)
+
+sha256sums=(
+ "SKIP" # "92a47f8947a15bdd3c0fcaac4e21db7d0ae6d9e70cfb9de94e5238081a91a817"
+ "5d6e710d03d5832fcdb67726b3ce91ee1a4fe993f258e8a15c49bd51f5224bb5"
+ "e904d167ccdcfb2743f4cfd596aaa9dce8b751fb5c8315b972b42b7cbb3189e6"
+ "c6bb216055d3670d3100b7a74e04ce0644030f365f4349a09e630ef60fbcb9a4"
+ "d302ccfd82cc9057751f79b6f0f310676b539a201e943ff7c2fd9b9dbaf29b53"
+ "6333e453013c7d5a12782c7c58d97582e402b796e47acd3f335520174009929a"
+)
+
+
+pkgver() {
+ wget -nv -O- "${url}" | grep 'Timetable browser, version' | head -n 1 | sed -r 's|^.*Timetable browser, version ([0-9\.]+),.*library version ([0-9\.]+).*$|\1_lib\2|g'
+}
+
+
+package() {
+ _instdirbase='/opt/idos-timetable'
+ _instdir="${pkgdir}/${_instdirbase}"
+ _execdir="${pkgdir}/usr/bin"
+ install -d -m755 "${_instdir}"
+
+ cd "${_instdir}" && {
+ unzip "${srcdir}/ttakt.zip"
+ chmod 644 *
+ chmod 755 TT.exe
+ }
+
+ install -D -m644 "${srcdir}/info.url" "${pkgdir}/usr/share/doc/${_pkgname}/info.url"
+ install -D -m644 "${srcdir}/README.datafiles.txt" "${pkgdir}/usr/share/doc/${_pkgname}/README.datafiles.txt"
+
+ ln -s "/usr/share/doc/${_pkgname}/README.datafiles.txt" "${_instdir}/README.datafiles.txt"
+
+ install -D -m644 "${srcdir}/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"
+
+ install -D -m755 "${srcdir}/idos-timetable-browser.sh" "${_execdir}/idos-timetable-browser"
+}
diff --git a/README.datafiles.txt b/README.datafiles.txt
new file mode 100644
index 000000000000..51ddbec6e36e
--- /dev/null
+++ b/README.datafiles.txt
@@ -0,0 +1,17 @@
+Data files are files providing timetable, map or tariff data.
+
+Data files have the following extensions:
+
+ .tt: Timetable,
+ .ttr: Timetable-related additional information (not sure which),
+ .ttm: Map,
+ .ttp: Tariff.
+
+Data files are automatically found if residing in the same directory or within one subdirectory of from where the programme is run.
+
+There is a default convention, used by the data files distributed by CHAPS and other sources. Under this convention, data files go into subdirectories Data1, Data2, Data3 or Data4 in the following way:
+
+ Data1/ contains data files related to trains.
+ Data2/ contains data files related to busses.
+ Data3/ contains data files related to municipal public transport.
+ Data4/ contains data files related to flights.
diff --git a/idos-timetable-browser.sh b/idos-timetable-browser.sh
new file mode 100755
index 000000000000..7ab17aa9e497
--- /dev/null
+++ b/idos-timetable-browser.sh
@@ -0,0 +1,140 @@
+#!/bin/bash
+
+### Wrapper for the windows-software "IDOS timetable browser".
+# This wrapper does start the software with 'wine' from the correct
+# directory (where it can find it's .dll files), and does some
+# command line argument reformatting so that filenames can be
+# specified both absolutely and relatively to the directory the user
+# starts this wrapper from.
+
+
+
+### Global variables:
+
+# Where this wrapper is started from:
+_cwd="$(pwd)"
+
+# Where the software is installed:
+_installdir="/opt/idos-timetable"
+
+# What the executable of the software is:
+_executable="${_installdir}/TT.exe"
+
+# Print some debug messages? Can be controlled via environment; if not
+# specified in the environment, set it here:
+if [ -z "${DEBUG}" ]; then
+ DEBUG="true"
+fi
+
+
+
+### Some helper functions:
+
+debug() {
+ case "${DEBUG}" in
+ "1"|[yY][eE][sS]|[tT][rR][uU][eE])
+ echo "$@" > /dev/stderr
+ ;;
+ esac
+}
+
+rebase_absolute_path() {
+ # Arguments:
+ # $1: The new base path (assumed to be absolute and not containing double-'/'),
+ # $2: The absolute path which should be made a relative path based on $1 (needs to be an absolute path).
+ _newbase="$1"
+ _oldpath="$2"
+
+ _depth_new="$(echo "${_newbase}" | tr -d '\n' | tr '/' '\n' | wc -l)" # Get the depth of $_newbase.
+ _updir_string=''
+ for i in $(seq 1 "${_depth_new}"); do # Put as much '../' into a string in order to reach / from $_newbase
+ _updir_string="../${_updir_string}"
+ done
+ _updir_string="$(echo "${_updir_string}" | head -c-2)" # Remove the trailing '/'.
+
+ _newpath="${_updir_string}${_oldpath}"
+
+ echo "${_newpath}"
+}
+
+rebase_relative_path() {
+ # Arguments:
+ # $1: Old base path (assumed to be absolute and not containing double-'/'),
+ # $2: New base path (assumed to be absolute and not containing double-'/'),
+ # $3: Relative path based on $1 to be rebased to $2.
+ _oldbase="$1"
+ _newbase="$2"
+ _oldpath="$3"
+
+ echo "$(rebase_absolute_path "${_newbase}" "${_oldbase}/${_oldpath}")"
+}
+
+
+
+### Do some option parsing:
+# * Convert "-h", "-help" or "--help" to "/?",
+# * convert pathnames to relative ones with regard to $_installdir,
+# which is necessary since
+# - the windows software would treat absolute pathnames, in the
+# Unix-world starting with '/', as options to the software,
+# - relative pathnames specified by the user need to be relative
+# with regard to the directory the software is run from. (We need
+# to change the directory so the software can find necessary
+# .dll files.)
+
+# First, copy the positional parameters into a new (modifiable) array;
+# with indices numbered in the same way as the positional paramaters
+# (exept that we won't have 0):
+
+argsnew=()
+
+for j in $(seq "$(($#-1))" -1 0); do
+ i="$(($#-$j))"
+ argsnew[$i]="${BASH_ARGV[$j]}"
+done
+
+# Now, parse the positional arguments. The software understands the
+# following arguments:
+# - Filenames to *.tt-files: Timetable files to use.
+# - /?: Help on arguments.
+# - /W:[CATZ], /L:*, /D:*, /C, /P, /I, /X:[23], /M:B, /O, /1, /2:*, /Z:*
+#
+# So, we will go as follows:
+# - Convert any '-h', '-help' or '--help' to '/?,
+# - If we encounter anything that does not begin with '/' or is not
+# '-h', '-help' or '--help', assume that it is a filename relative
+# to the directory $_cwd, and make it a filename relative to the
+# directory $_installdir.
+# - If we encounter something which mathes any of the options above,
+# leave it as it is,
+# - Assume that the rest is an absolute filename, and make it a
+# filename relative to the directory $_installdir.
+
+for i in $(seq 1 "$#"); do
+ case "${argsnew[$i]}" in
+ "-h"|"-help"|"--help")
+ argsnew[$i]="/?"
+ ;;
+ [^/]*)
+ argsnew[$i]="$(rebase_relative_path "${_cwd}" "${_installdir}" "${argsnew[$i]}")"
+ ;;
+ "/?"|"/W:"[CATZ]|"/L:"*|"/D:"*|"/C"|"/P"|"/I"|"/X:"[23]|"/M:B"|"/O"|"/1"|"/2:"*|"/Z:"*)
+ true
+ ;;
+ *)
+ # Now, everything left is assumed to be an absolute filename.
+ argsnew[$i]="$(rebase_absolute_path "${_installdir}" "${argsnew[$i]}")"
+ ;;
+ esac
+done
+
+
+
+### Launch the software with the parsed and maybe reformatted arguments:
+
+cd "${_installdir}"
+
+debug "DEBUG: We are running from the directory: '$(pwd)'."
+debug "DEBUG: Executing the following command: 'wine ${_executable} ${argsnew[@]}'."
+
+wine "${_executable}" "${argsnew[@]}"
diff --git a/info.url b/info.url
new file mode 100644
index 000000000000..793d645eb5db
--- /dev/null
+++ b/info.url
@@ -0,0 +1 @@
+http://www.chaps.cz/eng/download/idos
diff --git a/license-dummy.txt b/license-dummy.txt
new file mode 100644
index 000000000000..f94d2f374c02
--- /dev/null
+++ b/license-dummy.txt
@@ -0,0 +1,10 @@
+We do not know the license. Assume commercial by
+
+ CHAPS spol. s r.o.
+ Bráfova 1617/21
+ CZ-616 00 Brno
+ Czech republic
+
+ http://www.chaps.cz/
+
+Upstream URL: http://www.chaps.cz/eng/download/idos#kotvaprg