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