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