2 # - what is that huge %post script?
3 # - ocaml bcond is useless now:
4 # Cannot find ocamlfind.
5 # BrlAPI Caml bindings will be compiled but not installed.
7 # - create bcond to build with minimal deps (wo ncurses,gpm,at-spi*)
10 %bcond_without apidocs # documentation generated with doxygen
11 %bcond_with java # java bindings
12 %bcond_with ocaml # ocaml bindings (NFY)
13 %bcond_without python # python bindings
14 %bcond_without tcl # tcl bindings
15 %bcond_without x # build X11-based utilities
17 %include /usr/lib/rpm/macros.java
18 Summary: Braille display driver for Linux/Unix
19 Summary(pl.UTF-8): Sterownik do wyświetlaczy Braille'a
25 Source0: http://mielke.cc/brltty/releases/%{name}-%{version}.tar.gz
26 # Source0-md5: 7ce54ba2d38b7c220870e8c781f36743
27 URL: http://mielke.cc/brltty/
28 BuildRequires: at-spi-devel
29 BuildRequires: autoconf >= 2.53
30 BuildRequires: automake
32 #BuildRequires: bluez-devel
33 %{?with_apidocs:BuildRequires: doxygen}
34 BuildRequires: gpm-devel
35 %{?with_java:BuildRequires: jdk}
36 BuildRequires: ncurses-devel
37 %{?with_ocaml:BuildRequires: ocaml}
38 BuildRequires: pkgconfig
39 %{?with_python:BuildRequires: python-Pyrex}
40 %{?with_java:BuildRequires: rpm-javaprov}
41 %{?with_python:BuildRequires: rpm-pythonprov}
42 %{?with_tcl:BuildRequires: tcl}
43 %{?with_x:BuildRequires: xorg-lib-libXaw-devel}
44 %{?with_x:BuildRequires: xorg-lib-libXtst-devel}
46 #BR: libbraile-devel (-lllibbraile <braille.h>)
48 BuildRequires: flite-devel
50 #BR: Mikropuhe-devel (-lmikropuhe <mpwrfile.h>)
52 #BuildRequires: speech-dispatcher-devel
54 #BR: Swift-devel (-lswift <swift.h>)
56 #BR: Theta-devel (-ltheta <theta.h>)
58 #BR: ViaVoice-devel (-lviavoice <eci.h>)
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 BRLTTY is a background process (daemon) which provides access to the
63 Linux/Unix console (when in text mode) for a blind person using a
64 refreshable Braille display. It drives the Braille display, and
65 provides complete screen review functionality. Some speech capability
66 has also been incorporated.
68 %description -l pl.UTF-8
69 BRLTTY jest demonem, który udostępnia dostęp do linuksowej konsoli (w
70 trybie tekstowym) dla niewidomych używających wyświetlaczy Braille'a z
71 odświeżaniem (refreshable Braille display). BRLTTY steruje
72 wyświetlaczem Braille'a i dostarcza funkcjonalność całkowitego
73 przeglądu ekranu. Do tego pakietu została włączona możliwość syntezy
77 Summary: Application Programming Interface for BRLTTY
78 Summary(pl.UTF-8): API do BRLTTY
79 Group: Applications/System
81 %description -n brlapi
82 This package provides the run-time support for the Application
83 Programming Interface to BRLTTY.
85 Install this package if you have an application which directly
86 accesses a refreshable Braille display.
88 %description -n brlapi -l pl.UTF-8
89 Ten pakiet zawiera środowisko uruchomieniowe dla programów
90 korzystających z API BRLTTY.
92 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
93 wyświetlacza Braille'a z odświeżaniem.
95 %package -n brlapi-devel
96 Summary: Headers and documentation for BrlAPI
97 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do BrlAPI
98 Group: Development/Libraries
99 Requires: brlapi = %{version}-%{release}
101 %description -n brlapi-devel
102 This package provides the header files, shared object linker
103 reference, and reference documentation for BrlAPI (the Application
104 Programming Interface to BRLTTY). It enables the implementation of
105 applications which take direct advantage of a refreshable Braille
106 display in order to present information in ways which are more
107 appropriate for blind users and/or to provide user interfaces which
108 are more specifically atuned to their needs.
110 Install this package if you're developing or maintaining an
111 application which directly accesses a refreshable Braille display.
113 %description -n brlapi-devel -l pl.UTF-8
114 Ten pakiet zawiera pliki nagłówkowe oraz dokumentację do BrlAPI (API
115 do BRLTTY). BrlAPI pozwala implementować aplikacje, które bezpośrednio
116 korzystają z wyświetlaczy Braille'a dostarczając interfejs użytkownika
117 bardziej przystosowany dla osób niewidomych.
119 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
120 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
122 %package -n brlapi-static
123 Summary: Static BrlAPI library
124 Summary(pl.UTF-8): Statyczna biblioteka BrlAPI
125 Group: Development/Libraries
126 Requires: brlapi-devel = %{version}-%{release}
128 %description -n brlapi-static
129 This is package with static BrlAPI library.
131 %description -n brlapi-static -l pl.UTF-8
132 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
134 %package -n brlapi-apidocs
135 Summary: BrlAPI documentation
136 Summary(pl.UTF-8): Documentacja BrlAPI
139 %description -n brlapi-apidocs
140 Documentation for BrlAPI in HTML format generated from brltty
143 %description -n brlapi-apidocs -l pl.UTF-8
144 Dokumentacja BrlAPI w formacie HTML generowane ze
145 źrodeł brltty przez doxygen.
147 %package -n java-brlapi
148 Summary: BrlAPI library for Java
149 Summary(pl.UTF-8): Biblioteka BrlAPI dla Javy
151 Requires: brlapi = %{version}-%{release}
153 %description -n java-brlapi
154 BrlAPI library for Java.
156 %description -n java-brlapi -l pl.UTF-8
157 Biblioteka BrlAPI dla Javy.
159 %package -n python-brlapi
160 Summary: Python interface to BrlAPI
161 Summary(pl.UTF-8): Pythonowy interfejs do BrlAPI
163 Requires: brlapi = %{version}-%{release}
165 %description -n python-brlapi
166 Python interface to BrlAPI.
168 %description -n python-brlapi -l pl.UTF-8
169 Pythonowy interfejs do BrlAPI.
171 %package -n brlapi-tcl
172 Summary: BrlAPI library for Tcl
173 Summary(pl.UTF-8): Biblioteka BrlAPI dla Tcl
175 Requires: brlapi = %{version}-%{release}
177 %description -n brlapi-tcl
178 BrlAPI library for Tcl.
180 %description -n brlapi-tcl -l pl.UTF-8
181 Biblioteka BrlAPI dla Tcl.
189 cp -f /usr/share/automake/config.sub acdir
190 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
192 --with-install-root="$RPM_BUILD_ROOT" \
193 --disable-tainted-components \
194 %{!?with_java:--disable-java-bindings} \
199 mkdir -p "$directory"
200 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`
202 mkdir -p "$directory/${file%/*}"
203 cp -rp "$file" "$directory/$file"
207 rm -rf $RPM_BUILD_ROOT
209 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
212 rm -rf $RPM_BUILD_ROOT
215 # The pre-install scriptlet.
217 # If a configuration file already exists then rpm installs the new one as
218 # <path>.rpmnew. If this is done then the .rpmnew file is overwritten if it
221 # There's no explicit way to tell if a configuration file has been installed
222 # as itself or as a .rpmnew file. The way we'll figure it out, therefore, is by
223 # erasing the .rpmnew file now so that we can see if it gets created later.
224 rm -f "%{_sysconfdir}/brltty.conf.rpmnew"
227 # The post-install scriptlet.
229 # If BRLTTY's boot parameter has been specified then update the just installed
230 # configuration file template to reflect the options supplied thereby.
232 # First, we need to determine which file to update. If there's a .rpmnew file
233 # then update it since a previous configuration file must already have existed.
234 file="%{_sysconfdir}/brltty.conf"
236 [ -f "${new}" ] && file="${new}"
238 # Update the configuration file template via the Bootdisks/bp2cf script.
239 # Include it right within this scriptlet so that it needn't be installed.
240 # Imbed it within a subshell to ensure that it won't impact this scriptlet.
242 # First, set bp2cf's command line arguments.
243 set -- -u -f "${file}"
246 ###############################################################################
247 # BRLTTY - A background process providing access to the Linux console (when in
248 # text mode) for a blind person using a refreshable Braille display.
250 # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
252 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
254 # This is free software, placed under the terms of the
255 # GNU General Public License, as published by the Free Software
256 # Foundation. Please see the file COPYING for details.
258 # Web Page: http://mielke.cc/brltty/
260 # This software is maintained by Dave Mielke <dave@mielke.cc>.
261 ###############################################################################
263 # Convert the boot parameter to configuration file directives.
264 # If /proc is mounted then use the brltty= boot parameter in /proc/cmdline.
265 # If /proc is not mounted then use the brltty environment variable.
266 # Invoke with -h for usage information.
268 programName="${0##*/}"
271 echo 2>&1 "${programName}: ${1}"
275 programMessage "${1}"
280 programMessage "${1}"
285 requestedAction=create
286 deviceTranslation=none
287 requestedParameter=""
289 while getopts ":f:cundop:h" option
292 f) configurationFile="${OPTARG}";;
293 c) requestedAction=create;;
294 u) requestedAction=update;;
295 n) deviceTranslation=none;;
296 d) deviceTranslation=devfs;;
297 o) deviceTranslation=old;;
298 p) requestedParameter="${OPTARG}";;
301 Usage: ${programName} [option ...]
302 -f file The configuration file to create/update.
303 -c Create the configuration file (write to stdout if no -f).
304 -u Update the configuration file (copying from stdin to stdout if no -f).
305 -n Do not translate device paths.
306 -d Do old-style to devfs device path translation.
307 -o Do devfs to old-style device path translation.
308 -p [driver][,[device][,[table]]]
309 Explicitly specify the boot parameter.
310 -h Display this usage summary.
314 \?) syntaxError "unknown option: -${OPTARG}";;
315 :) syntaxError "missing value: -${OPTARG}";;
316 *) internalError "unimplemented option: -${option}";;
319 shift "`expr $OPTIND - 1`"
320 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
322 case "${requestedAction}" in
324 putConfigurationLine()
326 echo "${1}" || exit 4
328 startConfigurationFile()
330 [ -n "${configurationFile}" ] && exec >"${configurationFile}"
331 putConfigurationLine "`makeHeaderLine Created`"
332 putConfigurationLine "`makeParameterLine`"
333 putConfigurationLine ""
335 putConfigurationDirective()
337 putConfigurationLine "${1} ${2}"
339 finalizeConfigurationFile()
347 sedScript="${sedScript}
350 startConfigurationFile()
352 if [ -n "${configurationFile}" ]; then
353 [ -e "${configurationFile}" ] || syntaxError "file not found: ${configurationFile}"
354 [ -f "${configurationFile}" ] || syntaxError "not a file: ${configurationFile}"
355 [ -r "${configurationFile}" ] || syntaxError "file not readable: ${configurationFile}"
356 [ -w "${configurationFile}" ] || syntaxError "file not writable: ${configurationFile}"
357 outputFile="${configurationFile}.new"
358 exec <"${configurationFile}" >"${outputFile}"
362 `makeHeaderLine Updated`\\
363 `makeParameterLine`\\
366 putConfigurationDirective()
368 value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`"
369 putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/"
370 putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/"
372 finalizeConfigurationFile()
374 sed -e "${sedScript}"
375 [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}"
378 *) internalError "unimplemented action: ${requestedAction}";;
381 translateDevice_none()
385 translateDevice_devfs()
387 minor="${device#ttyS}"
388 if [ "${minor}" != "${device}" ]; then
389 device="tts/${minor}"
393 if [ "${minor}" != "${device}" ]; then
394 device="printers/${minor}"
397 programMessage "unsupported old-style device: ${device}"
399 translateDevice_old()
401 major="${device%%/*}"
402 if [ "${major}" != "${device}" ]; then
405 tts) devfs="ttyS${minor}";;
406 printers) devfs="lp${minor}";;
409 if [ -n "${devfs}" ]; then
412 programMessage "unsupported devfs device: ${device}"
418 echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
422 echo "# Boot Parameter:${bootParameter}"
424 putConfigurationFile()
426 startConfigurationFile
427 [ -n "${brailleDriver}" ] && putConfigurationDirective "braille-driver" "${brailleDriver}"
428 [ -n "${brailleDevice}" ] && {
429 device="`echo "${brailleDevice}" | sed -e 's%//*%/%g' -e 's%^/dev/%%'`"
430 if [ "${device#/}" = "${device}" ]; then
431 translateDevice_${deviceTranslation}
433 putConfigurationDirective "braille-device" "${device}"
435 [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
436 finalizeConfigurationFile
440 bootParameter="${bootParameter} ${1}"
442 while [ "${number}" -le 3 ]; do
443 cut="cut -d, -f${number}"
444 [ "${number}" -gt 1 ] && cut="${cut} -s"
445 operand="`echo ${1} | ${cut}`"
446 if [ -n "${operand}" ]; then
448 1) brailleDriver="${operand}";;
449 2) brailleDevice="${operand}";;
450 3) textTable="${operand}";;
453 number="`expr ${number} + 1`"
458 parseBootParameter "${1}"
464 while [ "${#}" -gt 0 ]; do
468 parseBootParameter "${1#*=}"
473 "${found}" && putConfigurationFile
479 bootCommandFile="/proc/cmdline"
480 if [ -n "${requestedParameter}" ]; then
481 putBootParameter "${requestedParameter}"
482 elif [ -f "${bootCommandFile}" ]; then
483 parseBootCommand `cat "${bootCommandFile}"`
484 elif [ -n "${brltty}" ]; then
485 putBootParameter "${brltty}"
490 %post -n brlapi -p /sbin/ldconfig
491 %postun -n brlapi -p /sbin/ldconfig
494 %defattr(644,root,root,755)
495 %doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO}
496 %doc doc/{Bindings,Bootdisks,BrailleDrivers,BrailleTables,ContractionTables,Patches,README,SpeechDrivers}
497 %attr(755,root,root) %{_bindir}/brltty
498 %attr(755,root,root) %{_bindir}/brltty-install
499 %attr(755,root,root) %{_bindir}/brltty-config
500 %attr(755,root,root) %{_bindir}/vstp
501 %{?with_x:%attr(755,root,root) %{_bindir}/xbrlapi}
502 %dir %{_libdir}/brltty
503 %attr(755,root,root) %{_libdir}/brltty/libbrlttybal.so
504 %attr(755,root,root) %{_libdir}/brltty/libbrlttybat.so
505 %attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so
506 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so
507 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so
508 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so
509 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so
510 %attr(755,root,root) %{_libdir}/brltty/libbrlttybcb.so
511 %attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so
512 %attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so
513 %attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so
514 %attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so
515 %attr(755,root,root) %{_libdir}/brltty/libbrlttybil.so
516 %attr(755,root,root) %{_libdir}/brltty/libbrlttyblt.so
517 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmb.so
518 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmd.so
519 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmn.so
520 %attr(755,root,root) %{_libdir}/brltty/libbrlttybpm.so
521 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtn.so
522 %attr(755,root,root) %{_libdir}/brltty/libbrlttybts.so
523 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtt.so
524 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvd.so
525 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvo.so
526 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvr.so
527 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvs.so
528 %{?with_x:%attr(755,root,root) %{_libdir}/brltty/libbrlttybxw.so}
529 %attr(755,root,root) %{_libdir}/brltty/libbrlttysal.so
530 %attr(755,root,root) %{_libdir}/brltty/libbrlttysbl.so
531 %attr(755,root,root) %{_libdir}/brltty/libbrlttyscb.so
532 %attr(755,root,root) %{_libdir}/brltty/libbrlttyses.so
533 %attr(755,root,root) %{_libdir}/brltty/libbrlttysfl.so
534 %attr(755,root,root) %{_libdir}/brltty/libbrlttysfv.so
535 %attr(755,root,root) %{_libdir}/brltty/libbrlttysgs.so
536 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxas.so
537 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxlx.so
538 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so
539 %{_sysconfdir}/brltty
540 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf
541 %{_mandir}/man1/brltty.1*
542 %{_mandir}/man1/vstp.1*
545 %defattr(644,root,root,755)
546 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5.1
547 %attr(755,root,root) %ghost %{_libdir}/libbrlapi.so.0.5
549 %files -n brlapi-devel
550 %defattr(644,root,root,755)
551 %doc Documents/README.Gnopernicus
552 %doc Documents/Manual-BrlAPI/English/BrlAPI*
553 %attr(755,root,root) %{_libdir}/libbrlapi.so
554 %{_includedir}/brltty
555 %{_includedir}/brlapi*.h
558 %files -n brlapi-static
559 %defattr(644,root,root,755)
560 %{_libdir}/libbrlapi.a
563 %files -n brlapi-apidocs
564 %defattr(644,root,root,755)
565 %doc Documents/BrlAPIref/html/*
569 %files -n java-brlapi
570 %defattr(644,root,root,755)
571 %{_libdir}/java/libbrlapi_java.so
572 %{_javadir}/brlapi.jar
576 %files -n python-brlapi
577 %defattr(644,root,root,755)
578 %{py_sitedir}/Brlapi-*.egg-info
579 %attr(755,root,root) %{py_sitedir}/brlapi.so
584 %defattr(644,root,root,755)
585 %dir %{_libdir}/brlapi-0.5.1
586 %attr(755,root,root) %{_libdir}/brlapi-0.5.1/libbrlapi_tcl.so
587 %{_libdir}/brlapi-0.5.1/pkgIndex.tcl