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