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