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