]> git.pld-linux.org Git - packages/brltty.git/blob - brltty.spec
- use java-brlapi (not brlapi-java)
[packages/brltty.git] / brltty.spec
1 # TODO:
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.
6 #       - check java stuff
7 #       - create bcond to build with minimal deps (wo ncurses,gpm,at-spi*)
8 #
9 # Conditional build:
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
16 #
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
20 Name:           brltty
21 Version:        3.9
22 Release:        1
23 Group:          Daemons
24 License:        GPL
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
31 BuildRequires:  bison
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)
46
47 %description
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.
53
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
60 mowy.
61
62 %package -n brlapi
63 Summary:        Application Programming Interface for BRLTTY
64 Summary(pl.UTF-8):      API do BRLTTY
65 Group:          Applications/System
66
67 %description -n brlapi
68 This package provides the run-time support for the Application
69 Programming Interface to BRLTTY.
70
71 Install this package if you have an application which directly
72 accesses a refreshable Braille display.
73
74 %description -n brlapi -l pl.UTF-8
75 Ten pakiet zawiera środowisko uruchomieniowe dla programów
76 korzystających z API BRLTTY.
77
78 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
79 wyświetlacza Braille'a z odświeżaniem.
80
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}
86
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.
95
96 Install this package if you're developing or maintaining an
97 application which directly accesses a refreshable Braille display.
98
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.
104
105 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
106 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
107
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}
113
114 %description -n brlapi-static
115 This is package with static BrlAPI library.
116
117 %description -n brlapi-static -l pl.UTF-8
118 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
119
120 %package -n brlapi-apidocs
121 Summary:        BrlAPI documentation
122 Summary(pl.UTF-8):      Documentacja BrlAPI
123 Group:          Documentation
124
125 %description -n brlapi-apidocs
126 Documentation for BrlAPI in HTML format generated from brltty
127 sources by doxygen.
128
129 %description -n brlapi-apidocs -l pl.UTF-8
130 Dokumentacja BrlAPI w formacie HTML generowane ze
131 źrodeł brltty przez doxygen.
132
133 %package -n java-brlapi
134 Summary:        BrlAPI library for Java
135 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Javy
136 Group:          Libraries
137 Requires:       brlapi = %{version}-%{release}
138
139 %description -n java-brlapi
140 BrlAPI library for Java.
141
142 %description -n java-brlapi -l pl.UTF-8
143 Biblioteka BrlAPI dla Javy.
144
145 %package -n python-brlapi
146 Summary:        Python interface to BrlAPI
147 Summary(pl.UTF-8):      Pythonowy interfejs do BrlAPI
148 Group:          Libraries
149 Requires:       brlapi = %{version}-%{release}
150
151 %description -n python-brlapi
152 Python interface to BrlAPI.
153
154 %description -n python-brlapi -l pl.UTF-8
155 Pythonowy interfejs do BrlAPI.
156
157 %package -n brlapi-tcl
158 Summary:        BrlAPI library for Tcl
159 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Tcl
160 Group:          Libraries
161 Requires:       brlapi = %{version}-%{release}
162
163 %description -n brlapi-tcl
164 BrlAPI library for Tcl.
165
166 %description -n brlapi-tcl -l pl.UTF-8
167 Biblioteka BrlAPI dla Tcl.
168
169 %prep
170 %setup -q
171
172 %build
173 %{__aclocal}
174 %{__autoconf}
175 cp -f /usr/share/automake/config.sub acdir
176 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
177 %configure \
178         --with-install-root="$RPM_BUILD_ROOT" \
179         --disable-tainted-components \
180         %{!?with_java:--disable-java-bindings} \
181         --enable-api
182 %{__make}
183
184 directory="doc"
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`
187 do
188         mkdir -p "$directory/${file%/*}"
189         cp -rp "$file" "$directory/$file"
190 done
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194 %{__make} install
195 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
196
197 %clean
198 rm -rf $RPM_BUILD_ROOT
199
200 %pre
201 # The pre-install scriptlet.
202
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
205 # already exists.
206
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"
211
212 %post
213 # The post-install scriptlet.
214
215 # If BRLTTY's boot parameter has been specified then update the just installed
216 # configuration file template to reflect the options supplied thereby.
217
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"
221 new="${file}.rpmnew"
222 [ -f "${new}" ] && file="${new}"
223
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.
227 (
228         # First, set bp2cf's command line arguments.
229         set -- -u -f "${file}"
230
231 #!/bin/sh
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.
235 #
236 # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
237 #
238 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
239 #
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.
243 #
244 # Web Page: http://mielke.cc/brltty/
245 #
246 # This software is maintained by Dave Mielke <dave@mielke.cc>.
247 ###############################################################################
248
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.
253
254 programName="${0##*/}"
255 programMessage()
256 {
257         echo 2>&1 "${programName}: ${1}"
258 }
259 syntaxError()
260 {
261         programMessage "${1}"
262         exit 2
263 }
264 internalError()
265 {
266         programMessage "${1}"
267         exit 3
268 }
269
270 configurationFile=""
271 requestedAction=create
272 deviceTranslation=none
273 requestedParameter=""
274 OPTIND=1
275 while getopts ":f:cundop:h" option
276 do
277         case "${option}" in
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}";;
285             h)
286                 cat <<EOF
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.
297 EOF
298                 exit 0
299                 ;;
300             \?) syntaxError "unknown option: -${OPTARG}";;
301             :) syntaxError "missing value: -${OPTARG}";;
302             *) internalError "unimplemented option: -${option}";;
303         esac
304 done
305 shift "`expr $OPTIND - 1`"
306 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
307
308 case "${requestedAction}" in
309     create)
310         putConfigurationLine()
311         {
312                 echo "${1}" || exit 4
313         }
314         startConfigurationFile()
315         {
316                 [ -n "${configurationFile}" ] && exec >"${configurationFile}"
317                 putConfigurationLine "`makeHeaderLine Created`"
318                 putConfigurationLine "`makeParameterLine`"
319                 putConfigurationLine ""
320         }
321         putConfigurationDirective()
322         {
323                 putConfigurationLine "${1} ${2}"
324         }
325         finalizeConfigurationFile()
326         {
327                 :
328         }
329         ;;
330     update)
331         putSedCommand()
332         {
333                 sedScript="${sedScript}
334 ${1}"
335         }
336         startConfigurationFile()
337         {
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}"
345                 fi
346                 sedScript=""
347                 putSedCommand "1i\\
348 `makeHeaderLine Updated`\\
349 `makeParameterLine`\\
350 "
351         }
352         putConfigurationDirective()
353         {
354                 value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`"
355                 putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/"
356                 putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/"
357         }
358         finalizeConfigurationFile()
359         {
360                 sed -e "${sedScript}"
361                 [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}"
362         }
363         ;;
364     *) internalError "unimplemented action: ${requestedAction}";;
365 esac
366
367 translateDevice_none()
368 {
369         :
370 }
371 translateDevice_devfs()
372 {
373         minor="${device#ttyS}"
374         if [ "${minor}" != "${device}" ]; then
375                 device="tts/${minor}"
376                 return 0
377         fi
378         minor="${device#lp}"
379         if [ "${minor}" != "${device}" ]; then
380                 device="printers/${minor}"
381                 return 0
382         fi
383         programMessage "unsupported old-style device: ${device}"
384 }
385 translateDevice_old()
386 {
387         major="${device%%/*}"
388         if [ "${major}" != "${device}" ]; then
389                 minor="${device#*/}"
390                 case "${major}" in
391                     tts) devfs="ttyS${minor}";;
392                     printers) devfs="lp${minor}";;
393                 esac
394         fi
395         if [ -n "${devfs}" ]; then
396                 device="${devfs}"
397         else
398                 programMessage "unsupported devfs device: ${device}"
399         fi
400 }
401
402 makeHeaderLine()
403 {
404         echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
405 }
406 makeParameterLine()
407 {
408         echo "# Boot Parameter:${bootParameter}"
409 }
410 putConfigurationFile()
411 {
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}
418         fi
419         putConfigurationDirective "braille-device" "${device}"
420         }
421         [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
422         finalizeConfigurationFile
423 }
424 parseBootParameter()
425 {
426         bootParameter="${bootParameter} ${1}"
427         number=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
433                         case "${number}" in
434                             1) brailleDriver="${operand}";;
435                             2) brailleDevice="${operand}";;
436                             3) textTable="${operand}";;
437                         esac
438                 fi
439                 number="`expr ${number} + 1`"
440         done
441 }
442 putBootParameter()
443 {
444         parseBootParameter "${1}"
445         putConfigurationFile
446 }
447 parseBootCommand()
448 {
449         found=false
450         while [ "${#}" -gt 0 ]; do
451                 case "${1}" in
452                     "brltty="*)
453                         found=true
454                         parseBootParameter "${1#*=}"
455                         ;;
456                 esac
457                 shift
458         done
459         "${found}" && putConfigurationFile
460 }
461
462 brailleDriver=""
463 brailleDevice=""
464 textTable=""
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}"
472 fi
473 exit 0
474 )
475
476 %post   -n brlapi -p /sbin/ldconfig
477 %postun -n brlapi -p /sbin/ldconfig
478
479 %files
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*
529
530 %files -n brlapi
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
534
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
542 %{_mandir}/man3/*
543
544 %files -n brlapi-static
545 %defattr(644,root,root,755)
546 %{_libdir}/libbrlapi.a
547
548 %if %{with apidocs}
549 %files -n brlapi-apidocs
550 %defattr(644,root,root,755)
551 %doc Documents/BrlAPIref/html/*
552 %endif
553
554 %if %{with java}
555 %files -n java-brlapi
556 %defattr(644,root,root,755)
557 %{_libdir}/java/libbrlapi_java.so
558 %{_javadir}/brlapi.jar
559 %endif
560
561 %if %{with python}
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
566 %endif
567
568 %if %{with tcl}
569 %files -n brlapi-tcl
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
574 %endif
This page took 0.082968 seconds and 3 git commands to generate.