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