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