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