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