summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 16a6577ec668451e3dde63ef02c3d04146d412d5 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Maintainer: dreieck

# PKGBUILD last time manually edited: At least on 2024-01-14.

_year='24'
_prevyear="$(( ${_year} - 1 ))"

_pkgname=idos-timetable-browser-license-installer
pkgname="${_pkgname}-latest"
epoch=2
_pkgver="20${_prevyear}_20${_year}"
pkgver="${_pkgver}"
pkgrel=1
pkgdesc="If you purchased IDOS for Windows by CHAPS, then this installs the license. You need to enter your ZIP-extraction-code and your setup-code during installation. Runs an interactive GUI software via wine during installation."
arch=('i686' 'x86_64')
url="https://www.chaps.cz/eng/order"
license=('custom')

groups=(
  "idos-timetable"
)

depends=(
  "idos-timetable-browser"
)

makedepends=(
  "unzip"
  "wine"
)

optdepends=()

provides=(
  "${_pkgname}=${pkgver}"
  "idos-timetable-browser-license=${pkgver}"
)

conflicts=(
  "${_pkgname}"
  "idos-timetable-browser-license"
)

replaces=("${_pkgname}<=${pkgver}")

_zipfile="IWIN.ZIP"
_target="iwin-${_pkgver}.zip"

source=(
  "${_target}::https://ttakt.chaps.cz/TTAktual/Win/Zip/${_zipfile}"
  "IDOS-Licence.pdf::https://chaps.cz/files/idos/IDOS-Licence.pdf"
  "copying.txt"
  "installer_settings.inf"
  "idos-timetable-browser-license.install"
)

sha256sums=(
  "SKIP"
  "SKIP"
  "6382fff14035c4ec7387e7f0d20d7494e05da3d4c24155090fb39196fa944041"
  "1cdffacf6b199b9a16bb6fedd9a4e08f7e3f897bebb5d891b27601f400f5dffb"
  "f692f387815e7980b418e6e6b2c2965d79f7f9dfe0fc962f6ed3bbfe5f99570a"
)

build() {
  cd "${srcdir}"
  
  WINEPREFIX="${srcdir}/.wine"
  export WINEPREFIX
  
  if locale -a | grep -qE '^cs_CZ'; then
    if locale -a | grep -qE '^cs_CZ' | grep -qi utf8; then
      LC_CTYPE="$(locale -a | grep -E '^cs_CZ' | grep -i utf8 | head -n 1)"
    else
      LC_CTYPE="$(locale -a | grep -E '^cs_CZ' | tail -n 1)"
    fi
    export LC_CTYPE
  fi
  
  _gui_inst="${srcdir}/IDOS"
  
  msg ""
  msg "== Important, please read. =="
  msg ""
  msg "Launching installer GUI."
  msg "Please DO NOT CHANGE INSTALLATION DIRECTORY!"
  msg ""
  msg "If you purchased only a local license, not a network license,"
  msg "please MAKE SURE that the wine-drive we are going to install to"
  msg "is NOT A NETWORK DRIVE but a LOCAL HARDDISK. If necessary,"
  msg "abort, run"
  msg "  WINEPREFIX=${WINEPREFIX} winecfg"
  msg "to reconfigure, and then resume installation (e.g. with makepkg)"
  msg "from where you aborted, without deleting and re-creating"
  msg "${srcdir} and ${WINEPREFIX}."
  msg ""
  msg "Also, do not change the other settings during installation. Only" 
  msg "at the very end, you can uncheck to view the ReadMe.txt."
  msg ""
  msg "Note: The GUI performs a full installation into a temporary"
  msg "directory, but after that only the license file will be"
  msg "extracted and copied to the proper location where the IDOS"
  msg "timetable browser should already be installed."
  msg ""
  
  wine "./Setup.exe" /LOADINF="installer_settings.inf" /DIR="${_gui_inst}"
}


package() {
  _gui_inst="${srcdir}/IDOS"
  
  _instdirbase='/opt/idos-timetable'
  _instdir="${pkgdir}/${_instdirbase}"
  
  install -D -m644 "${_gui_inst}/TT.ttk" "${_instdir}/TT.ttk"
  
  install -D -m644 "${srcdir}/IDOS-Licence.pdf"            "${pkgdir}/usr/share/licenses/${pkgname}/IDOS-Licence.pdf"
  install -D -m644 "${srcdir}/copying.txt"            "${pkgdir}/usr/share/licenses/${pkgname}/copying.txt"
}