]> git.pld-linux.org Git - packages/brltty.git/blob - brltty.spec
- unified
[packages/brltty.git] / brltty.spec
1 # TODO:
2 #       - ocaml bcond is useless now:
3 #               Cannot find ocamlfind.
4 #               BrlAPI Caml bindings will be compiled but not installed.
5 #       - check java stuff
6 #       - create bcond to build with minimal deps (wo ncurses,gpm,at-spi*)
7 #
8 # Conditional build:
9 %bcond_without  apidocs         # documentation generated with doxygen
10 %bcond_with     java            # java bindings
11 %bcond_with     ocaml           # ocaml bindings (NFY)
12 %bcond_without  python          # python bindings
13 %bcond_without  tcl             # tcl bindings
14 %bcond_without  x               # build X11-based utilities
15 #
16 Summary:        Braille display driver for Linux/Unix
17 Summary(pl.UTF-8):      Sterownik do wyświetlaczy Braille'a
18 Name:           brltty
19 Version:        3.9
20 Release:        1
21 Group:          Daemons
22 License:        GPL
23 Source0:        http://mielke.cc/brltty/releases/%{name}-%{version}.tar.gz
24 # Source0-md5:  7ce54ba2d38b7c220870e8c781f36743
25 URL:            http://mielke.cc/brltty/
26 BuildRequires:  at-spi-devel
27 BuildRequires:  autoconf >= 2.53
28 BuildRequires:  automake
29 BuildRequires:  bison
30 #BuildRequires: bluez-devel
31 %{?with_apidocs:BuildRequires:  doxygen}
32 BuildRequires:  gpm-devel
33 %{?with_java:BuildRequires:     jdk}
34 BuildRequires:  ncurses-devel
35 %{?with_ocaml:BuildRequires:    ocaml}
36 BuildRequires:  pkgconfig
37 %{?with_python:BuildRequires:   python-Pyrex}
38 %{?with_python:BuildRequires:   rpm-pythonprov}
39 %{?with_tcl:BuildRequires:      tcl}
40 %{?with_x:BuildRequires:        xorg-lib-libXaw-devel}
41 %{?with_x:BuildRequires:        xorg-lib-libXtst-devel}
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 BRLTTY is a background process (daemon) which provides access to the
46 Linux/Unix console (when in text mode) for a blind person using a
47 refreshable Braille display. It drives the Braille display, and
48 provides complete screen review functionality. Some speech capability
49 has also been incorporated.
50
51 %description -l pl.UTF-8
52 BRLTTY jest demonem, który udostępnia dostęp do linuksowej konsoli (w
53 trybie tekstowym) dla niewidomych używających wyświetlaczy Braille'a z
54 odświeżaniem (refreshable Braille display). BRLTTY steruje
55 wyświetlaczem Braille'a i dostarcza funkcjonalność całkowitego
56 przeglądu ekranu. Do tego pakietu została włączona możliwość syntezy
57 mowy.
58
59 %package -n brlapi
60 Summary:        Application Programming Interface for BRLTTY
61 Summary(pl.UTF-8):      API do BRLTTY
62 Group:          Applications/System
63
64 %description -n brlapi
65 This package provides the run-time support for the Application
66 Programming Interface to BRLTTY.
67
68 Install this package if you have an application which directly
69 accesses a refreshable Braille display.
70
71 %description -n brlapi -l pl.UTF-8
72 Ten pakiet zawiera środowisko uruchomieniowe dla programów
73 korzystających z API BRLTTY.
74
75 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
76 wyświetlacza Braille'a z odświeżaniem.
77
78 %package -n brlapi-devel
79 Summary:        Headers and documentation for BrlAPI
80 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumentacja do BrlAPI
81 Group:          Development/Libraries
82 Requires:       brlapi = %{version}-%{release}
83
84 %description -n brlapi-devel
85 This package provides the header files, shared object linker
86 reference, and reference documentation for BrlAPI (the Application
87 Programming Interface to BRLTTY). It enables the implementation of
88 applications which take direct advantage of a refreshable Braille
89 display in order to present information in ways which are more
90 appropriate for blind users and/or to provide user interfaces which
91 are more specifically atuned to their needs.
92
93 Install this package if you're developing or maintaining an
94 application which directly accesses a refreshable Braille display.
95
96 %description -n brlapi-devel -l pl.UTF-8
97 Ten pakiet zawiera pliki nagłówkowe oraz dokumentację do BrlAPI (API
98 do BRLTTY). BrlAPI pozwala implementować aplikacje, które bezpośrednio
99 korzystają z wyświetlaczy Braille'a dostarczając interfejs użytkownika
100 bardziej przystosowany dla osób niewidomych.
101
102 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
103 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
104
105 %package -n brlapi-static
106 Summary:        Static BrlAPI library
107 Summary(pl.UTF-8):      Statyczna biblioteka BrlAPI
108 Group:          Development/Libraries
109 Requires:       brlapi-devel = %{version}-%{release}
110
111 %description -n brlapi-static
112 This is package with static BrlAPI library.
113
114 %description -n brlapi-static -l pl.UTF-8
115 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
116
117 %package -n brlapi-apidocs
118 Summary:        BrlAPI documentation
119 Summary(pl.UTF-8):      Documentacja BrlAPI
120 Group:          Documentation
121
122 %description -n brlapi-apidocs
123 Documentation for BrlAPI in HTML format generated from brltty
124 sources by doxygen.
125
126 %description -n brlapi-apidocs -l pl.UTF-8
127 Dokumentacja BrlAPI w formacie HTML generowane ze
128 źrodeł brltty przez doxygen.
129
130 %package -n brlapi-java
131 Summary:        BrlAPI library for Java
132 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Javy
133 Group:          Libraries
134 Requires:       brlapi = %{version}-%{release}
135
136 %description -n brlapi-java
137 BrlAPI library for Java.
138
139 %description -n brlapi-java -l pl.UTF-8
140 Biblioteka BrlAPI dla Javy.
141
142 %package -n python-brlapi
143 Summary:        Python interface to BrlAPI
144 Summary(pl.UTF-8):      Pythonowy interfejs do BrlAPI
145 Group:          Libraries
146 Requires:       brlapi = %{version}-%{release}
147
148 %description -n python-brlapi
149 Python interface to BrlAPI.
150
151 %description -n python-brlapi -l pl.UTF-8
152 Pythonowy interfejs do BrlAPI.
153
154 %package -n brlapi-tcl
155 Summary:        BrlAPI library for Tcl
156 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Tcl
157 Group:          Libraries
158 Requires:       brlapi = %{version}-%{release}
159
160 %description -n brlapi-tcl
161 BrlAPI library for Tcl.
162
163 %description -n brlapi-tcl -l pl.UTF-8
164 Biblioteka BrlAPI dla Tcl.
165
166 %prep
167 %setup -q
168
169 %build
170 %{__aclocal}
171 %{__autoconf}
172 cp -f /usr/share/automake/config.sub acdir
173 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
174 %configure \
175         --with-install-root="$RPM_BUILD_ROOT" \
176         --disable-tainted-components \
177         %{!?with_java:--disable-java-bindings} \
178         --enable-api
179 %{__make}
180
181 directory="doc"
182 mkdir -p "$directory"
183 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`
184 do
185         mkdir -p "$directory/${file%/*}"
186         cp -rp "$file" "$directory/$file"
187 done
188
189 %install
190 rm -rf $RPM_BUILD_ROOT
191 %{__make} install
192 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
193
194 %clean
195 rm -rf $RPM_BUILD_ROOT
196
197 %pre
198 # The pre-install scriptlet.
199
200 # If a configuration file already exists then rpm installs the new one as
201 # <path>.rpmnew. If this is done then the .rpmnew file is overwritten if it
202 # already exists.
203
204 # There's no explicit way to tell if a configuration file has been installed
205 # as itself or as a .rpmnew file. The way we'll figure it out, therefore, is by
206 # erasing the .rpmnew file now so that we can see if it gets created later.
207 rm -f "%{_sysconfdir}/brltty.conf.rpmnew"
208
209 %post
210 # The post-install scriptlet.
211
212 # If BRLTTY's boot parameter has been specified then update the just installed
213 # configuration file template to reflect the options supplied thereby.
214
215 # First, we need to determine which file to update. If there's a .rpmnew file
216 # then update it since a previous configuration file must already have existed.
217 file="%{_sysconfdir}/brltty.conf"
218 new="${file}.rpmnew"
219 [ -f "${new}" ] && file="${new}"
220
221 # Update the configuration file template via the Bootdisks/bp2cf script.
222 # Include it right within this scriptlet so that it needn't be installed.
223 # Imbed it within a subshell to ensure that it won't impact this scriptlet.
224 (
225         # First, set bp2cf's command line arguments.
226         set -- -u -f "${file}"
227
228 #!/bin/sh
229 ###############################################################################
230 # BRLTTY - A background process providing access to the Linux console (when in
231 #          text mode) for a blind person using a refreshable Braille display.
232 #
233 # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
234 #
235 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
236 #
237 # This is free software, placed under the terms of the
238 # GNU General Public License, as published by the Free Software
239 # Foundation.  Please see the file COPYING for details.
240 #
241 # Web Page: http://mielke.cc/brltty/
242 #
243 # This software is maintained by Dave Mielke <dave@mielke.cc>.
244 ###############################################################################
245
246 # Convert the boot parameter to configuration file directives.
247 # If /proc is mounted then use the brltty= boot parameter in /proc/cmdline.
248 # If /proc is not mounted then use the brltty environment variable.
249 # Invoke with -h for usage information.
250
251 programName="${0##*/}"
252 programMessage()
253 {
254         echo 2>&1 "${programName}: ${1}"
255 }
256 syntaxError()
257 {
258         programMessage "${1}"
259         exit 2
260 }
261 internalError()
262 {
263         programMessage "${1}"
264         exit 3
265 }
266
267 configurationFile=""
268 requestedAction=create
269 deviceTranslation=none
270 requestedParameter=""
271 OPTIND=1
272 while getopts ":f:cundop:h" option
273 do
274         case "${option}" in
275             f) configurationFile="${OPTARG}";;
276             c) requestedAction=create;;
277             u) requestedAction=update;;
278             n) deviceTranslation=none;;
279             d) deviceTranslation=devfs;;
280             o) deviceTranslation=old;;
281             p) requestedParameter="${OPTARG}";;
282             h)
283                 cat <<EOF
284 Usage: ${programName} [option ...]
285 -f file  The configuration file to create/update.
286 -c       Create the configuration file (write to stdout if no -f).
287 -u       Update the configuration file (copying from stdin to stdout if no -f).
288 -n       Do not translate device paths.
289 -d       Do old-style to devfs device path translation.
290 -o       Do devfs to old-style device path translation.
291 -p [driver][,[device][,[table]]]
292          Explicitly specify the boot parameter.
293 -h       Display this usage summary.
294 EOF
295                 exit 0
296                 ;;
297             \?) syntaxError "unknown option: -${OPTARG}";;
298             :) syntaxError "missing value: -${OPTARG}";;
299             *) internalError "unimplemented option: -${option}";;
300         esac
301 done
302 shift "`expr $OPTIND - 1`"
303 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
304
305 case "${requestedAction}" in
306     create)
307         putConfigurationLine()
308         {
309                 echo "${1}" || exit 4
310         }
311         startConfigurationFile()
312         {
313                 [ -n "${configurationFile}" ] && exec >"${configurationFile}"
314                 putConfigurationLine "`makeHeaderLine Created`"
315                 putConfigurationLine "`makeParameterLine`"
316                 putConfigurationLine ""
317         }
318         putConfigurationDirective()
319         {
320                 putConfigurationLine "${1} ${2}"
321         }
322         finalizeConfigurationFile()
323         {
324                 :
325         }
326         ;;
327     update)
328         putSedCommand()
329         {
330                 sedScript="${sedScript}
331 ${1}"
332         }
333         startConfigurationFile()
334         {
335                 if [ -n "${configurationFile}" ]; then
336                         [ -e "${configurationFile}" ] || syntaxError "file not found: ${configurationFile}"
337                         [ -f "${configurationFile}" ] || syntaxError "not a file: ${configurationFile}"
338                         [ -r "${configurationFile}" ] || syntaxError "file not readable: ${configurationFile}"
339                         [ -w "${configurationFile}" ] || syntaxError "file not writable: ${configurationFile}"
340                         outputFile="${configurationFile}.new"
341                         exec <"${configurationFile}" >"${outputFile}"
342                 fi
343                 sedScript=""
344                 putSedCommand "1i\\
345 `makeHeaderLine Updated`\\
346 `makeParameterLine`\\
347 "
348         }
349         putConfigurationDirective()
350         {
351                 value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`"
352                 putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/"
353                 putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/"
354         }
355         finalizeConfigurationFile()
356         {
357                 sed -e "${sedScript}"
358                 [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}"
359         }
360         ;;
361     *) internalError "unimplemented action: ${requestedAction}";;
362 esac
363
364 translateDevice_none()
365 {
366         :
367 }
368 translateDevice_devfs()
369 {
370         minor="${device#ttyS}"
371         if [ "${minor}" != "${device}" ]; then
372                 device="tts/${minor}"
373                 return 0
374         fi
375         minor="${device#lp}"
376         if [ "${minor}" != "${device}" ]; then
377                 device="printers/${minor}"
378                 return 0
379         fi
380         programMessage "unsupported old-style device: ${device}"
381 }
382 translateDevice_old()
383 {
384         major="${device%%/*}"
385         if [ "${major}" != "${device}" ]; then
386                 minor="${device#*/}"
387                 case "${major}" in
388                     tts) devfs="ttyS${minor}";;
389                     printers) devfs="lp${minor}";;
390                 esac
391         fi
392         if [ -n "${devfs}" ]; then
393                 device="${devfs}"
394         else
395                 programMessage "unsupported devfs device: ${device}"
396         fi
397 }
398
399 makeHeaderLine()
400 {
401         echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
402 }
403 makeParameterLine()
404 {
405         echo "# Boot Parameter:${bootParameter}"
406 }
407 putConfigurationFile()
408 {
409         startConfigurationFile
410         [ -n "${brailleDriver}" ] && putConfigurationDirective "braille-driver" "${brailleDriver}"
411         [ -n "${brailleDevice}" ] && {
412         device="`echo "${brailleDevice}" | sed -e 's%//*%/%g' -e 's%^/dev/%%'`"
413         if [ "${device#/}" = "${device}" ]; then
414                 translateDevice_${deviceTranslation}
415         fi
416         putConfigurationDirective "braille-device" "${device}"
417         }
418         [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
419         finalizeConfigurationFile
420 }
421 parseBootParameter()
422 {
423         bootParameter="${bootParameter} ${1}"
424         number=1
425         while [ "${number}" -le 3 ]; do
426                 cut="cut -d, -f${number}"
427                 [ "${number}" -gt 1 ] && cut="${cut} -s"
428                 operand="`echo ${1} | ${cut}`"
429                 if [ -n "${operand}" ]; then
430                         case "${number}" in
431                             1) brailleDriver="${operand}";;
432                             2) brailleDevice="${operand}";;
433                             3) textTable="${operand}";;
434                         esac
435                 fi
436                 number="`expr ${number} + 1`"
437         done
438 }
439 putBootParameter()
440 {
441         parseBootParameter "${1}"
442         putConfigurationFile
443 }
444 parseBootCommand()
445 {
446         found=false
447         while [ "${#}" -gt 0 ]; do
448                 case "${1}" in
449                     "brltty="*)
450                         found=true
451                         parseBootParameter "${1#*=}"
452                         ;;
453                 esac
454                 shift
455         done
456         "${found}" && putConfigurationFile
457 }
458
459 brailleDriver=""
460 brailleDevice=""
461 textTable=""
462 bootCommandFile="/proc/cmdline"
463 if [ -n "${requestedParameter}" ]; then
464         putBootParameter "${requestedParameter}"
465 elif [ -f "${bootCommandFile}" ]; then
466         parseBootCommand `cat "${bootCommandFile}"`
467 elif [ -n "${brltty}" ]; then
468         putBootParameter "${brltty}"
469 fi
470 exit 0
471 )
472
473 %post   -n brlapi -p /sbin/ldconfig
474 %postun -n brlapi -p /sbin/ldconfig
475
476 %files
477 %defattr(644,root,root,755)
478 %doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO}
479 %doc doc/{Bindings,Bootdisks,BrailleDrivers,BrailleTables,ContractionTables,Patches,README,SpeechDrivers}
480 %attr(755,root,root) %{_bindir}/brltty
481 %attr(755,root,root) %{_bindir}/brltty-install
482 %attr(755,root,root) %{_bindir}/brltty-config
483 %attr(755,root,root) %{_bindir}/vstp
484 %{?with_x:%attr(755,root,root) %{_bindir}/xbrlapi}
485 %dir %{_libdir}/brltty
486 %attr(755,root,root) %{_libdir}/brltty/libbrlttybal.so
487 %attr(755,root,root) %{_libdir}/brltty/libbrlttybat.so
488 %attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so
489 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so
490 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so
491 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so
492 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so
493 %attr(755,root,root) %{_libdir}/brltty/libbrlttybcb.so
494 %attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so
495 %attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so
496 %attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so
497 %attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so
498 %attr(755,root,root) %{_libdir}/brltty/libbrlttybil.so
499 %attr(755,root,root) %{_libdir}/brltty/libbrlttyblt.so
500 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmb.so
501 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmd.so
502 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmn.so
503 %attr(755,root,root) %{_libdir}/brltty/libbrlttybpm.so
504 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtn.so
505 %attr(755,root,root) %{_libdir}/brltty/libbrlttybts.so
506 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtt.so
507 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvd.so
508 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvo.so
509 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvr.so
510 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvs.so
511 %{?with_x:%attr(755,root,root) %{_libdir}/brltty/libbrlttybxw.so}
512 %attr(755,root,root) %{_libdir}/brltty/libbrlttysal.so
513 %attr(755,root,root) %{_libdir}/brltty/libbrlttysbl.so
514 %attr(755,root,root) %{_libdir}/brltty/libbrlttyscb.so
515 %attr(755,root,root) %{_libdir}/brltty/libbrlttyses.so
516 %attr(755,root,root) %{_libdir}/brltty/libbrlttysfv.so
517 %attr(755,root,root) %{_libdir}/brltty/libbrlttysgs.so
518 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxas.so
519 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxlx.so
520 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so
521 %{_sysconfdir}/brltty
522 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf
523 %{_mandir}/man1/brltty.1*
524 %{_mandir}/man1/vstp.1*
525
526 %files -n brlapi
527 %defattr(644,root,root,755)
528 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5
529 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5.1
530 %dir %{_libdir}/brlapi-0.5.1
531
532 %files -n brlapi-devel
533 %defattr(644,root,root,755)
534 %doc Documents/README.Gnopernicus
535 %doc Documents/Manual-BrlAPI/English/BrlAPI*
536 %attr(755,root,root) %{_libdir}/libbrlapi.so
537 %{_includedir}/brltty
538 %{_includedir}/brlapi*.h
539 %{_mandir}/man3/*
540
541 %files -n brlapi-static
542 %defattr(644,root,root,755)
543 %{_libdir}/libbrlapi.a
544
545 %if %{with apidocs}
546 %files -n brlapi-apidocs
547 %defattr(644,root,root,755)
548 %doc Documents/BrlAPIref/html/*
549 %endif
550
551 %if %{with java}
552 %files -n brlapi-java
553 %defattr(644,root,root,755)
554 %{_libdir}/java/libbrlapi_java.so
555 %{_javadir}/brlapi.jar
556 %endif
557
558 %if %{with python}
559 %files -n python-brlapi
560 %defattr(644,root,root,755)
561 %{py_sitedir}/Brlapi-*.egg-info
562 %attr(755,root,root) %{py_sitedir}/brlapi.so
563 %endif
564
565 %if %{with tcl}
566 %files -n brlapi-tcl
567 %defattr(644,root,root,755)
568 %attr(755,root,root) %{_libdir}/brlapi-0.5.1/libbrlapi_tcl.so
569 %{_libdir}/brlapi-0.5.1/pkgIndex.tcl
570 %endif
This page took 0.152571 seconds and 4 git commands to generate.