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}
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 BRLTTY is a background process (daemon) which provides access to the
49 Linux/Unix console (when in text mode) for a blind person using a
50 refreshable Braille display. It drives the Braille display, and
51 provides complete screen review functionality. Some speech capability
52 has also been incorporated.
54 %description -l pl.UTF-8
55 BRLTTY jest demonem, który udostępnia dostęp do linuksowej konsoli (w
56 trybie tekstowym) dla niewidomych używających wyświetlaczy Braille'a z
57 odświeżaniem (refreshable Braille display). BRLTTY steruje
58 wyświetlaczem Braille'a i dostarcza funkcjonalność całkowitego
59 przeglądu ekranu. Do tego pakietu została włączona możliwość syntezy
63 Summary: Application Programming Interface for BRLTTY
64 Summary(pl.UTF-8): API do BRLTTY
65 Group: Applications/System
67 %description -n brlapi
68 This package provides the run-time support for the Application
69 Programming Interface to BRLTTY.
71 Install this package if you have an application which directly
72 accesses a refreshable Braille display.
74 %description -n brlapi -l pl.UTF-8
75 Ten pakiet zawiera środowisko uruchomieniowe dla programów
76 korzystających z API BRLTTY.
78 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
79 wyświetlacza Braille'a z odświeżaniem.
81 %package -n brlapi-devel
82 Summary: Headers and documentation for BrlAPI
83 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do BrlAPI
84 Group: Development/Libraries
85 Requires: brlapi = %{version}-%{release}
87 %description -n brlapi-devel
88 This package provides the header files, shared object linker
89 reference, and reference documentation for BrlAPI (the Application
90 Programming Interface to BRLTTY). It enables the implementation of
91 applications which take direct advantage of a refreshable Braille
92 display in order to present information in ways which are more
93 appropriate for blind users and/or to provide user interfaces which
94 are more specifically atuned to their needs.
96 Install this package if you're developing or maintaining an
97 application which directly accesses a refreshable Braille display.
99 %description -n brlapi-devel -l pl.UTF-8
100 Ten pakiet zawiera pliki nagłówkowe oraz dokumentację do BrlAPI (API
101 do BRLTTY). BrlAPI pozwala implementować aplikacje, które bezpośrednio
102 korzystają z wyświetlaczy Braille'a dostarczając interfejs użytkownika
103 bardziej przystosowany dla osób niewidomych.
105 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
106 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
108 %package -n brlapi-static
109 Summary: Static BrlAPI library
110 Summary(pl.UTF-8): Statyczna biblioteka BrlAPI
111 Group: Development/Libraries
112 Requires: brlapi-devel = %{version}-%{release}
114 %description -n brlapi-static
115 This is package with static BrlAPI library.
117 %description -n brlapi-static -l pl.UTF-8
118 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
120 %package -n brlapi-apidocs
121 Summary: BrlAPI documentation
122 Summary(pl.UTF-8): Documentacja BrlAPI
125 %description -n brlapi-apidocs
126 Documentation for BrlAPI in HTML format generated from brltty
129 %description -n brlapi-apidocs -l pl.UTF-8
130 Dokumentacja BrlAPI w formacie HTML generowane ze
131 źrodeł brltty przez doxygen.
133 %package -n java-brlapi
134 Summary: BrlAPI library for Java
135 Summary(pl.UTF-8): Biblioteka BrlAPI dla Javy
137 Requires: brlapi = %{version}-%{release}
139 %description -n java-brlapi
140 BrlAPI library for Java.
142 %description -n java-brlapi -l pl.UTF-8
143 Biblioteka BrlAPI dla Javy.
145 %package -n python-brlapi
146 Summary: Python interface to BrlAPI
147 Summary(pl.UTF-8): Pythonowy interfejs do BrlAPI
149 Requires: brlapi = %{version}-%{release}
151 %description -n python-brlapi
152 Python interface to BrlAPI.
154 %description -n python-brlapi -l pl.UTF-8
155 Pythonowy interfejs do BrlAPI.
157 %package -n brlapi-tcl
158 Summary: BrlAPI library for Tcl
159 Summary(pl.UTF-8): Biblioteka BrlAPI dla Tcl
161 Requires: brlapi = %{version}-%{release}
163 %description -n brlapi-tcl
164 BrlAPI library for Tcl.
166 %description -n brlapi-tcl -l pl.UTF-8
167 Biblioteka BrlAPI dla Tcl.
175 cp -f /usr/share/automake/config.sub acdir
176 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
178 --with-install-root="$RPM_BUILD_ROOT" \
179 --disable-tainted-components \
180 %{!?with_java:--disable-java-bindings} \
185 mkdir -p "$directory"
186 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`
188 mkdir -p "$directory/${file%/*}"
189 cp -rp "$file" "$directory/$file"
193 rm -rf $RPM_BUILD_ROOT
195 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
198 rm -rf $RPM_BUILD_ROOT
201 # The pre-install scriptlet.
203 # If a configuration file already exists then rpm installs the new one as
204 # <path>.rpmnew. If this is done then the .rpmnew file is overwritten if it
207 # There's no explicit way to tell if a configuration file has been installed
208 # as itself or as a .rpmnew file. The way we'll figure it out, therefore, is by
209 # erasing the .rpmnew file now so that we can see if it gets created later.
210 rm -f "%{_sysconfdir}/brltty.conf.rpmnew"
213 # The post-install scriptlet.
215 # If BRLTTY's boot parameter has been specified then update the just installed
216 # configuration file template to reflect the options supplied thereby.
218 # First, we need to determine which file to update. If there's a .rpmnew file
219 # then update it since a previous configuration file must already have existed.
220 file="%{_sysconfdir}/brltty.conf"
222 [ -f "${new}" ] && file="${new}"
224 # Update the configuration file template via the Bootdisks/bp2cf script.
225 # Include it right within this scriptlet so that it needn't be installed.
226 # Imbed it within a subshell to ensure that it won't impact this scriptlet.
228 # First, set bp2cf's command line arguments.
229 set -- -u -f "${file}"
232 ###############################################################################
233 # BRLTTY - A background process providing access to the Linux console (when in
234 # text mode) for a blind person using a refreshable Braille display.
236 # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
238 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
240 # This is free software, placed under the terms of the
241 # GNU General Public License, as published by the Free Software
242 # Foundation. Please see the file COPYING for details.
244 # Web Page: http://mielke.cc/brltty/
246 # This software is maintained by Dave Mielke <dave@mielke.cc>.
247 ###############################################################################
249 # Convert the boot parameter to configuration file directives.
250 # If /proc is mounted then use the brltty= boot parameter in /proc/cmdline.
251 # If /proc is not mounted then use the brltty environment variable.
252 # Invoke with -h for usage information.
254 programName="${0##*/}"
257 echo 2>&1 "${programName}: ${1}"
261 programMessage "${1}"
266 programMessage "${1}"
271 requestedAction=create
272 deviceTranslation=none
273 requestedParameter=""
275 while getopts ":f:cundop:h" option
278 f) configurationFile="${OPTARG}";;
279 c) requestedAction=create;;
280 u) requestedAction=update;;
281 n) deviceTranslation=none;;
282 d) deviceTranslation=devfs;;
283 o) deviceTranslation=old;;
284 p) requestedParameter="${OPTARG}";;
287 Usage: ${programName} [option ...]
288 -f file The configuration file to create/update.
289 -c Create the configuration file (write to stdout if no -f).
290 -u Update the configuration file (copying from stdin to stdout if no -f).
291 -n Do not translate device paths.
292 -d Do old-style to devfs device path translation.
293 -o Do devfs to old-style device path translation.
294 -p [driver][,[device][,[table]]]
295 Explicitly specify the boot parameter.
296 -h Display this usage summary.
300 \?) syntaxError "unknown option: -${OPTARG}";;
301 :) syntaxError "missing value: -${OPTARG}";;
302 *) internalError "unimplemented option: -${option}";;
305 shift "`expr $OPTIND - 1`"
306 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
308 case "${requestedAction}" in
310 putConfigurationLine()
312 echo "${1}" || exit 4
314 startConfigurationFile()
316 [ -n "${configurationFile}" ] && exec >"${configurationFile}"
317 putConfigurationLine "`makeHeaderLine Created`"
318 putConfigurationLine "`makeParameterLine`"
319 putConfigurationLine ""
321 putConfigurationDirective()
323 putConfigurationLine "${1} ${2}"
325 finalizeConfigurationFile()
333 sedScript="${sedScript}
336 startConfigurationFile()
338 if [ -n "${configurationFile}" ]; then
339 [ -e "${configurationFile}" ] || syntaxError "file not found: ${configurationFile}"
340 [ -f "${configurationFile}" ] || syntaxError "not a file: ${configurationFile}"
341 [ -r "${configurationFile}" ] || syntaxError "file not readable: ${configurationFile}"
342 [ -w "${configurationFile}" ] || syntaxError "file not writable: ${configurationFile}"
343 outputFile="${configurationFile}.new"
344 exec <"${configurationFile}" >"${outputFile}"
348 `makeHeaderLine Updated`\\
349 `makeParameterLine`\\
352 putConfigurationDirective()
354 value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`"
355 putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/"
356 putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/"
358 finalizeConfigurationFile()
360 sed -e "${sedScript}"
361 [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}"
364 *) internalError "unimplemented action: ${requestedAction}";;
367 translateDevice_none()
371 translateDevice_devfs()
373 minor="${device#ttyS}"
374 if [ "${minor}" != "${device}" ]; then
375 device="tts/${minor}"
379 if [ "${minor}" != "${device}" ]; then
380 device="printers/${minor}"
383 programMessage "unsupported old-style device: ${device}"
385 translateDevice_old()
387 major="${device%%/*}"
388 if [ "${major}" != "${device}" ]; then
391 tts) devfs="ttyS${minor}";;
392 printers) devfs="lp${minor}";;
395 if [ -n "${devfs}" ]; then
398 programMessage "unsupported devfs device: ${device}"
404 echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
408 echo "# Boot Parameter:${bootParameter}"
410 putConfigurationFile()
412 startConfigurationFile
413 [ -n "${brailleDriver}" ] && putConfigurationDirective "braille-driver" "${brailleDriver}"
414 [ -n "${brailleDevice}" ] && {
415 device="`echo "${brailleDevice}" | sed -e 's%//*%/%g' -e 's%^/dev/%%'`"
416 if [ "${device#/}" = "${device}" ]; then
417 translateDevice_${deviceTranslation}
419 putConfigurationDirective "braille-device" "${device}"
421 [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
422 finalizeConfigurationFile
426 bootParameter="${bootParameter} ${1}"
428 while [ "${number}" -le 3 ]; do
429 cut="cut -d, -f${number}"
430 [ "${number}" -gt 1 ] && cut="${cut} -s"
431 operand="`echo ${1} | ${cut}`"
432 if [ -n "${operand}" ]; then
434 1) brailleDriver="${operand}";;
435 2) brailleDevice="${operand}";;
436 3) textTable="${operand}";;
439 number="`expr ${number} + 1`"
444 parseBootParameter "${1}"
450 while [ "${#}" -gt 0 ]; do
454 parseBootParameter "${1#*=}"
459 "${found}" && putConfigurationFile
465 bootCommandFile="/proc/cmdline"
466 if [ -n "${requestedParameter}" ]; then
467 putBootParameter "${requestedParameter}"
468 elif [ -f "${bootCommandFile}" ]; then
469 parseBootCommand `cat "${bootCommandFile}"`
470 elif [ -n "${brltty}" ]; then
471 putBootParameter "${brltty}"
476 %post -n brlapi -p /sbin/ldconfig
477 %postun -n brlapi -p /sbin/ldconfig
480 %defattr(644,root,root,755)
481 %doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO}
482 %doc doc/{Bindings,Bootdisks,BrailleDrivers,BrailleTables,ContractionTables,Patches,README,SpeechDrivers}
483 %attr(755,root,root) %{_bindir}/brltty
484 %attr(755,root,root) %{_bindir}/brltty-install
485 %attr(755,root,root) %{_bindir}/brltty-config
486 %attr(755,root,root) %{_bindir}/vstp
487 %{?with_x:%attr(755,root,root) %{_bindir}/xbrlapi}
488 %dir %{_libdir}/brltty
489 %attr(755,root,root) %{_libdir}/brltty/libbrlttybal.so
490 %attr(755,root,root) %{_libdir}/brltty/libbrlttybat.so
491 %attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so
492 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so
493 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so
494 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so
495 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so
496 %attr(755,root,root) %{_libdir}/brltty/libbrlttybcb.so
497 %attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so
498 %attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so
499 %attr(755,root,root) %{_libdir}/brltty/libbrlttybfl.so
500 %attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so
501 %attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so
502 %attr(755,root,root) %{_libdir}/brltty/libbrlttybil.so
503 %attr(755,root,root) %{_libdir}/brltty/libbrlttyblt.so
504 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmb.so
505 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmd.so
506 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmn.so
507 %attr(755,root,root) %{_libdir}/brltty/libbrlttybpm.so
508 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtn.so
509 %attr(755,root,root) %{_libdir}/brltty/libbrlttybts.so
510 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtt.so
511 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvd.so
512 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvo.so
513 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvr.so
514 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvs.so
515 %{?with_x:%attr(755,root,root) %{_libdir}/brltty/libbrlttybxw.so}
516 %attr(755,root,root) %{_libdir}/brltty/libbrlttysal.so
517 %attr(755,root,root) %{_libdir}/brltty/libbrlttysbl.so
518 %attr(755,root,root) %{_libdir}/brltty/libbrlttyscb.so
519 %attr(755,root,root) %{_libdir}/brltty/libbrlttyses.so
520 %attr(755,root,root) %{_libdir}/brltty/libbrlttysfv.so
521 %attr(755,root,root) %{_libdir}/brltty/libbrlttysgs.so
522 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxas.so
523 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxlx.so
524 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so
525 %{_sysconfdir}/brltty
526 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf
527 %{_mandir}/man1/brltty.1*
528 %{_mandir}/man1/vstp.1*
531 %defattr(644,root,root,755)
532 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5.1
533 %attr(755,root,root) %ghost %{_libdir}/libbrlapi.so.0.5
535 %files -n brlapi-devel
536 %defattr(644,root,root,755)
537 %doc Documents/README.Gnopernicus
538 %doc Documents/Manual-BrlAPI/English/BrlAPI*
539 %attr(755,root,root) %{_libdir}/libbrlapi.so
540 %{_includedir}/brltty
541 %{_includedir}/brlapi*.h
544 %files -n brlapi-static
545 %defattr(644,root,root,755)
546 %{_libdir}/libbrlapi.a
549 %files -n brlapi-apidocs
550 %defattr(644,root,root,755)
551 %doc Documents/BrlAPIref/html/*
555 %files -n java-brlapi
556 %defattr(644,root,root,755)
557 %{_libdir}/java/libbrlapi_java.so
558 %{_javadir}/brlapi.jar
562 %files -n python-brlapi
563 %defattr(644,root,root,755)
564 %{py_sitedir}/Brlapi-*.egg-info
565 %attr(755,root,root) %{py_sitedir}/brlapi.so
570 %defattr(644,root,root,755)
571 %dir %{_libdir}/brlapi-0.5.1
572 %attr(755,root,root) %{_libdir}/brlapi-0.5.1/libbrlapi_tcl.so
573 %{_libdir}/brlapi-0.5.1/pkgIndex.tcl