]>
Commit | Line | Data |
---|---|---|
3704768a | 1 | # TODO: |
e6a1be7c | 2 | # - what is that huge %post script? |
42577d78 | 3 | # |
608626ec | 4 | # Conditional build: |
82b1c71c | 5 | %bcond_without apidocs # documentation generated with doxygen |
3dcc4a01 | 6 | %bcond_without java # Java bindings |
82b1c71c JB |
7 | %bcond_without ocaml # OCaml bindings |
8 | %bcond_without python # Python bindings | |
75f78027 | 9 | %bcond_without python3 # Python 3.x bindings |
82b1c71c JB |
10 | %bcond_without tcl # Tcl bindings |
11 | %bcond_without x # X11-based utilities | |
12 | %bcond_without gpm # mouse tracking via GPM | |
509de961 | 13 | %bcond_without libbraille # libbraille Braille driver |
82b1c71c JB |
14 | %bcond_without espeak # eSpeak synthesizer driver |
15 | %bcond_without flite # Flite synthesizer driver | |
dfe38ff6 | 16 | %bcond_with mikropuhe # Mikropuhe synthesizer driver [commercial, Finnish] |
82b1c71c | 17 | %bcond_without speech_dispatcher # Speech Dispatcher synthesizer driver |
dfe38ff6 JB |
18 | %bcond_with swift # Swift synthesizer driver [commercial, from Cepstral] |
19 | %bcond_with theta # Theta synthesizer driver [commercial, from Cepstral] | |
20 | %bcond_with viavoice # IBM ViaVoice synthesizer driver [commercial] | |
509de961 JB |
21 | %bcond_without at_spi # AtSpi screen driver |
22 | %bcond_without at_spi2 # AtSpi2 screen driver | |
23 | # | |
ad027d08 | 24 | %define brlapi_ver 0.6.2 |
608626ec | 25 | # |
332e4348 | 26 | %include /usr/lib/rpm/macros.java |
9b20373a | 27 | Summary: Braille display driver for Linux/Unix |
8731bfde | 28 | Summary(pl.UTF-8): Sterownik do wyświetlaczy Braille'a |
91162002 | 29 | Name: brltty |
ad027d08 | 30 | Version: 5.1 |
295e8be4 | 31 | Release: 1 |
9b20373a | 32 | Group: Daemons |
3dcc4a01 | 33 | License: GPL v2+ (brltty and drivers), LGPL v2.1+ (APIs) |
295e8be4 | 34 | Source0: http://mielke.cc/brltty/archive/%{name}-%{version}.tar.xz |
ad027d08 JB |
35 | # Source0-md5: 938769dd1c3c3baf0d6dfafeb11581ec |
36 | Patch0: %{name}-java.patch | |
37 | Patch1: %{name}-speech-dispatcher.patch | |
38 | Patch2: %{name}-python.patch | |
1a7665e9 | 39 | URL: http://mielke.cc/brltty/ |
82b1c71c JB |
40 | BuildRequires: alsa-lib-devel |
41 | %{?with_at_spi:BuildRequires: at-spi-devel} | |
42577d78 | 42 | BuildRequires: autoconf >= 2.62 |
664a738b | 43 | BuildRequires: automake |
91162002 | 44 | BuildRequires: bison |
82b1c71c JB |
45 | # just headers |
46 | BuildRequires: bluez-libs-devel | |
47 | %{?with_at_spi2:BuildRequires: dbus-devel >= 1.0} | |
608626ec | 48 | %{?with_apidocs:BuildRequires: doxygen} |
ed3025fe | 49 | %{?with_espeak:BuildRequires: espeak-devel} |
dfe38ff6 | 50 | %{?with_flite:BuildRequires: flite-devel} |
82b1c71c | 51 | %{?with_gpm:BuildRequires: gpm-devel} |
09255552 | 52 | %{?with_java:BuildRequires: jdk} |
0b1afa7b | 53 | %{?with_java:BuildRequires: jpackage-utils} |
dfe38ff6 | 54 | %{?with_libbraille:BuildRequires: libbraille-devel} |
82b1c71c | 55 | BuildRequires: libicu-devel |
eb77b64b | 56 | BuildRequires: ncurses-devel |
6913fe15 | 57 | %{?with_ocaml:BuildRequires: ocaml} |
ac744b8d | 58 | BuildRequires: pkgconfig |
295e8be4 | 59 | %{?with_python:BuildRequires: python-Cython} |
75f78027 | 60 | %{?with_python3:BuildRequires: python3-Cython} |
332e4348 | 61 | %{?with_java:BuildRequires: rpm-javaprov} |
0bb357f1 | 62 | %{?with_python:BuildRequires: rpm-pythonprov} |
0b1afa7b | 63 | %{?with_speech_dispatcher:BuildRequires: speech-dispatcher-devel >= 0.8} |
295e8be4 JB |
64 | BuildRequires: tar >= 1:1.22 |
65 | %{?with_tcl:BuildRequires: tcl-devel >= 8.5} | |
82b1c71c JB |
66 | %if %{with x} |
67 | BuildRequires: xorg-lib-libX11-devel | |
68 | BuildRequires: xorg-lib-libXaw-devel | |
69 | BuildRequires: xorg-lib-libXext-devel | |
70 | BuildRequires: xorg-lib-libXt-devel | |
71 | BuildRequires: xorg-lib-libXtst-devel | |
72 | %endif | |
295e8be4 | 73 | BuildRequires: xz |
dfe38ff6 JB |
74 | #%{?with_mikropuhe:BuildRequires: Mikropuhe-devel (-lmikropuhe <mpwrfile.h>)} |
75 | #%{?with_swift:BuildRequires: Swift-devel (-lswift <swift.h>)} | |
76 | #%{?with_theta:BuildRequires: Theta-devel (-ltheta <theta.h>)} | |
77 | #%{?with_viavoice:BuildRequires: ViaVoice-devel (-libmeci50 <eci.h>)} | |
91162002 | 78 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
79 | ||
80 | %description | |
81 | BRLTTY is a background process (daemon) which provides access to the | |
82 | Linux/Unix console (when in text mode) for a blind person using a | |
33e3c5f9 | 83 | refreshable Braille display. It drives the Braille display, and |
3b0ec988 | 84 | provides complete screen review functionality. Some speech capability |
91162002 | 85 | has also been incorporated. |
86 | ||
54f59947 JR |
87 | %description -l pl.UTF-8 |
88 | BRLTTY jest demonem, który udostępnia dostęp do linuksowej konsoli (w | |
89 | trybie tekstowym) dla niewidomych używających wyświetlaczy Braille'a z | |
90 | odświeżaniem (refreshable Braille display). BRLTTY steruje | |
91 | wyświetlaczem Braille'a i dostarcza funkcjonalność całkowitego | |
92 | przeglądu ekranu. Do tego pakietu została włączona możliwość syntezy | |
9b20373a | 93 | mowy. |
91162002 | 94 | |
95 | %package -n brlapi | |
9b20373a | 96 | Summary: Application Programming Interface for BRLTTY |
8731bfde | 97 | Summary(pl.UTF-8): API do BRLTTY |
3dcc4a01 JB |
98 | License: LGPL v2.1+ |
99 | Group: Libraries | |
91162002 | 100 | |
101 | %description -n brlapi | |
102 | This package provides the run-time support for the Application | |
103 | Programming Interface to BRLTTY. | |
104 | ||
9b20373a | 105 | Install this package if you have an application which directly |
106 | accesses a refreshable Braille display. | |
91162002 | 107 | |
54f59947 JR |
108 | %description -n brlapi -l pl.UTF-8 |
109 | Ten pakiet zawiera środowisko uruchomieniowe dla programów | |
110 | korzystających z API BRLTTY. | |
91162002 | 111 | |
54f59947 JR |
112 | Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa |
113 | wyświetlacza Braille'a z odświeżaniem. | |
91162002 | 114 | |
115 | %package -n brlapi-devel | |
9b20373a | 116 | Summary: Headers and documentation for BrlAPI |
8731bfde | 117 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do BrlAPI |
3dcc4a01 | 118 | License: LGPL v2.1+ |
3b0ec988 | 119 | Group: Development/Libraries |
664a738b | 120 | Requires: brlapi = %{version}-%{release} |
91162002 | 121 | |
122 | %description -n brlapi-devel | |
9b20373a | 123 | This package provides the header files, shared object linker |
124 | reference, and reference documentation for BrlAPI (the Application | |
3b0ec988 | 125 | Programming Interface to BRLTTY). It enables the implementation of |
9b20373a | 126 | applications which take direct advantage of a refreshable Braille |
127 | display in order to present information in ways which are more | |
128 | appropriate for blind users and/or to provide user interfaces which | |
129 | are more specifically atuned to their needs. | |
91162002 | 130 | |
3b0ec988 | 131 | Install this package if you're developing or maintaining an |
132 | application which directly accesses a refreshable Braille display. | |
91162002 | 133 | |
54f59947 JR |
134 | %description -n brlapi-devel -l pl.UTF-8 |
135 | Ten pakiet zawiera pliki nagłówkowe oraz dokumentację do BrlAPI (API | |
136 | do BRLTTY). BrlAPI pozwala implementować aplikacje, które bezpośrednio | |
137 | korzystają z wyświetlaczy Braille'a dostarczając interfejs użytkownika | |
138 | bardziej przystosowany dla osób niewidomych. | |
91162002 | 139 | |
54f59947 JR |
140 | Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację |
141 | korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a. | |
91162002 | 142 | |
143 | %package -n brlapi-static | |
9b20373a | 144 | Summary: Static BrlAPI library |
8731bfde | 145 | Summary(pl.UTF-8): Statyczna biblioteka BrlAPI |
3dcc4a01 | 146 | License: LGPL v2.1+ |
3b0ec988 | 147 | Group: Development/Libraries |
664a738b | 148 | Requires: brlapi-devel = %{version}-%{release} |
91162002 | 149 | |
150 | %description -n brlapi-static | |
9b20373a | 151 | This is package with static BrlAPI library. |
91162002 | 152 | |
54f59947 JR |
153 | %description -n brlapi-static -l pl.UTF-8 |
154 | Ten pakiet zawiera statyczną wersję biblioteki BrlAPI. | |
91162002 | 155 | |
608626ec SS |
156 | %package -n brlapi-apidocs |
157 | Summary: BrlAPI documentation | |
158 | Summary(pl.UTF-8): Documentacja BrlAPI | |
159 | Group: Documentation | |
160 | ||
161 | %description -n brlapi-apidocs | |
162 | Documentation for BrlAPI in HTML format generated from brltty | |
163 | sources by doxygen. | |
164 | ||
165 | %description -n brlapi-apidocs -l pl.UTF-8 | |
166 | Dokumentacja BrlAPI w formacie HTML generowane ze | |
167 | źrodeł brltty przez doxygen. | |
168 | ||
332e4348 | 169 | %package -n java-brlapi |
09255552 SS |
170 | Summary: BrlAPI library for Java |
171 | Summary(pl.UTF-8): Biblioteka BrlAPI dla Javy | |
3dcc4a01 | 172 | License: LGPL v2.1+ |
09255552 SS |
173 | Group: Libraries |
174 | Requires: brlapi = %{version}-%{release} | |
175 | ||
332e4348 | 176 | %description -n java-brlapi |
09255552 SS |
177 | BrlAPI library for Java. |
178 | ||
332e4348 | 179 | %description -n java-brlapi -l pl.UTF-8 |
09255552 SS |
180 | Biblioteka BrlAPI dla Javy. |
181 | ||
82b1c71c JB |
182 | %package -n ocaml-brlapi |
183 | Summary: OCaml binding for BrlAPI | |
184 | Summary(pl.UTF-8): Wiązania OCamla do BrlAPI | |
3dcc4a01 | 185 | License: LGPL v2.1+ |
82b1c71c JB |
186 | Group: Libraries |
187 | Requires: brlapi = %{version}-%{release} | |
188 | %requires_eq ocaml-runtime | |
189 | ||
190 | %description -n ocaml-brlapi | |
191 | OCaml binding for BrlAPI. | |
192 | ||
193 | %description -n ocaml-brlapi -l pl.UTF-8 | |
194 | Wiązania OCamla do BrlAPI. | |
195 | ||
196 | %package -n ocaml-brlapi-devel | |
197 | Summary: OCaml binding for BrlAPI - development files | |
198 | Summary(pl.UTF-8): Wiązania OCamla do BrlAPI - pliki programistyczne | |
3dcc4a01 | 199 | License: LGPL v2.1+ |
82b1c71c JB |
200 | Group: Libraries |
201 | Requires: ocaml-brlapi = %{version}-%{release} | |
202 | %requires_eq ocaml | |
203 | ||
204 | %description -n ocaml-brlapi-devel | |
205 | OCaml binding for BrlAPI - development files. | |
206 | ||
207 | %description -n ocaml-brlapi-devel -l pl.UTF-8 | |
208 | Wiązania OCamla do BrlAPI - pliki programistyczne. | |
209 | ||
0bb357f1 | 210 | %package -n python-brlapi |
75f78027 JB |
211 | Summary: Python 2.x interface to BrlAPI |
212 | Summary(pl.UTF-8): Interfejs Pythona 2.x do BrlAPI | |
3dcc4a01 | 213 | License: LGPL v2.1+ |
0bb357f1 SS |
214 | Group: Libraries |
215 | Requires: brlapi = %{version}-%{release} | |
216 | ||
217 | %description -n python-brlapi | |
75f78027 | 218 | Python 2.x interface to BrlAPI. |
0bb357f1 SS |
219 | |
220 | %description -n python-brlapi -l pl.UTF-8 | |
75f78027 JB |
221 | Interfejs Pythona 2.x do BrlAPI. |
222 | ||
223 | %package -n python3-brlapi | |
224 | Summary: Python 3.x interface to BrlAPI | |
225 | Summary(pl.UTF-8): Interfejs Pythona 3.x do BrlAPI | |
226 | License: LGPL v2.1+ | |
227 | Group: Libraries | |
228 | Requires: brlapi = %{version}-%{release} | |
229 | ||
230 | %description -n python3-brlapi | |
231 | Python 3.x interface to BrlAPI. | |
232 | ||
233 | %description -n python3-brlapi -l pl.UTF-8 | |
234 | Interfejs Pythona 3.x do BrlAPI. | |
0bb357f1 SS |
235 | |
236 | %package -n brlapi-tcl | |
237 | Summary: BrlAPI library for Tcl | |
238 | Summary(pl.UTF-8): Biblioteka BrlAPI dla Tcl | |
3dcc4a01 | 239 | License: LGPL v2.1+ |
0bb357f1 SS |
240 | Group: Libraries |
241 | Requires: brlapi = %{version}-%{release} | |
242 | ||
243 | %description -n brlapi-tcl | |
244 | BrlAPI library for Tcl. | |
245 | ||
246 | %description -n brlapi-tcl -l pl.UTF-8 | |
247 | Biblioteka BrlAPI dla Tcl. | |
248 | ||
91162002 | 249 | %prep |
250 | %setup -q | |
6c9c25b1 | 251 | %patch0 -p1 |
0b1afa7b JB |
252 | %patch1 -p1 |
253 | %patch2 -p1 | |
91162002 | 254 | |
255 | %build | |
0b1afa7b | 256 | %{__autoconf} |
915167f5 | 257 | CFLAGS="%{rpmcflags} -I/usr/include/ncurses" |
664a738b | 258 | %configure \ |
0b1afa7b | 259 | %{?with_java:JAVA_HOME=%{java_home}} \ |
664a738b | 260 | --with-install-root="$RPM_BUILD_ROOT" \ |
509de961 | 261 | %{!?with_libbraille:--without-libbraille} \ |
82b1c71c JB |
262 | %{!?with_espeak:--without-espeak} \ |
263 | %{!?with_flite:--without-flite} \ | |
264 | %{!?with_speech_dispatcher:--without-speechd} \ | |
265 | %{!?with_ocaml:--disable-caml-bindings} \ | |
266 | %{!?with_gpm:--disable-gpm} \ | |
f50dc761 | 267 | %{!?with_java:--disable-java-bindings} \ |
82b1c71c JB |
268 | %{!?with_python:--disable-python-bindings} \ |
269 | %{!?with_tcl:--disable-tcl-bindings} \ | |
270 | %{!?with_x:--disable-x} \ | |
91162002 | 271 | --enable-api |
245bd38d JR |
272 | |
273 | %{__make} -j1 | |
91162002 | 274 | |
75f78027 JB |
275 | %if %{with python3} |
276 | cd Bindings/Python | |
277 | %{__python3} setup.py build \ | |
278 | -b build-3 | |
279 | cd ../.. | |
280 | %endif | |
281 | ||
91162002 | 282 | directory="doc" |
283 | mkdir -p "$directory" | |
284 | for file in `find . \( -path "./$directory" -o -path ./Documents \) -prune -o \( -name 'README*' -o -name '*.txt' -o -name '*.html' -o -name '*.sgml' -o \( -path "./Bootdisks/*" -type f -perm +ugo=x \) \) -print` | |
285 | do | |
9b20373a | 286 | mkdir -p "$directory/${file%/*}" |
287 | cp -rp "$file" "$directory/$file" | |
91162002 | 288 | done |
289 | ||
290 | %install | |
291 | rm -rf $RPM_BUILD_ROOT | |
82b1c71c JB |
292 | |
293 | %{__make} -j1 install \ | |
294 | OCAML_INSTALL_TARGET=install-without-findlib | |
295 | ||
75f78027 JB |
296 | %if %{with python3} |
297 | cd Bindings/Python | |
298 | %{__python3} setup.py \ | |
299 | build \ | |
300 | -b build-3 \ | |
301 | install \ | |
302 | --optimize=2 \ | |
303 | --skip-build \ | |
304 | --root=$RPM_BUILD_ROOT | |
305 | cd ../.. | |
306 | %endif | |
307 | ||
538473c2 JR |
308 | %if %{_lib} != "lib" |
309 | # Fix java plugin install path on 64-bit archs | |
310 | install -d $RPM_BUILD_ROOT%{_libdir}/java | |
311 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/{lib,%{_lib}}/java/libbrlapi_java.so | |
312 | %endif | |
313 | ||
3b0ec988 | 314 | install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir} |
91162002 | 315 | |
82b1c71c JB |
316 | install -d $RPM_BUILD_ROOT/usr/lib/tmpfiles.d |
317 | cat >$RPM_BUILD_ROOT/usr/lib/tmpfiles.d/brltty.conf <<EOF | |
318 | d /var/run/brltty 0755 root root - | |
319 | EOF | |
320 | ||
295e8be4 JB |
321 | %find_lang %{name} |
322 | ||
91162002 | 323 | %clean |
324 | rm -rf $RPM_BUILD_ROOT | |
325 | ||
326 | %pre | |
327 | # The pre-install scriptlet. | |
328 | ||
329 | # If a configuration file already exists then rpm installs the new one as | |
330 | # <path>.rpmnew. If this is done then the .rpmnew file is overwritten if it | |
331 | # already exists. | |
332 | ||
333 | # There's no explicit way to tell if a configuration file has been installed | |
334 | # as itself or as a .rpmnew file. The way we'll figure it out, therefore, is by | |
3b0ec988 | 335 | # erasing the .rpmnew file now so that we can see if it gets created later. |
91162002 | 336 | rm -f "%{_sysconfdir}/brltty.conf.rpmnew" |
337 | ||
338 | %post | |
339 | # The post-install scriptlet. | |
340 | ||
341 | # If BRLTTY's boot parameter has been specified then update the just installed | |
342 | # configuration file template to reflect the options supplied thereby. | |
343 | ||
344 | # First, we need to determine which file to update. If there's a .rpmnew file | |
345 | # then update it since a previous configuration file must already have existed. | |
346 | file="%{_sysconfdir}/brltty.conf" | |
347 | new="${file}.rpmnew" | |
348 | [ -f "${new}" ] && file="${new}" | |
349 | ||
350 | # Update the configuration file template via the Bootdisks/bp2cf script. | |
351 | # Include it right within this scriptlet so that it needn't be installed. | |
352 | # Imbed it within a subshell to ensure that it won't impact this scriptlet. | |
353 | ( | |
c247b245 | 354 | # First, set bp2cf's command line arguments. |
355 | set -- -u -f "${file}" | |
91162002 | 356 | |
357 | #!/bin/sh | |
358 | ############################################################################### | |
359 | # BRLTTY - A background process providing access to the Linux console (when in | |
9b20373a | 360 | # text mode) for a blind person using a refreshable Braille display. |
91162002 | 361 | # |
362 | # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved. | |
363 | # | |
364 | # BRLTTY comes with ABSOLUTELY NO WARRANTY. | |
365 | # | |
366 | # This is free software, placed under the terms of the | |
367 | # GNU General Public License, as published by the Free Software | |
368 | # Foundation. Please see the file COPYING for details. | |
369 | # | |
370 | # Web Page: http://mielke.cc/brltty/ | |
371 | # | |
372 | # This software is maintained by Dave Mielke <dave@mielke.cc>. | |
373 | ############################################################################### | |
374 | ||
375 | # Convert the boot parameter to configuration file directives. | |
376 | # If /proc is mounted then use the brltty= boot parameter in /proc/cmdline. | |
377 | # If /proc is not mounted then use the brltty environment variable. | |
378 | # Invoke with -h for usage information. | |
379 | ||
380 | programName="${0##*/}" | |
381 | programMessage() | |
382 | { | |
c247b245 | 383 | echo 2>&1 "${programName}: ${1}" |
91162002 | 384 | } |
385 | syntaxError() | |
386 | { | |
c247b245 | 387 | programMessage "${1}" |
388 | exit 2 | |
91162002 | 389 | } |
390 | internalError() | |
391 | { | |
c247b245 | 392 | programMessage "${1}" |
393 | exit 3 | |
91162002 | 394 | } |
395 | ||
396 | configurationFile="" | |
397 | requestedAction=create | |
398 | deviceTranslation=none | |
399 | requestedParameter="" | |
400 | OPTIND=1 | |
401 | while getopts ":f:cundop:h" option | |
402 | do | |
c247b245 | 403 | case "${option}" in |
404 | f) configurationFile="${OPTARG}";; | |
405 | c) requestedAction=create;; | |
406 | u) requestedAction=update;; | |
407 | n) deviceTranslation=none;; | |
408 | d) deviceTranslation=devfs;; | |
409 | o) deviceTranslation=old;; | |
410 | p) requestedParameter="${OPTARG}";; | |
411 | h) | |
412 | cat <<EOF | |
91162002 | 413 | Usage: ${programName} [option ...] |
414 | -f file The configuration file to create/update. | |
415 | -c Create the configuration file (write to stdout if no -f). | |
416 | -u Update the configuration file (copying from stdin to stdout if no -f). | |
417 | -n Do not translate device paths. | |
418 | -d Do old-style to devfs device path translation. | |
419 | -o Do devfs to old-style device path translation. | |
420 | -p [driver][,[device][,[table]]] | |
421 | Explicitly specify the boot parameter. | |
422 | -h Display this usage summary. | |
423 | EOF | |
c247b245 | 424 | exit 0 |
425 | ;; | |
426 | \?) syntaxError "unknown option: -${OPTARG}";; | |
427 | :) syntaxError "missing value: -${OPTARG}";; | |
428 | *) internalError "unimplemented option: -${option}";; | |
429 | esac | |
91162002 | 430 | done |
431 | shift "`expr $OPTIND - 1`" | |
432 | [ "${#}" -eq 0 ] || syntaxError "too many parameters." | |
433 | ||
c247b245 | 434 | case "${requestedAction}" in |
435 | create) | |
436 | putConfigurationLine() | |
437 | { | |
438 | echo "${1}" || exit 4 | |
439 | } | |
440 | startConfigurationFile() | |
441 | { | |
442 | [ -n "${configurationFile}" ] && exec >"${configurationFile}" | |
443 | putConfigurationLine "`makeHeaderLine Created`" | |
444 | putConfigurationLine "`makeParameterLine`" | |
445 | putConfigurationLine "" | |
446 | } | |
447 | putConfigurationDirective() | |
448 | { | |
449 | putConfigurationLine "${1} ${2}" | |
450 | } | |
451 | finalizeConfigurationFile() | |
452 | { | |
453 | : | |
454 | } | |
455 | ;; | |
456 | update) | |
457 | putSedCommand() | |
458 | { | |
459 | sedScript="${sedScript} | |
91162002 | 460 | ${1}" |
c247b245 | 461 | } |
462 | startConfigurationFile() | |
463 | { | |
106ddbb5 | 464 | if [ -n "${configurationFile}" ]; then |
c247b245 | 465 | [ -e "${configurationFile}" ] || syntaxError "file not found: ${configurationFile}" |
466 | [ -f "${configurationFile}" ] || syntaxError "not a file: ${configurationFile}" | |
467 | [ -r "${configurationFile}" ] || syntaxError "file not readable: ${configurationFile}" | |
468 | [ -w "${configurationFile}" ] || syntaxError "file not writable: ${configurationFile}" | |
469 | outputFile="${configurationFile}.new" | |
470 | exec <"${configurationFile}" >"${outputFile}" | |
471 | fi | |
472 | sedScript="" | |
473 | putSedCommand "1i\\ | |
91162002 | 474 | `makeHeaderLine Updated`\\ |
475 | `makeParameterLine`\\ | |
476 | " | |
c247b245 | 477 | } |
478 | putConfigurationDirective() | |
479 | { | |
480 | value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`" | |
481 | putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/" | |
482 | putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/" | |
483 | } | |
484 | finalizeConfigurationFile() | |
485 | { | |
486 | sed -e "${sedScript}" | |
487 | [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}" | |
488 | } | |
489 | ;; | |
490 | *) internalError "unimplemented action: ${requestedAction}";; | |
91162002 | 491 | esac |
492 | ||
493 | translateDevice_none() | |
494 | { | |
c247b245 | 495 | : |
91162002 | 496 | } |
497 | translateDevice_devfs() | |
498 | { | |
c247b245 | 499 | minor="${device#ttyS}" |
106ddbb5 | 500 | if [ "${minor}" != "${device}" ]; then |
c247b245 | 501 | device="tts/${minor}" |
502 | return 0 | |
503 | fi | |
504 | minor="${device#lp}" | |
106ddbb5 | 505 | if [ "${minor}" != "${device}" ]; then |
c247b245 | 506 | device="printers/${minor}" |
507 | return 0 | |
508 | fi | |
509 | programMessage "unsupported old-style device: ${device}" | |
91162002 | 510 | } |
511 | translateDevice_old() | |
512 | { | |
c247b245 | 513 | major="${device%%/*}" |
106ddbb5 | 514 | if [ "${major}" != "${device}" ]; then |
c247b245 | 515 | minor="${device#*/}" |
516 | case "${major}" in | |
517 | tts) devfs="ttyS${minor}";; | |
518 | printers) devfs="lp${minor}";; | |
519 | esac | |
520 | fi | |
106ddbb5 | 521 | if [ -n "${devfs}" ]; then |
c247b245 | 522 | device="${devfs}" |
523 | else | |
524 | programMessage "unsupported devfs device: ${device}" | |
525 | fi | |
91162002 | 526 | } |
527 | ||
528 | makeHeaderLine() | |
529 | { | |
c247b245 | 530 | echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`." |
91162002 | 531 | } |
532 | makeParameterLine() | |
533 | { | |
c247b245 | 534 | echo "# Boot Parameter:${bootParameter}" |
91162002 | 535 | } |
536 | putConfigurationFile() | |
537 | { | |
c247b245 | 538 | startConfigurationFile |
539 | [ -n "${brailleDriver}" ] && putConfigurationDirective "braille-driver" "${brailleDriver}" | |
540 | [ -n "${brailleDevice}" ] && { | |
541 | device="`echo "${brailleDevice}" | sed -e 's%//*%/%g' -e 's%^/dev/%%'`" | |
106ddbb5 | 542 | if [ "${device#/}" = "${device}" ]; then |
c247b245 | 543 | translateDevice_${deviceTranslation} |
544 | fi | |
545 | putConfigurationDirective "braille-device" "${device}" | |
546 | } | |
547 | [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}" | |
548 | finalizeConfigurationFile | |
91162002 | 549 | } |
550 | parseBootParameter() | |
551 | { | |
c247b245 | 552 | bootParameter="${bootParameter} ${1}" |
553 | number=1 | |
106ddbb5 | 554 | while [ "${number}" -le 3 ]; do |
c247b245 | 555 | cut="cut -d, -f${number}" |
556 | [ "${number}" -gt 1 ] && cut="${cut} -s" | |
557 | operand="`echo ${1} | ${cut}`" | |
106ddbb5 | 558 | if [ -n "${operand}" ]; then |
c247b245 | 559 | case "${number}" in |
560 | 1) brailleDriver="${operand}";; | |
561 | 2) brailleDevice="${operand}";; | |
562 | 3) textTable="${operand}";; | |
563 | esac | |
564 | fi | |
565 | number="`expr ${number} + 1`" | |
566 | done | |
91162002 | 567 | } |
568 | putBootParameter() | |
569 | { | |
c247b245 | 570 | parseBootParameter "${1}" |
571 | putConfigurationFile | |
91162002 | 572 | } |
573 | parseBootCommand() | |
574 | { | |
c247b245 | 575 | found=false |
106ddbb5 | 576 | while [ "${#}" -gt 0 ]; do |
c247b245 | 577 | case "${1}" in |
578 | "brltty="*) | |
579 | found=true | |
580 | parseBootParameter "${1#*=}" | |
581 | ;; | |
582 | esac | |
583 | shift | |
584 | done | |
585 | "${found}" && putConfigurationFile | |
91162002 | 586 | } |
587 | ||
588 | brailleDriver="" | |
589 | brailleDevice="" | |
590 | textTable="" | |
591 | bootCommandFile="/proc/cmdline" | |
106ddbb5 | 592 | if [ -n "${requestedParameter}" ]; then |
c247b245 | 593 | putBootParameter "${requestedParameter}" |
106ddbb5 | 594 | elif [ -f "${bootCommandFile}" ]; then |
c247b245 | 595 | parseBootCommand `cat "${bootCommandFile}"` |
106ddbb5 | 596 | elif [ -n "${brltty}" ]; then |
c247b245 | 597 | putBootParameter "${brltty}" |
91162002 | 598 | fi |
599 | exit 0 | |
600 | ) | |
601 | ||
9b20373a | 602 | %post -n brlapi -p /sbin/ldconfig |
603 | %postun -n brlapi -p /sbin/ldconfig | |
91162002 | 604 | |
295e8be4 | 605 | %files -f %{name}.lang |
91162002 | 606 | %defattr(644,root,root,755) |
c0ab824f | 607 | %doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO} |
b538cd8d | 608 | %doc doc/{Bindings,Bootdisks,Drivers,Patches,Tables,README,nsistrings.txt} |
91162002 | 609 | %attr(755,root,root) %{_bindir}/brltty |
c0ab824f | 610 | %attr(755,root,root) %{_bindir}/brltty-config |
509de961 JB |
611 | %attr(755,root,root) %{_bindir}/brltty-ctb |
612 | %attr(755,root,root) %{_bindir}/brltty-install | |
613 | %attr(755,root,root) %{_bindir}/brltty-trtxt | |
614 | %attr(755,root,root) %{_bindir}/brltty-ttb | |
295e8be4 | 615 | %attr(755,root,root) %{_bindir}/eutp |
18f080b9 | 616 | %attr(755,root,root) %{_bindir}/vstp |
eb77b64b | 617 | %{?with_x:%attr(755,root,root) %{_bindir}/xbrlapi} |
91162002 | 618 | %dir %{_libdir}/brltty |
82b1c71c | 619 | # Braille drivers |
c0ab824f SS |
620 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybal.so |
621 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybat.so | |
622 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so | |
82b1c71c | 623 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybbc.so |
c0ab824f SS |
624 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so |
625 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so | |
626 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so | |
627 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so | |
628 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybcb.so | |
0b1afa7b | 629 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybce.so |
c0ab824f SS |
630 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so |
631 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so | |
632 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so | |
82b1c71c | 633 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybhm.so |
c0ab824f | 634 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so |
509de961 | 635 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybhw.so |
509de961 JB |
636 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybir.so |
637 | %{?with_libbraille:%attr(755,root,root) %{_libdir}/brltty/libbrlttyblb.so} | |
c0ab824f SS |
638 | %attr(755,root,root) %{_libdir}/brltty/libbrlttyblt.so |
639 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybmb.so | |
640 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybmd.so | |
295e8be4 | 641 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybmm.so |
c0ab824f | 642 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybmn.so |
82b1c71c | 643 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybmt.so |
509de961 | 644 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybnp.so |
82b1c71c | 645 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybpg.so |
c0ab824f | 646 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybpm.so |
82b1c71c | 647 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybsk.so |
c0ab824f SS |
648 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybtn.so |
649 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybts.so | |
650 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybtt.so | |
651 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybvd.so | |
652 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybvo.so | |
653 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybvr.so | |
654 | %attr(755,root,root) %{_libdir}/brltty/libbrlttybvs.so | |
eb77b64b | 655 | %{?with_x:%attr(755,root,root) %{_libdir}/brltty/libbrlttybxw.so} |
82b1c71c | 656 | # speech synthesizer drivers |
c0ab824f SS |
657 | %attr(755,root,root) %{_libdir}/brltty/libbrlttysal.so |
658 | %attr(755,root,root) %{_libdir}/brltty/libbrlttysbl.so | |
659 | %attr(755,root,root) %{_libdir}/brltty/libbrlttyscb.so | |
82b1c71c JB |
660 | %{?with_espeak:%attr(755,root,root) %{_libdir}/brltty/libbrlttyses.so} |
661 | %{?with_flite:%attr(755,root,root) %{_libdir}/brltty/libbrlttysfl.so} | |
c0ab824f SS |
662 | %attr(755,root,root) %{_libdir}/brltty/libbrlttysfv.so |
663 | %attr(755,root,root) %{_libdir}/brltty/libbrlttysgs.so | |
dfe38ff6 | 664 | %{?with_mikropuhe:%attr(755,root,root) %{_libdir}/brltty/libbrlttysmp.so} |
82b1c71c | 665 | %{?with_speech_dispatcher:%attr(755,root,root) %{_libdir}/brltty/libbrlttyssd.so} |
dfe38ff6 JB |
666 | %{?with_swift:%attr(755,root,root) %{_libdir}/brltty/libbrlttyssw.so} |
667 | %{?with_theta:%attr(755,root,root) %{_libdir}/brltty/libbrlttysth.so} | |
668 | %{?with_viavoice:%attr(755,root,root) %{_libdir}/brltty/libbrlttysvv.so} | |
b538cd8d | 669 | %attr(755,root,root) %{_libdir}/brltty/libbrlttysxs.so |
82b1c71c | 670 | # screen drivers |
681d76a3 | 671 | %{?with_at_spi2:%attr(755,root,root) %{_libdir}/brltty/libbrlttyxa2.so} |
82b1c71c JB |
672 | %{?with_at_spi:%attr(755,root,root) %{_libdir}/brltty/libbrlttyxas.so} |
673 | %attr(755,root,root) %{_libdir}/brltty/libbrlttyxlx.so | |
674 | %attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so | |
91162002 | 675 | %{_sysconfdir}/brltty |
1c33f0ca | 676 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf |
82b1c71c JB |
677 | /usr/lib/tmpfiles.d/brltty.conf |
678 | %dir /var/lib/BrlAPI | |
679 | %dir /var/run/brltty | |
c0ab824f | 680 | %{_mandir}/man1/brltty.1* |
295e8be4 | 681 | %{_mandir}/man1/eutp.1* |
c0ab824f | 682 | %{_mandir}/man1/vstp.1* |
b538cd8d | 683 | %{?with_x:%{_mandir}/man1/xbrlapi.1*} |
91162002 | 684 | |
295e8be4 JB |
685 | %if %{with x} |
686 | # gdm autostart - subpackage? | |
687 | #%{_datadir}/gdm/greeter/autostart/xbrlapi.desktop | |
688 | %endif | |
689 | ||
91162002 | 690 | %files -n brlapi |
691 | %defattr(644,root,root,755) | |
82b1c71c | 692 | %attr(755,root,root) %{_libdir}/libbrlapi.so.*.*.* |
0b1afa7b | 693 | %attr(755,root,root) %ghost %{_libdir}/libbrlapi.so.0.6 |
91162002 | 694 | |
695 | %files -n brlapi-devel | |
696 | %defattr(644,root,root,755) | |
608626ec | 697 | %doc Documents/Manual-BrlAPI/English/BrlAPI* |
1c33f0ca | 698 | %attr(755,root,root) %{_libdir}/libbrlapi.so |
91162002 | 699 | %{_includedir}/brltty |
18f080b9 | 700 | %{_includedir}/brlapi*.h |
82b1c71c | 701 | %{_mandir}/man3/brlapi_*.3* |
91162002 | 702 | |
703 | %files -n brlapi-static | |
704 | %defattr(644,root,root,755) | |
705 | %{_libdir}/libbrlapi.a | |
608626ec | 706 | |
09255552 | 707 | %if %{with apidocs} |
608626ec SS |
708 | %files -n brlapi-apidocs |
709 | %defattr(644,root,root,755) | |
710 | %doc Documents/BrlAPIref/html/* | |
09255552 SS |
711 | %endif |
712 | ||
713 | %if %{with java} | |
332e4348 | 714 | %files -n java-brlapi |
09255552 | 715 | %defattr(644,root,root,755) |
3dcc4a01 | 716 | %attr(755,root,root) %{_libdir}/java/libbrlapi_java.so |
09255552 SS |
717 | %{_javadir}/brlapi.jar |
718 | %endif | |
0bb357f1 | 719 | |
82b1c71c JB |
720 | %if %{with ocaml} |
721 | %files -n ocaml-brlapi | |
722 | %defattr(644,root,root,755) | |
723 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllbrlapi_stubs.so | |
724 | %{_libdir}/ocaml/stublibs/dllbrlapi_stubs.so.owner | |
725 | ||
726 | %files -n ocaml-brlapi-devel | |
727 | %defattr(644,root,root,755) | |
728 | %dir %{_libdir}/ocaml/brlapi | |
729 | %{_libdir}/ocaml/brlapi/META | |
730 | %{_libdir}/ocaml/brlapi/brlapi.cm[aix]* | |
731 | %{_libdir}/ocaml/brlapi/brlapi.mli | |
732 | %{_libdir}/ocaml/brlapi/libbrlapi_stubs.a | |
733 | %endif | |
734 | ||
0bb357f1 SS |
735 | %if %{with python} |
736 | %files -n python-brlapi | |
737 | %defattr(644,root,root,755) | |
0bb357f1 | 738 | %attr(755,root,root) %{py_sitedir}/brlapi.so |
509de961 | 739 | %{py_sitedir}/Brlapi-%{brlapi_ver}-py*.egg-info |
75f78027 JB |
740 | |
741 | %if %{with python3} | |
742 | %files -n python3-brlapi | |
743 | %defattr(644,root,root,755) | |
744 | %attr(755,root,root) %{py3_sitedir}/brlapi.cpython-*.so | |
745 | %{py3_sitedir}/Brlapi-%{brlapi_ver}-py*.egg-info | |
746 | %endif | |
0bb357f1 SS |
747 | %endif |
748 | ||
749 | %if %{with tcl} | |
750 | %files -n brlapi-tcl | |
751 | %defattr(644,root,root,755) | |
509de961 JB |
752 | %dir %{_libdir}/brlapi-%{brlapi_ver} |
753 | %attr(755,root,root) %{_libdir}/brlapi-%{brlapi_ver}/libbrlapi_tcl.so | |
754 | %{_libdir}/brlapi-%{brlapi_ver}/pkgIndex.tcl | |
0bb357f1 | 755 | %endif |