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