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