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