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