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