RT notifier: parse templates without header correctly
[openxpki.git] / trunk / package / suse / external-dependencies / TermReadKey.spec
blob04151dda7c4d15b676afdde43c2ba62116f41961
2 # - TermReadKey -
3 # This spec file was automatically generated by cpan2rpm [ver: 2.027]
4 # The following arguments were used:
5 # --spec-only --version=2.30 '--author=Jonathan Stowe' TermReadKey-2.30.tar.gz
6 # For more information on cpan2rpm please visit: http://perl.arix.com/
9 %define pkgname TermReadKey
10 %define filelist %{pkgname}-%{version}-filelist
11 %define NVR %{pkgname}-%{version}-%{release}
12 %define maketest 1
14 name: perl-TermReadKey
15 summary: TermReadKey - A perl module for simple terminal control
16 version: 2.30
17 release: 1
18 vendor: Jonathan Stowe
19 packager: Arix International <cpan2rpm@arix.com>
20 license: Artistic
21 group: Applications/CPAN
22 url: http://www.cpan.org
23 buildroot: %{_tmppath}/%{name}-%{version}-%(id -u -n)
24 prefix: %(echo %{_prefix})
25 source: TermReadKey-2.30.tar.gz
27 %description
28 Term::ReadKey is a compiled perl module dedicated to providing simple
29 control over terminal driver modes (cbreak, raw, cooked, etc.,) support for
30 non-blocking reads, if the architecture allows, and some generalized handy
31 functions for working with terminals. One of the main goals is to have the
32 functions as portable as possible, so you can just plug in "use
33 Term::ReadKey" on any architecture and have a good likelyhood of it working.
35 =over 8
37 =item ReadMode MODE [, Filehandle]
39 Takes an integer argument, which can currently be one of the following
40 values:
42 0 Restore original settings.
43 1 Change to cooked mode.
44 2 Change to cooked mode with echo off.
45 (Good for passwords)
46 3 Change to cbreak mode.
47 4 Change to raw mode.
48 5 Change to ultra-raw mode.
49 (LF to CR/LF translation turned off)
51 Or, you may use the synonyms:
53 restore
54 normal
55 noecho
56 cbreak
57 raw
58 ultra-raw
60 These functions are automatically applied to the STDIN handle if no
61 other handle is supplied. Modes 0 and 5 have some special properties
62 worth mentioning: not only will mode 0 restore original settings, but it
63 cause the next ReadMode call to save a new set of default settings. Mode
64 5 is similar to mode 4, except no CR/LF translation is performed, and if
65 possible, parity will be disabled (only if not being used by the terminal,
66 however. It is no different from mode 4 under Windows.)
68 If you are executing another program that may be changing the terminal mode,
69 you will either want to say
71 ReadMode 1
72 system('someprogram');
73 ReadMode 1;
75 which resets the settings after the program has run, or:
77 $somemode=1;
78 ReadMode 0;
79 system('someprogram');
80 ReadMode 1;
82 which records any changes the program may have made, before resetting the
83 mode.
85 =item ReadKey MODE [, Filehandle]
87 Takes an integer argument, which can currently be one of the following
88 values:
90 0 Perform a normal read using getc
91 -1 Perform a non-blocked read
92 >0 Perform a timed read
94 (If the filehandle is not supplied, it will default to STDIN.) If there is
95 nothing waiting in the buffer during a non-blocked read, then undef will be
96 returned. Note that if the OS does not provide any known mechanism for
97 non-blocking reads, then a "ReadKey -1" can die with a fatal error. This
98 will hopefully not be common.
100 If MODE is greater then zero, then ReadKey will use it as a timeout value in
101 seconds (fractional seconds are allowed), and won't return "undef" until
102 that time expires. (Note, again, that some OS's may not support this timeout
103 behaviour.) If MODE is less then zero, then this is treated as a timeout
104 of zero, and thus will return immediately if no character is waiting. A MODE
105 of zero, however, will act like a normal getc.
107 There are currently some limitations with this call under Windows. It may be
108 possible that non-blocking reads will fail when reading repeating keys from
109 more then one console.
111 =item ReadLine MODE [, Filehandle]
113 Takes an integer argument, which can currently be one of the following
114 values:
116 0 Perform a normal read using scalar(<FileHandle>)
117 -1 Perform a non-blocked read
118 >0 Perform a timed read
120 If there is nothing waiting in the buffer during a non-blocked read, then
121 undef will be returned. Note that if the OS does not provide any known
122 mechanism for non-blocking reads, then a "ReadLine 1" can die with a fatal
123 error. This will hopefully not be common. Note that a non-blocking test is
124 only performed for the first character in the line, not the entire line.
125 This call will probably not do what you assume, especially with
126 ReadMode's higher then 1. For example, pressing Space and then Backspace
127 would appear to leave you where you started, but any timeouts would now
128 be suspended.
130 This call is currently not available under Windows.
132 =item GetTerminalSize [Filehandle]
134 Returns either an empty array if this operation is unsupported, or a four
135 element array containing: the width of the terminal in characters, the
136 height of the terminal in character, the width in pixels, and the height in
137 pixels. (The pixel size will only be valid in some environments.)
139 Under Windows, this function must be called with an "output" filehandle,
140 such as STDOUT, or a handle opened to CONOUT$.
142 =item SetTerminalSize WIDTH,HEIGHT,XPIX,YPIX [, Filehandle]
144 Return -1 on failure, 0 otherwise. Note that this terminal size is only for
145 informative value, and changing the size via this mechanism will not
146 change the size of the screen. For example, XTerm uses a call like this when
147 it resizes the screen. If any of the new measurements vary from the old, the
148 OS will probably send a SIGWINCH signal to anything reading that tty or pty.
150 This call does not work under Windows.
152 =item GetSpeeds [, Filehandle]
154 Returns either an empty array if the operation is unsupported, or a two
155 value array containing the terminal in and out speeds, in decimal. E.g,
156 an in speed of 9600 baud and an out speed of 4800 baud would be returned as
157 (9600,4800). Note that currently the in and out speeds will always be
158 identical in some OS's. No speeds are reported under Windows.
160 =item GetControlChars [, Filehandle]
162 Returns an array containing key/value pairs suitable for a hash. The pairs
163 consist of a key, the name of the control character/signal, and the value
164 of that character, as a single character. This call does nothing under Windows.
166 Each key will be an entry from the following list:
168 DISCARD
169 DSUSPEND
172 EOL2
173 ERASE
174 ERASEWORD
175 INTERRUPT
176 KILL
178 QUIT
179 QUOTENEXT
180 REPRINT
181 START
182 STATUS
183 STOP
184 SUSPEND
185 SWITCH
186 TIME
188 Thus, the following will always return the current interrupt character,
189 regardless of platform.
191 %keys = GetControlChars;
192 $int = $keys{INTERRUPT};
194 =item SetControlChars [, Filehandle]
196 Takes an array containing key/value pairs, as a hash will produce. The pairs
197 should consist of a key that is the name of a legal control
198 character/signal, and the value should be either a single character, or a
199 number in the range 0-255. SetControlChars will die with a runtime error if
200 an invalid character name is passed or there is an error changing the
201 settings. The list of valid names is easily available via
203 %cchars = GetControlChars();
204 @cnames = keys %cchars;
206 This call does nothing under Windows.
208 =back
211 # This package was generated automatically with the cpan2rpm
212 # utility. To get this software or for more information
213 # please visit: http://perl.arix.com/
216 %prep
217 %setup -q -n %{pkgname}-%{version}
218 chmod -R u+w %{_builddir}/%{pkgname}-%{version}
220 %build
221 grep -rsl '^#!.*perl' . |
222 grep -v '.bak$' |xargs --no-run-if-empty \
223 %__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
224 CFLAGS="$RPM_OPT_FLAGS"
225 %{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
226 %{__make}
227 %if %maketest
228 %{__make} test
229 %endif
231 %install
232 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
234 %{makeinstall} `%{__perl} -MExtUtils::MakeMaker -e ' print \$ExtUtils::MakeMaker::VERSION <= 6.05 ? qq|PREFIX=%{buildroot}%{_prefix}| : qq|DESTDIR=%{buildroot}| '`
236 cmd=/usr/share/spec-helper/compress_files
237 [ -x $cmd ] || cmd=/usr/lib/rpm/brp-compress
238 [ -x $cmd ] && $cmd
240 # SuSE Linux
241 if [ -e /etc/SuSE-release -o -e /etc/UnitedLinux-release ]
242 then
243 %{__mkdir_p} %{buildroot}/var/adm/perl-modules
244 %{__cat} `find %{buildroot} -name "perllocal.pod"` \
245 | %{__sed} -e s+%{buildroot}++g \
246 > %{buildroot}/var/adm/perl-modules/%{name}
249 # remove special files
250 find %{buildroot} -name "perllocal.pod" \
251 -o -name ".packlist" \
252 -o -name "*.bs" \
253 |xargs -i rm -f {}
255 # no empty directories
256 find %{buildroot}%{_prefix} \
257 -type d -depth \
258 -exec rmdir {} \; 2>/dev/null
260 %{__perl} -MFile::Find -le '
261 find({ wanted => \&wanted, no_chdir => 1}, "%{buildroot}");
262 print "%doc README";
263 for my $x (sort @dirs, @files) {
264 push @ret, $x unless indirs($x);
266 print join "\n", sort @ret;
268 sub wanted {
269 return if /auto$/;
271 local $_ = $File::Find::name;
272 my $f = $_; s|^\Q%{buildroot}\E||;
273 return unless length;
274 return $files[@files] = $_ if -f $f;
276 $d = $_;
277 /\Q$d\E/ && return for reverse sort @INC;
278 $d =~ /\Q$_\E/ && return
279 for qw|/etc %_prefix/man %_prefix/bin %_prefix/share|;
281 $dirs[@dirs] = $_;
284 sub indirs {
285 my $x = shift;
286 $x =~ /^\Q$_\E\// && $x ne $_ && return 1 for @dirs;
288 ' > %filelist
290 [ -z %filelist ] && {
291 echo "ERROR: empty %files listing"
292 exit -1
295 %clean
296 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
298 %files -f %filelist
299 %defattr(-,root,root)
301 %changelog
302 * Tue Dec 19 2006 root@dca02
303 - Initial build.