]> git.pld-linux.org Git - packages/brltty.git/blob - brltty.spec
- more verbose files
[packages/brltty.git] / brltty.spec
1 # TODO:
2 #       - check BR
3 #       - more packages (bindings)
4 #
5 Summary:        Braille display driver for Linux/Unix
6 Summary(pl.UTF-8):      Sterownik do wyświetlaczy Braille'a
7 Name:           brltty
8 Version:        3.9
9 Release:        1
10 Group:          Daemons
11 License:        GPL
12 URL:            http://mielke.cc/brltty/
13 Source0:        http://mielke.cc/brltty/releases/%{name}-%{version}.tar.gz
14 # Source0-md5:  7ce54ba2d38b7c220870e8c781f36743
15 BuildRequires:  autoconf >= 2.53
16 BuildRequires:  automake
17 BuildRequires:  bison
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*
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
35 refreshable Braille display. It drives the Braille display, and
36 provides complete screen review functionality. Some speech capability
37 has also been incorporated.
38
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
45 mowy.
46
47 %package -n brlapi
48 Summary:        Application Programming Interface for BRLTTY
49 Summary(pl.UTF-8):      API do BRLTTY
50 Group:          Applications/System
51
52 %description -n brlapi
53 This package provides the run-time support for the Application
54 Programming Interface to BRLTTY.
55
56 Install this package if you have an application which directly
57 accesses a refreshable Braille display.
58
59 %description -n brlapi -l pl.UTF-8
60 Ten pakiet zawiera środowisko uruchomieniowe dla programów
61 korzystających z API BRLTTY.
62
63 Zainstaluj ten pakiet jeśli masz aplikację, która bezpośrednio używa
64 wyświetlacza Braille'a z odświeżaniem.
65
66 %package -n brlapi-devel
67 Summary:        Headers and documentation for BrlAPI
68 Summary(pl.UTF-8):      Pliki nagłówkowe i dokumentacja do BrlAPI
69 Group:          Development/Libraries
70 Requires:       brlapi = %{version}-%{release}
71
72 %description -n brlapi-devel
73 This package provides the header files, shared object linker
74 reference, and reference documentation for BrlAPI (the Application
75 Programming Interface to BRLTTY). It enables the implementation of
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.
80
81 Install this package if you're developing or maintaining an
82 application which directly accesses a refreshable Braille display.
83
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.
89
90 Zainstaluj ten pakiet, jeśli tworzysz lub nadzorujesz aplikację
91 korzystającą bezpośrednio z odświeżalnych wyświetlaczy Braille'a.
92
93 %package -n brlapi-static
94 Summary:        Static BrlAPI library
95 Summary(pl.UTF-8):      Statyczna biblioteka BrlAPI
96 Group:          Development/Libraries
97 Requires:       brlapi-devel = %{version}-%{release}
98
99 %description -n brlapi-static
100 This is package with static BrlAPI library.
101
102 %description -n brlapi-static -l pl.UTF-8
103 Ten pakiet zawiera statyczną wersję biblioteki BrlAPI.
104
105 %prep
106 %setup -q
107
108 %build
109 %{__aclocal}
110 %{__autoconf}
111 cp -f /usr/share/automake/config.sub acdir
112 %configure \
113         --with-install-root="$RPM_BUILD_ROOT" \
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
122         mkdir -p "$directory/${file%/*}"
123         cp -rp "$file" "$directory/$file"
124 done
125
126 %install
127 rm -rf $RPM_BUILD_ROOT
128 %{__make} install
129 install Documents/brltty.conf $RPM_BUILD_ROOT%{_sysconfdir}
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
143 # erasing the .rpmnew file now so that we can see if it gets created later.
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 (
162         # First, set bp2cf's command line arguments.
163         set -- -u -f "${file}"
164
165 #!/bin/sh
166 ###############################################################################
167 # BRLTTY - A background process providing access to the Linux console (when in
168 #          text mode) for a blind person using a refreshable Braille display.
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 {
191         echo 2>&1 "${programName}: ${1}"
192 }
193 syntaxError()
194 {
195         programMessage "${1}"
196         exit 2
197 }
198 internalError()
199 {
200         programMessage "${1}"
201         exit 3
202 }
203
204 configurationFile=""
205 requestedAction=create
206 deviceTranslation=none
207 requestedParameter=""
208 OPTIND=1
209 while getopts ":f:cundop:h" option
210 do
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
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
232                 exit 0
233                 ;;
234             \?) syntaxError "unknown option: -${OPTARG}";;
235             :) syntaxError "missing value: -${OPTARG}";;
236             *) internalError "unimplemented option: -${option}";;
237         esac
238 done
239 shift "`expr $OPTIND - 1`"
240 [ "${#}" -eq 0 ] || syntaxError "too many parameters."
241
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}
268 ${1}"
269         }
270         startConfigurationFile()
271         {
272                 if [ -n "${configurationFile}" ]; then
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\\
282 `makeHeaderLine Updated`\\
283 `makeParameterLine`\\
284 "
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}";;
299 esac
300
301 translateDevice_none()
302 {
303         :
304 }
305 translateDevice_devfs()
306 {
307         minor="${device#ttyS}"
308         if [ "${minor}" != "${device}" ]; then
309                 device="tts/${minor}"
310                 return 0
311         fi
312         minor="${device#lp}"
313         if [ "${minor}" != "${device}" ]; then
314                 device="printers/${minor}"
315                 return 0
316         fi
317         programMessage "unsupported old-style device: ${device}"
318 }
319 translateDevice_old()
320 {
321         major="${device%%/*}"
322         if [ "${major}" != "${device}" ]; then
323                 minor="${device#*/}"
324                 case "${major}" in
325                     tts) devfs="ttyS${minor}";;
326                     printers) devfs="lp${minor}";;
327                 esac
328         fi
329         if [ -n "${devfs}" ]; then
330                 device="${devfs}"
331         else
332                 programMessage "unsupported devfs device: ${device}"
333         fi
334 }
335
336 makeHeaderLine()
337 {
338         echo "# ${1} by brltty-bp2cf`date +' on %Y-%m-%d at %H:%M:%S %Z (UTC%z)'`."
339 }
340 makeParameterLine()
341 {
342         echo "# Boot Parameter:${bootParameter}"
343 }
344 putConfigurationFile()
345 {
346         startConfigurationFile
347         [ -n "${brailleDriver}" ] && putConfigurationDirective "braille-driver" "${brailleDriver}"
348         [ -n "${brailleDevice}" ] && {
349         device="`echo "${brailleDevice}" | sed -e 's%//*%/%g' -e 's%^/dev/%%'`"
350         if [ "${device#/}" = "${device}" ]; then
351                 translateDevice_${deviceTranslation}
352         fi
353         putConfigurationDirective "braille-device" "${device}"
354         }
355         [ -n "${textTable}" ] && putConfigurationDirective "text-table" "${textTable}"
356         finalizeConfigurationFile
357 }
358 parseBootParameter()
359 {
360         bootParameter="${bootParameter} ${1}"
361         number=1
362         while [ "${number}" -le 3 ]; do
363                 cut="cut -d, -f${number}"
364                 [ "${number}" -gt 1 ] && cut="${cut} -s"
365                 operand="`echo ${1} | ${cut}`"
366                 if [ -n "${operand}" ]; then
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
375 }
376 putBootParameter()
377 {
378         parseBootParameter "${1}"
379         putConfigurationFile
380 }
381 parseBootCommand()
382 {
383         found=false
384         while [ "${#}" -gt 0 ]; do
385                 case "${1}" in
386                     "brltty="*)
387                         found=true
388                         parseBootParameter "${1#*=}"
389                         ;;
390                 esac
391                 shift
392         done
393         "${found}" && putConfigurationFile
394 }
395
396 brailleDriver=""
397 brailleDevice=""
398 textTable=""
399 bootCommandFile="/proc/cmdline"
400 if [ -n "${requestedParameter}" ]; then
401         putBootParameter "${requestedParameter}"
402 elif [ -f "${bootCommandFile}" ]; then
403         parseBootCommand `cat "${bootCommandFile}"`
404 elif [ -n "${brltty}" ]; then
405         putBootParameter "${brltty}"
406 fi
407 exit 0
408 )
409
410 %post   -n brlapi -p /sbin/ldconfig
411 %postun -n brlapi -p /sbin/ldconfig
412
413 %files
414 %defattr(644,root,root,755)
415 %doc Documents/{Manual-BRLTTY/English/BRLTTY*,ChangeLog,HISTORY,TODO}
416 %doc doc/{Bindings,Bootdisks,BrailleDrivers,BrailleTables,ContractionTables,Patches,README,SpeechDrivers}
417 %attr(755,root,root) %{_bindir}/brltty
418 %attr(755,root,root) %{_bindir}/brltty-install
419 %attr(755,root,root) %{_bindir}/brltty-config
420 %attr(755,root,root) %{_bindir}/vstp
421 #attr(755,root,root) %{_bindir}/xbrlapi
422 %dir %{_libdir}/brltty
423 %attr(755,root,root) %{_libdir}/brltty/libbrlttybal.so
424 %attr(755,root,root) %{_libdir}/brltty/libbrlttybat.so
425 %attr(755,root,root) %{_libdir}/brltty/libbrlttybba.so
426 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbd.so
427 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbl.so
428 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbm.so
429 %attr(755,root,root) %{_libdir}/brltty/libbrlttybbn.so
430 %attr(755,root,root) %{_libdir}/brltty/libbrlttybcb.so
431 %attr(755,root,root) %{_libdir}/brltty/libbrlttybec.so
432 %attr(755,root,root) %{_libdir}/brltty/libbrlttybeu.so
433 %attr(755,root,root) %{_libdir}/brltty/libbrlttybfs.so
434 %attr(755,root,root) %{_libdir}/brltty/libbrlttybht.so
435 %attr(755,root,root) %{_libdir}/brltty/libbrlttybil.so
436 %attr(755,root,root) %{_libdir}/brltty/libbrlttyblt.so
437 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmb.so
438 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmd.so
439 %attr(755,root,root) %{_libdir}/brltty/libbrlttybmn.so
440 %attr(755,root,root) %{_libdir}/brltty/libbrlttybpm.so
441 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtn.so
442 %attr(755,root,root) %{_libdir}/brltty/libbrlttybts.so
443 %attr(755,root,root) %{_libdir}/brltty/libbrlttybtt.so
444 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvd.so
445 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvo.so
446 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvr.so
447 %attr(755,root,root) %{_libdir}/brltty/libbrlttybvs.so
448 %attr(755,root,root) %{_libdir}/brltty/libbrlttysal.so
449 %attr(755,root,root) %{_libdir}/brltty/libbrlttysbl.so
450 %attr(755,root,root) %{_libdir}/brltty/libbrlttyscb.so
451 %attr(755,root,root) %{_libdir}/brltty/libbrlttyses.so
452 %attr(755,root,root) %{_libdir}/brltty/libbrlttysfv.so
453 %attr(755,root,root) %{_libdir}/brltty/libbrlttysgs.so
454 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxlx.so
455 %attr(755,root,root) %{_libdir}/brltty/libbrlttyxsc.so
456 %{_sysconfdir}/brltty
457 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/brltty.conf
458 %{_mandir}/man1/brltty.1*
459 %{_mandir}/man1/vstp.1*
460
461 %files -n brlapi
462 %defattr(644,root,root,755)
463 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5
464 %attr(755,root,root) %{_libdir}/libbrlapi.so.0.5.1
465 %doc Documents/Manual-BrlAPI/English/BrlAPI*
466
467 %files -n brlapi-devel
468 %defattr(644,root,root,755)
469 %doc Documents/BrlAPIref Documents/README.Gnopernicus
470 %attr(755,root,root) %{_libdir}/libbrlapi.so
471 %{_includedir}/brltty
472 %{_includedir}/brlapi*.h
473 %{_mandir}/man3/*
474
475 %files -n brlapi-static
476 %defattr(644,root,root,755)
477 %{_libdir}/libbrlapi.a
This page took 0.080412 seconds and 4 git commands to generate.