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