]> git.pld-linux.org Git - packages/brltty.git/blob - brltty.spec
996a4823953e295ed8912c7d13d9c6a1ecaa7137
[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:        2
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 # libbrlttyblb
46 #BR: libbraile-devel (-lllibbraile <braille.h>)
47 # libbrlttysfl
48 BuildRequires:  flite-devel
49 # libbrlttysmp
50 #BR: Mikropuhe-devel (-lmikropuhe <mpwrfile.h>)
51 # libbrlttyssd
52 #BuildRequires: speech-dispatcher-devel
53 # libbrlttyssw
54 #BR: Swift-devel (-lswift <swift.h>)
55 # libbrlttysth
56 #BR: Theta-devel (-ltheta <theta.h>)
57 # libbrlttysvv
58 #BR: ViaVoice-devel (-lviavoice <eci.h>)
59 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60
61 %description
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.
67
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
74 mowy.
75
76 %package -n brlapi
77 Summary:        Application Programming Interface for BRLTTY
78 Summary(pl.UTF-8):      API do BRLTTY
79 Group:          Applications/System
80
81 %description -n brlapi
82 This package provides the run-time support for the Application
83 Programming Interface to BRLTTY.
84
85 Install this package if you have an application which directly
86 accesses a refreshable Braille display.
87
88 %description -n brlapi -l pl.UTF-8
89 Ten pakiet zawiera środowisko uruchomieniowe dla programów
90 korzystających z API BRLTTY.
91
92 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
93 wyświetlacza Braille'a z odświeżaniem.
94
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}
100
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.
109
110 Install this package if you're developing or maintaining an
111 application which directly accesses a refreshable Braille display.
112
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.
118
119 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
120 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
121
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}
127
128 %description -n brlapi-static
129 This is package with static BrlAPI library.
130
131 %description -n brlapi-static -l pl.UTF-8
132 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
133
134 %package -n brlapi-apidocs
135 Summary:        BrlAPI documentation
136 Summary(pl.UTF-8):      Documentacja BrlAPI
137 Group:          Documentation
138
139 %description -n brlapi-apidocs
140 Documentation for BrlAPI in HTML format generated from brltty
141 sources by doxygen.
142
143 %description -n brlapi-apidocs -l pl.UTF-8
144 Dokumentacja BrlAPI w formacie HTML generowane ze
145 źrodeł brltty przez doxygen.
146
147 %package -n java-brlapi
148 Summary:        BrlAPI library for Java
149 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Javy
150 Group:          Libraries
151 Requires:       brlapi = %{version}-%{release}
152
153 %description -n java-brlapi
154 BrlAPI library for Java.
155
156 %description -n java-brlapi -l pl.UTF-8
157 Biblioteka BrlAPI dla Javy.
158
159 %package -n python-brlapi
160 Summary:        Python interface to BrlAPI
161 Summary(pl.UTF-8):      Pythonowy interfejs do BrlAPI
162 Group:          Libraries
163 Requires:       brlapi = %{version}-%{release}
164
165 %description -n python-brlapi
166 Python interface to BrlAPI.
167
168 %description -n python-brlapi -l pl.UTF-8
169 Pythonowy interfejs do BrlAPI.
170
171 %package -n brlapi-tcl
172 Summary:        BrlAPI library for Tcl
173 Summary(pl.UTF-8):      Biblioteka BrlAPI dla Tcl
174 Group:          Libraries
175 Requires:       brlapi = %{version}-%{release}
176
177 %description -n brlapi-tcl
178 BrlAPI library for Tcl.
179
180 %description -n brlapi-tcl -l pl.UTF-8
181 Biblioteka BrlAPI dla Tcl.
182
183 %prep
184 %setup -q
185
186 %build
187 %{__aclocal}
188 %{__autoconf}
189 cp -f /usr/share/automake/config.sub acdir
190 CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
191 %configure \
192         --with-install-root="$RPM_BUILD_ROOT" \
193         --disable-tainted-components \
194         %{!?with_java:--disable-java-bindings} \
195         --enable-api
196 %{__make}
197
198 directory="doc"
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`
201 do
202         mkdir -p "$directory/${file%/*}"
203         cp -rp "$file" "$directory/$file"
204 done
205
206 %install
207 rm -rf $RPM_BUILD_ROOT
208 %{__make} install
209 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
210
211 %clean
212 rm -rf $RPM_BUILD_ROOT
213
214 %pre
215 # The pre-install scriptlet.
216
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
219 # already exists.
220
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"
225
226 %post
227 # The post-install scriptlet.
228
229 # If BRLTTY's boot parameter has been specified then update the just installed
230 # configuration file template to reflect the options supplied thereby.
231
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"
235 new="${file}.rpmnew"
236 [ -f "${new}" ] && file="${new}"
237
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.
241 (
242         # First, set bp2cf's command line arguments.
243         set -- -u -f "${file}"
244
245 #!/bin/sh
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.
249 #
250 # Copyright (C) 1995-2003 by The BRLTTY Team. All rights reserved.
251 #
252 # BRLTTY comes with ABSOLUTELY NO WARRANTY.
253 #
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.
257 #
258 # Web Page: http://mielke.cc/brltty/
259 #
260 # This software is maintained by Dave Mielke <dave@mielke.cc>.
261 ###############################################################################
262
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.
267
268 programName="${0##*/}"
269 programMessage()
270 {
271         echo 2>&1 "${programName}: ${1}"
272 }
273 syntaxError()
274 {
275         programMessage "${1}"
276         exit 2
277 }
278 internalError()
279 {
280         programMessage "${1}"
281         exit 3
282 }
283
284 configurationFile=""
285 requestedAction=create
286 deviceTranslation=none
287 requestedParameter=""
288 OPTIND=1
289 while getopts ":f:cundop:h" option
290 do
291         case "${option}" in
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}";;
299             h)
300                 cat <<EOF
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.
311 EOF
312                 exit 0
313                 ;;
314             \?) syntaxError "unknown option: -${OPTARG}";;
315             :) syntaxError "missing value: -${OPTARG}";;
316             *) internalError "unimplemented option: -${option}";;
317         esac
318 done
319 shift "`expr $OPTIND - 1`"
320 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
321
322 case "${requestedAction}" in
323     create)
324         putConfigurationLine()
325         {
326                 echo "${1}" || exit 4
327         }
328         startConfigurationFile()
329         {
330                 [ -n "${configurationFile}" ] && exec >"${configurationFile}"
331                 putConfigurationLine "`makeHeaderLine Created`"
332                 putConfigurationLine "`makeParameterLine`"
333                 putConfigurationLine ""
334         }
335         putConfigurationDirective()
336         {
337                 putConfigurationLine "${1} ${2}"
338         }
339         finalizeConfigurationFile()
340         {
341                 :
342         }
343         ;;
344     update)
345         putSedCommand()
346         {
347                 sedScript="${sedScript}
348 ${1}"
349         }
350         startConfigurationFile()
351         {
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}"
359                 fi
360                 sedScript=""
361                 putSedCommand "1i\\
362 `makeHeaderLine Updated`\\
363 `makeParameterLine`\\
364 "
365         }
366         putConfigurationDirective()
367         {
368                 value="`echo "${2}" | sed -e 's%\\([/\\]\\)%\\\\\\1%g'`"
369                 putSedCommand "/^ *#\\(${1} .*\\)/s//\\1/"
370                 putSedCommand "/^ *\\(${1}\\) .*/s//\\1 ${value}/"
371         }
372         finalizeConfigurationFile()
373         {
374                 sed -e "${sedScript}"
375                 [ -n "${outputFile}" ] && mv -f "${outputFile}" "${configurationFile}"
376         }
377         ;;
378     *) internalError "unimplemented action: ${requestedAction}";;
379 esac
380
381 translateDevice_none()
382 {
383         :
384 }
385 translateDevice_devfs()
386 {
387         minor="${device#ttyS}"
388         if [ "${minor}" != "${device}" ]; then
389                 device="tts/${minor}"
390                 return 0
391         fi
392         minor="${device#lp}"
393         if [ "${minor}" != "${device}" ]; then
394                 device="printers/${minor}"
395                 return 0
396         fi
397         programMessage "unsupported old-style device: ${device}"
398 }
399 translateDevice_old()
400 {
401         major="${device%%/*}"
402         if [ "${major}" != "${device}" ]; then
403                 minor="${device#*/}"
404                 case "${major}" in
405                     tts) devfs="ttyS${minor}";;
406                     printers) devfs="lp${minor}";;
407                 esac
408         fi
409         if [ -n "${devfs}" ]; then
410                 device="${devfs}"
411         else
412                 programMessage "unsupported devfs device: ${device}"
413         fi
414 }
415
416 makeHeaderLine()
417 {
418         echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
419 }
420 makeParameterLine()
421 {
422         echo "# Boot Parameter:${bootParameter}"
423 }
424 putConfigurationFile()
425 {
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}
432         fi
433         putConfigurationDirective "braille-device" "${device}"
434         }
435         [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
436         finalizeConfigurationFile
437 }
438 parseBootParameter()
439 {
440         bootParameter="${bootParameter} ${1}"
441         number=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
447                         case "${number}" in
448                             1) brailleDriver="${operand}";;
449                             2) brailleDevice="${operand}";;
450                             3) textTable="${operand}";;
451                         esac
452                 fi
453                 number="`expr ${number} + 1`"
454         done
455 }
456 putBootParameter()
457 {
458         parseBootParameter "${1}"
459         putConfigurationFile
460 }
461 parseBootCommand()
462 {
463         found=false
464         while [ "${#}" -gt 0 ]; do
465                 case "${1}" in
466                     "brltty="*)
467                         found=true
468                         parseBootParameter "${1#*=}"
469                         ;;
470                 esac
471                 shift
472         done
473         "${found}" && putConfigurationFile
474 }
475
476 brailleDriver=""
477 brailleDevice=""
478 textTable=""
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}"
486 fi
487 exit 0
488 )
489
490 %post   -n brlapi -p /sbin/ldconfig
491 %postun -n brlapi -p /sbin/ldconfig
492
493 %files
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*
543
544 %files -n brlapi
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
548
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
556 %{_mandir}/man3/*
557
558 %files -n brlapi-static
559 %defattr(644,root,root,755)
560 %{_libdir}/libbrlapi.a
561
562 %if %{with apidocs}
563 %files -n brlapi-apidocs
564 %defattr(644,root,root,755)
565 %doc Documents/BrlAPIref/html/*
566 %endif
567
568 %if %{with java}
569 %files -n java-brlapi
570 %defattr(644,root,root,755)
571 %{_libdir}/java/libbrlapi_java.so
572 %{_javadir}/brlapi.jar
573 %endif
574
575 %if %{with python}
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
580 %endif
581
582 %if %{with tcl}
583 %files -n brlapi-tcl
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
588 %endif
This page took 0.125605 seconds and 2 git commands to generate.