apply ncurses-5.9-20110409.patch
[platform/upstream/ncurses.git] / packaging / ncurses.spec
1 #
2 # spec file for package ncurses
3 #
4 # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 #
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
14
15 #
16
17
18 Name:           ncurses
19 #!BuildIgnore: terminfo
20 BuildRequires:  gcc-c++
21 %define terminfo() %{_datadir}/%{0}/%{1}
22 %define tabset()   %{_datadir}/%{0}/%{1}
23 Version:        5.9
24 Release:        0
25 Summary:        New curses Libraries
26 License:        MIT
27 Group:          System/Base
28 Url:            http://invisible-island.net/ncurses/ncurses.html
29 Source0:        ncurses-%{version}.tar.bz2
30 Source1:        ncurses-%{version}-patches.tar.bz2
31 Source2:        handle.linux
32 Source3:        README.devel
33 Source4:        ncurses-rpmlintrc
34 Source5:        tack-1.07-20120303.tar.bz2
35 Source6:        edit.sed
36 Source7:        baselibs.conf
37 Patch0:         ncurses-%{version}.dif
38 Patch1:         ncurses-5.9-overflow.dif
39 Patch3:         ncurses-5.9-overwrite.dif
40 Patch4:         ncurses-5.7-tack.dif
41 Patch5:         ncurses-5.9-environment.dif
42 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
43 %global         _sysconfdir /etc
44 %global         _miscdir    %{_datadir}/misc
45 %global         _incdir     %{_includedir}
46 %global         root        %{_tmppath}/%{name}-%{version}-store
47 %global         abi         %(ver=%{version}; echo ${ver%.*})
48
49 %description
50 As soon as a text application needs to directly control its output to
51 the screen (if it wants to place the cursor at location (x,y) then
52 write text), ncurses is used. The panel and the forms libraries are
53 included in this package. These new libraries support color, special
54 characters, and panels.
55
56
57
58 Authors:
59 --------
60     Thomas E. Dickey <dickey@invisible-island.net>
61     Juergen Pfeifer <Juergen.Pfeifer@t-online.de>
62     Eric S. Raymond <esr@thyrsus.com>
63     Zeyd M. Ben-Halim <zmbenhal@netcom.com>
64     Pavel Curtis
65
66 %package -n ncurses-utils
67 Summary:        Tools using the new curses libraries
68 License:        MIT
69 Group:          System/Base
70 Provides:       ncurses:%{_bindir}/tput
71
72 %description -n ncurses-utils
73 The ncurses based utilities are as follows:
74
75 clear -- emits clear-screen for current terminal
76
77 tabs -- set tabs on a terminal
78
79 toe   -- table of entries utility
80
81 tput  -- shell-script access to terminal capabilities.
82
83 tset  -- terminal-initialization utility
84
85 reset -- terminal initialization utility
86
87
88
89 Authors:
90 --------
91     Thomas E. Dickey <dickey@invisible-island.net>
92     Eric S. Raymond <esr@thyrsus.com>
93     Zeyd M. Ben-Halim <zmbenhal@netcom.com>
94     Juergen Pfeifer <Juergen.Pfeifer@t-online.de>
95     Pavel Curtis
96
97 %package -n terminfo-base
98 Summary:        A terminal descriptions database
99 License:        MIT
100 Group:          System/Base
101 Provides:       ncurses:%{_datadir}/tabset
102
103 %description -n terminfo-base
104 This is the terminfo basic database, maintained in the ncurses package.
105 This database is the official successor to the 4.4BSD termcap file and
106 contains information about any known terminal. The ncurses library
107 makes use of this database to use terminals correctly.
108
109
110
111 Authors:
112 --------
113     Thomas E. Dickey <dickey@invisible-island.net>
114     Eric S. Raymond <esr@thyrsus.com>
115
116 %if %abi == 5
117
118 %package -n libncurses
119 Summary:        The New curses Libraries
120 License:        MIT
121 Group:          System/Libraries
122 Requires:       terminfo-base
123 Provides:       ncurses = %{version}
124 Obsoletes:      ncurses < %{version}
125 Recommends:     ncurses-utils = %{version}
126
127 %description -n libncurses
128 The ncurses library is used by the most curses based terminal
129 applications for controling its output and input to the screen.
130
131
132
133 Authors:
134 --------
135     Thomas E. Dickey <dickey@invisible-island.net>
136     Eric S. Raymond <esr@thyrsus.com>
137     Zeyd M. Ben-Halim <zmbenhal@netcom.com>
138     Juergen Pfeifer <Juergen.Pfeifer@t-online.de>
139     Pavel Curtis
140
141 %endif
142
143 %package -n libncurses6
144 Summary:        The New curses Libraries
145 License:        MIT
146 Group:          System/Libraries
147 Requires:       terminfo-base
148 %if %abi == 5
149 Provides:       ncurses = 6.0
150 %else
151 Provides:       ncurses = %{version}
152 %endif
153
154 %description -n libncurses6 
155 The ncurses library is used by the most curses based terminal
156 applications for controling its output and input to the screen.
157
158
159
160 Authors:
161 --------
162     Thomas E. Dickey <dickey@invisible-island.net>
163     Juergen Pfeifer <Juergen.Pfeifer@t-online.de>
164     Eric S. Raymond <esr@thyrsus.com>
165     Zeyd M. Ben-Halim <zmbenhal@netcom.com>
166     Pavel Curtis
167
168 %package -n terminfo
169 Summary:        A terminal descriptions database
170 License:        SUSE-Public-Domain
171 Group:          System/Base
172
173 %description -n terminfo
174 This is the terminfo reference database, maintained in the ncurses
175 package. This database is the official successor to the 4.4BSD termcap
176 file and contains information about any known terminal. The ncurses
177 library makes use of this database to use terminals correctly. If you
178 just use the Linux console, xterm, and VT100, you probably will not
179 need this database -- a minimal /usr/share/terminfo tree for these
180 terminals is already included in the terminfo-base package.
181
182
183
184 Authors:
185 --------
186     Eric S. Raymond <esr@thyrsus.com>
187     Thomas E. Dickey <dickey@invisible-island.net>
188
189 %package -n ncurses-devel
190 Summary:        Include Files and Libraries mandatory for Development
191 License:        MIT
192 Group:          Development/Libraries/C and C++
193 Provides:       ncurses:%{_incdir}/ncurses.h
194 Requires:       %{_bindir}/tack
195 Requires:       ncurses = %{version}-%{release}
196 %if %abi >= 6
197 Requires:       libncurses6 = %{version}-%{release}
198 %else
199 Requires:       libncurses = %{version}-%{release}
200 Requires:       libncurses6 = %{version}-%{release}
201 %endif
202
203 %description -n ncurses-devel
204 This package contains all necessary include files and libraries needed
205 to develop applications that require these.
206
207
208
209 Authors:
210 --------
211     Thomas E. Dickey <dickey@invisible-island.net>
212     Juergen Pfeifer <Juergen.Pfeifer@t-online.de>
213     Eric S. Raymond <esr@thyrsus.com>
214     Zeyd M. Ben-Halim <zmbenhal@netcom.com>
215     Pavel Curtis
216
217 %package -n tack
218 Summary:        Terminfo action checker
219 License:        GPL-2.0+
220 Group:          Development/Tools/Building
221 Provides:       ncurses-devel:%{_bindir}/tack
222 Requires:       ncurses = %{version}-%{release}
223
224 %description -n tack
225 This package contains the tack utility to help to build a new terminfo
226 entry describing an unknown terminal. It can also be used to test the
227 correctness of an existing entry, and to develop the correct pad
228 timings needed to ensure that screen updates do not fall behind the
229 incoming data stream.
230
231
232
233 Authors:
234 --------
235     Daniel Weaver <danw@znyx.com>
236     Eric S. Raymond <esr@thyrsus.com>
237
238 %prep
239 %setup -q -n ncurses-%{version}
240 rm -fr tack
241 rm -f  Ada95/src/terminal_interface-curses.adb
242 rm -f  mkinstalldirs
243 tar Oxfj %{S:1} | patch -p1 -s
244 tar  xfj %{S:5}
245 mv tack-* tack
246 %patch -P 1 -p0 -b .of
247 %patch -P 3 -p0 -b .ow
248 %patch -P 4 -p0 -b .hs
249 %patch -P 5 -p0 -b .lc
250 %patch -P 0 -p0 -b .p0
251 rm -vf include/ncurses_dll.h
252 rm -vf mkdirs.sh
253 rm -vf tar-copy.sh
254 rm -vf mk-dlls.sh
255
256 %build
257     cflags ()
258     {
259         local flag=$1; shift
260         local var=$1; shift
261         test -n "${flag}" -a -n "${var}" || return
262         case "${!var}" in
263         *${flag}*) return
264         esac
265         set -o noclobber
266         case "$flag" in
267         -Wl,*)
268             if echo 'int main () { return 0; }' | \
269                ${CC:-gcc} -Werror $flag -o /dev/null -xc - > /dev/null 2>&1 ; then
270                 eval $var=\${$var:+\$$var\ }$flag
271             fi
272             ;;
273         *)
274             if ${CC:-gcc} -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
275                 eval $var=\${$var:+\$$var\ }$flag
276             fi
277             if ${CXX:-g++} -Werror $flag -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1 ; then
278                 eval $var=\${$var:+\$$var\ }$flag
279             fi
280         esac
281         set +o noclobber
282     }
283
284     test ! -f /.buildenv || . /.buildenv
285        OPATH=$PATH
286       FALLBK="xterm,linux,vt100,vt102"
287           CC=gcc
288          CXX=g++
289     CFLAGS="${RPM_OPT_FLAGS} -pipe -D_REENTRANT"
290     if [[ "$BUILD_BASENAME" = debug-* ]] ; then
291         CFLAGS="${CFLAGS} -g -DTRACE"
292     fi
293     cflags -Wl,-O2                  LDFLAGS
294     cflags -Wl,-Bsymbolic-functions LDFLAGS
295     cflags -Wl,--hash-size=8599     LDFLAGS
296     cflags -Wl,--as-needed          LDFLAGS
297     CXXFLAGS=$CFLAGS
298     test -n "$TERM" || TERM=linux
299     GZIP="-9"
300     export CC CFLAGS CXX CXXFLAGS GZIP TERM LDFLAGS
301     #
302     # Detect 64bit architecures and be sure that
303     # we use an unsigned long for chtype to be
304     # backward compatible with ncurses 5.4
305     #
306     echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 -
307     if ./test64 ; then
308         WITHCHTYPE="--with-chtype=long"
309     else
310         WITHCHTYPE=""
311         CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCES -D_FILE_OFFSET_BITS=64"
312     fi
313     rm -f ./test64
314     #
315     # For security of some configure and install scripts
316     #
317     TMPDIR=$(mktemp -d /tmp/ncurses.XXXXXXXX) || exit 1
318     trap 'rm -rf ${TMPDIR}' EXIT
319     export TMPDIR
320     #
321     # No --enable-term-driver as this had crashed last time
322     # in ncurses/tinfo/lib_setup.c due to the fact that
323     # _nc_globals.term_driver was a NULL function pointer
324     #
325     # No --enable-tcap-names because we may have to recompile
326     # programs or foreign programs won't work
327     #
328     # No --enable-safe-sprintf because this seems to
329     # crash on some architectures
330     #
331     # No --enable-xmc-glitch because this seems to break yast2
332     # on console/konsole (no magic cookie support on those?)
333     #
334     # No --with-termlib=tinfo because libncurses depend on
335     # libtinfo (is linked with) and therefore there is no
336     # advantage about splitting of a libtinfo (IMHO).
337     #
338     touch --reference=README config.sub config.guess
339     %configure \
340         --without-ada           \
341         --without-debug         \
342         --without-profile       \
343         --without-manpage-tbl   \
344         --with-shared           \
345         --with-normal           \
346         --with-manpage-format=gzip \
347         --with-manpage-renames=${PWD}/man/man_db.renames \
348         --with-manpage-aliases  \
349         --with-ospeed=speed_t   \
350         --with-gpm              \
351         --with-dlsym            \
352         --with-termlib=tinfo    \
353         --with-ticlib=tic       \
354         --with-xterm-kbs=del    \
355         --disable-root-environ  \
356         --disable-termcap       \
357         --disable-overwrite     \
358         --disable-rpath         \
359         --disable-leaks         \
360         --disable-xmc-glitch    \
361         --enable-symlinks       \
362         --enable-big-core       \
363         --enable-const          \
364         --enable-hashmap        \
365         --enable-no-padding     \
366         --enable-symlinks       \
367         --enable-sigwinch       \
368         --enable-colorfgbg      \
369         --enable-sp-funcs       \
370 %if %abi >= 6
371         --with-pthread          \
372         --enable-reentrant      \
373         --enable-ext-mouse      \
374         --disable-widec         \
375         --enable-ext-colors     \
376 %else
377         --without-pthread       \
378         --disable-reentrant     \
379         --disable-ext-mouse     \
380         --disable-widec         \
381         --disable-ext-colors    \
382 %endif
383         --enable-weak-symbols   \
384         --enable-wgetch-events  \
385         --enable-pthreads-eintr \
386         --enable-string-hacks   \
387         --prefix=%{_prefix}     \
388         --exec-prefix=%{_prefix}\
389         --libdir=%{_libdir}     \
390         --datadir=%{_datadir}   \
391         --mandir=%{_mandir}     \
392         --includedir=%{_incdir} \
393         "${WITHCHTYPE}"         \
394         --disable-widec         \
395         --disable-tic-depends   \
396         --with-ticlib=tic
397     #
398     #  The configure line
399     #
400     c=$(grep '^ *$ *\./configure' config.log)
401     #
402     # This is a hack to be able to boot strap
403     # a libncurses with correct fallback.c.
404     #
405     make %{?_smp_mflags} -C include
406     make %{?_smp_mflags} -C ncurses fallback.c FALLBACK_LIST=""
407     make %{?_smp_mflags} -C progs   termsort.c transform.h infocmp tic
408     rm   -f ncurses/fallback.c
409     PATH=$PWD/progs:$OPATH
410     LD_LIBRARY_PATH=$PWD/lib
411     export LD_LIBRARY_PATH PATH
412     pushd ncurses/
413         TERMINFO=$PWD/tmp
414         export TERMINFO
415         mkdir -p $TERMINFO
416 %if 0%{?_crossbuild}
417 export BUILD_TIC=/usr/bin/tic
418 %else
419 export BUILD_TIC=$PWD/../progs/tic
420 %endif
421         $BUILD_TIC -I -r -e $FALLBK ../misc/terminfo.src > terminfo.src
422         $BUILD_TIC -o $TERMINFO -s terminfo.src
423         sh -e ./tinfo/MKfallback.sh $TERMINFO ../misc/terminfo.src $BUILD_TIC ${FALLBK//,/ } > fallback.c
424         rm -rf $TERMINFO
425         unset  TERMINFO
426         cp -p fallback.c ../fallback.c.backup
427     popd
428     PATH=$OPATH
429     unset LD_LIBRARY_PATH
430     #
431     # Refresh second install path
432     #
433     rm -rf %{root}
434     mkdir  %{root}
435     #
436     # Now rebuild libncurses and do the rest of this job
437     #
438     find -name fallback.o | xargs -r rm -vf
439     cp fallback.c.backup ncurses/fallback.c
440     make %{?_smp_mflags}
441     lib=%{_libdir}
442     inc=%{_incdir}/ncurses
443     # must not use %jobs here (would lead to: ln: ncurses.h already exists)
444     make install DESTDIR=%{root} includedir=${inc} libdir=${lib}
445     ln -sf ${inc##*/}/{curses,ncurses,term,termcap}.h %{root}${inc%%/*}/
446     sh %{S:6} --cflags "-I${inc}" --libs "-lncurses" --libs "-ltinfo" %{root}%{_bindir}/ncurses5-config
447     #
448     # Check for tack program on base of above ncurses
449     #
450     LD_LIBRARY_PATH=$PWD/lib
451     export LD_LIBRARY_PATH PATH
452     pushd tack/
453 %if 0%{?qemu_user_space_build:1}%{?_crossbuild}
454         echo "Skipping LDD test due to running under QEMU / cross-building"
455 %else
456         ldd ./tack
457 %endif
458     popd
459     unset LD_LIBRARY_PATH
460     test ! -L tack || rm -f tack
461 %if %abi < 6
462     #
463     # Now use --with-pthread for reentrant pthread support (abi > 5).
464     #
465     eval ./${c#*./} --with-pthread --enable-reentrant --enable-ext-mouse --disable-widec --disable-ext-colors --without-progs
466     find -name fallback.o | xargs -r rm -vf
467     cp fallback.c.backup ncurses/fallback.c
468     make %{?_smp_mflags}
469     lib=%{_libdir}/ncurses6
470     inc=%{_incdir}/ncurses6/ncurses
471     # must not use %jobs here (would lead to: ln: ncurses.h already exists)
472     make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib}
473     ln -sf ${inc##*/}/{curses,ncurses,term}.h %{root}${inc%%/*}/
474     sh %{S:6} --cflags "-I${inc} -I${inc%%/*}" --libs "-L${lib} -lncurses" --libs "-ltinfo" %{root}%{_bindir}/ncurses6-config
475     pushd man
476         sh ../edit_man.sh normal installing %{root}%{_mandir} . ncurses6-config.1
477     popd
478 %endif
479     #
480     # Now use --enable-widec for UTF8/wide character support.
481     # The libs with 16 bit wide characters are binary incompatible
482     # to the normal 8bit wide character libs.
483     #
484 %if %abi >= 6
485     eval ./${c#*./} --with-pthread --enable-reentrant --enable-ext-mouse --enable-widec --enable-ext-colors --without-progs
486 %else
487     eval ./${c#*./} --disable-ext-mouse --enable-widec --disable-ext-colors --without-progs
488 %endif
489     find -name fallback.o | xargs -r rm -vf
490     cp fallback.c.backup ncurses/fallback.c
491     make %{?_smp_mflags}
492     lib=%{_libdir}
493     inc=%{_incdir}/ncursesw
494     # must not use %jobs here (would lead to: ln: ncurses.h already exists)
495     make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib}
496     sh %{S:6} --cflags "-I${inc}" --libs "-lncursesw" --libs "-ltinfo" %{root}%{_bindir}/ncursesw5-config
497     pushd man
498         sh ../edit_man.sh normal installing %{root}%{_mandir} . ncursesw5-config.1
499     popd
500 %if %abi < 6
501     #
502     # Do both --enable-widec and --with-pthread (abi > 5).
503     #
504     eval ./${c#*./} --with-pthread --enable-reentrant --enable-ext-mouse --enable-widec --enable-ext-colors --without-progs
505     find -name fallback.o | xargs -r rm -vf
506     cp fallback.c.backup ncurses/fallback.c
507     make %{?_smp_mflags}
508     lib=%{_libdir}/ncurses6
509     inc=%{_incdir}/ncurses6/ncursesw
510     # must not use %jobs here (would lead to: ln: ncurses.h already exists)
511     make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib}
512     sh %{S:6} --cflags "-I${inc} -I${inc%%/*}" --libs "-L${lib} -lncursesw" --libs "-ltinfo" %{root}%{_bindir}/ncursesw6-config
513     pushd man
514         sh ../edit_man.sh normal installing %{root}%{_mandir} . ncursesw6-config.1
515     popd
516 %endif
517
518 %install
519     GZIP="-9"
520     export GZIP
521     (cd %{root}/; tar -cpsSf - *)|tar -xpsSf - -C %{buildroot}/
522     rm -rf %{root}
523     mkdir %{buildroot}/%{_lib}
524     for model in libncurses libncursest libncursesw libncursestw libtinfo
525     do
526         for lib in %{buildroot}%{_libdir}/${model}.so.* ; do
527             test   -e "${lib}" || continue
528             mv "${lib}" %{buildroot}/%{_lib}/ || continue
529         done
530         for lib in %{buildroot}/%{_lib}/${model}.so.%{abi} ; do
531             test -e "${lib}" || continue
532             test -L "${lib}" || continue
533             lib=${lib#%{buildroot}}
534             lnk=%{buildroot}%{_libdir}/${model}.so
535             case "${lib##*/}" in
536             libncurses*)
537                 rm -f ${lnk}
538                 echo '/* GNU ld script */'              >  ${lnk}
539                 echo "INPUT(${lib} AS_NEEDED(-ltinfo))" >> ${lnk}
540                 ;;
541             *)  ln -sf ${lib} %{buildroot}%{_libdir}/${model}.so
542             esac
543         done
544     done
545 %if 0
546     lnk=%{buildroot}%{_libdir}/libtermcap.so
547     echo '/* GNU ld script */'          >  ${lnk}
548     echo "INPUT(AS_NEEDED(-ltinfo))"    >> ${lnk}
549 %endif
550     chmod 0755 %{buildroot}/%{_lib}/lib*.so.*
551     chmod 0755 %{buildroot}/%{_libdir}/lib*.so.*
552     chmod a-x  %{buildroot}/%{_libdir}/lib*.a
553 %if %abi < 6
554     if test -d %{buildroot}%{_libdir}/ncurses6 ; then
555         mv %{buildroot}%{_libdir}/ncurses6/*.so.6*   %{buildroot}%{_libdir}/
556         for lib in %{buildroot}%{_libdir}/ncurses6/*.so
557         do
558             lnk=$lib
559             lib=/%{_lib}/${lib##*/}.6
560             case "${lib##*/}" in
561             libncurses*)
562                 rm -f "${lnk}"
563                 echo '/* GNU ld script */'              >  ${lnk}
564                 echo "INPUT(${lib} AS_NEEDED(-ltinfo))" >> ${lnk} 
565                 ;;
566             libtinfo*)
567                 test -L "${lnk}" || continue
568                 ln -sf ${lib} ${lnk}
569                 ;;
570             *)
571                 test -L "${lnk}" || continue
572                 ln -sf ../${lib##*/} ${lnk}
573             esac
574         done
575         for model in libncurses libncursest libncursesw libncursestw libtinfo
576         do
577             for lib in %{buildroot}%{_libdir}/${model}.so.* ; do
578                 test   -e "${lib}" || continue
579                 mv "${lib}" %{buildroot}/%{_lib}/ || continue
580             done
581             for lib in %{buildroot}/%{_lib}/${model}.so.6 ; do
582                 test -e "${lib}" || continue
583                 test -L "${lib}" || continue
584                 lib=${lib#%{buildroot}}
585                 lnk=%{buildroot}%{_libdir}/ncurses6/${model}.so
586                 case "${lib##*/}" in
587                 libncurses*)
588                     rm -f ${lnk}
589                     echo '/* GNU ld script */'              >  ${lnk}
590                     echo 'SEARCH_DIR(%{_libdir}/ncurses6)'  >> ${lnk}
591                     echo "INPUT(${lib} AS_NEEDED(-ltinfo))" >> ${lnk}
592                     ;;
593                 *)  ln -sf ${lib} %{buildroot}%{_libdir}/ncurses6/${model}.so
594             esac
595             done
596         done
597         chmod 0755 %{buildroot}/%{_lib}/lib*.so.6*
598         chmod 0755 %{buildroot}/%{_libdir}/lib*.so.6*
599         chmod a-x  %{buildroot}/%{_libdir}/ncurses6/lib*.a
600     fi
601 %endif
602     test -n "%{buildroot}" || ldconfig -N
603     mkdir -p %{buildroot}%{_defaultdocdir}/ncurses
604     bzip2 -c misc/terminfo.src > misc/terminfo.src.bz2
605     install -m 644 misc/terminfo.src.bz2        %{buildroot}%{_defaultdocdir}/ncurses/
606     install -m 644 doc/html/*.html              %{buildroot}%{_defaultdocdir}/ncurses/
607     bzip2 doc/ncurses-intro.doc -c > doc/ncurses-intro.txt.bz2
608     install -m 644 doc/ncurses-intro.txt.bz2    %{buildroot}%{_defaultdocdir}/ncurses/
609     bzip2 doc/hackguide.doc -c > doc/hackguide.txt.bz2
610     install -m 644 doc/hackguide.txt.bz2        %{buildroot}%{_defaultdocdir}/ncurses/
611     install -m 644 %{S:3}                       %{buildroot}%{_defaultdocdir}/ncurses/
612     install -m 644 README                       %{buildroot}%{_defaultdocdir}/ncurses/
613     install -m 644 NEWS                         %{buildroot}%{_defaultdocdir}/ncurses/
614     mkdir -p %{buildroot}%{_sysconfdir}
615     mkdir -p %{buildroot}%{_miscdir}
616     LD_LIBRARY_PATH=$PWD/lib
617     export LD_LIBRARY_PATH
618     pushd ncurses/
619         { echo "# See annotated version in %{_defaultdocdir}/ncurses/terminfo.src.bz2"
620 %if 0%{?_crossbuild}
621         BUILD_TIC=/usr/bin/tic
622 %else
623         BUILD_TIC=$PWD/../progs/tic
624 %endif
625         $BUILD_TIC -C -r ../misc/terminfo.src | grep -E -v '^#'; } > termcap
626         # Gererate new termcap entries for various linux consoles
627         TERMCAP=termcap \
628         TERMINFO=%{buildroot}%{_datadir}/terminfo \
629             bash %{SOURCE2}
630         install -m 0644 termcap.new %{buildroot}%{_miscdir}/termcap
631     popd
632     unset LD_LIBRARY_PATH
633     if test `%{_bindir}/id -u` = '0' ; then
634         chown root:root %{buildroot}%{_miscdir}/termcap
635         chmod 0644      %{buildroot}%{_miscdir}/termcap
636     fi
637     ln -sf %{_miscdir}/termcap %{buildroot}%{_sysconfdir}/termcap
638     (cat > default.list) <<-EOF
639         %{tabset std}
640         %{tabset stdcrt}
641         %{tabset vt100}
642         %{tabset vt300}
643         %{terminfo a/ansi}
644         %{terminfo a/arpanet}
645         %{terminfo d/dumb}
646         %{terminfo d/dialup}
647         %{terminfo g/gnome}
648         %{terminfo g/gnome-rh72}
649         %{terminfo k/klone+color}
650         %{terminfo k/kvt}
651         %{terminfo k/kvt-rh}
652         %{terminfo l/linux}
653         %{terminfo l/linux-m}
654         %{terminfo l/linux-nic}
655         %{terminfo m/mlterm}
656         %{terminfo n/net}
657         %{terminfo n/network}
658         %{terminfo n/nxterm}
659         %{terminfo p/patch}
660         %{terminfo r/rxvt}
661         %{terminfo s/screen}
662         %{terminfo s/screen-w}
663         %{terminfo s/screen-256color}
664         %{terminfo s/sun}
665         %{terminfo s/switch}
666         %{terminfo u/unknown}
667         %{terminfo v/vt100}
668         %{terminfo v/vt102}
669         %{terminfo v/vt220}
670         %{terminfo v/vt220-8}
671         %{terminfo v/vt220-8bit}
672         %{terminfo v/vt320}
673         %{terminfo v/vt52}
674         %{terminfo x/xterm}
675         %{terminfo x/xterm-color}
676         %{terminfo x/xterm-256color}
677         %{terminfo x/xterm-basic}
678         %{terminfo x/xterm-nic}
679         %{terminfo x/xterm-r6}
680         EOF
681     find %{buildroot}%{tabset ""} %{buildroot}%{terminfo ""} \
682         \( -type f -or -type l \) | \
683         sed "s@^%{buildroot}@@g" | \
684         grep -v -F -x -f default.list \
685         > extension.list
686     rm -f %{buildroot}%{_prefix}/lib/terminfo
687 %if %abi < 6
688
689 %post   -n libncurses -p /sbin/ldconfig
690
691 %postun -n libncurses -p /sbin/ldconfig
692 %endif
693
694 %post   -n libncurses6 -p /sbin/ldconfig
695
696 %postun -n libncurses6 -p /sbin/ldconfig
697
698 %files -n terminfo-base -f default.list
699 %defattr(-,root,root)
700 %{_sysconfdir}/termcap
701 %config %{_miscdir}/termcap
702 %dir %{_datadir}/tabset/
703 %dir %{_datadir}/terminfo/
704 %dir %{_datadir}/terminfo/*/
705
706 %files -n ncurses-utils
707 %defattr(-,root,root)
708 %{_bindir}/clear
709 %{_bindir}/reset
710 %{_bindir}/tabs
711 %{_bindir}/toe
712 %{_bindir}/tput
713 %{_bindir}/tset
714 %doc %{_mandir}/man1/clear.1.gz
715 %doc %{_mandir}/man1/reset.1.gz
716 %doc %{_mandir}/man1/tabs.1.gz
717 %doc %{_mandir}/man1/toe.1.gz
718 %doc %{_mandir}/man1/tput.1.gz
719 %doc %{_mandir}/man1/tset.1.gz
720 %doc %{_mandir}/man5/*.gz
721 %if %abi == 5
722
723 %files -n libncurses
724 %defattr(-,root,root)
725 /%{_lib}/lib*.so.5*
726 %{_libdir}/lib*.so.5*
727 %endif
728
729 %files -n libncurses6
730 %defattr(-,root,root)
731 /%{_lib}/lib*.so.6*
732 %{_libdir}/lib*.so.6*
733
734 %files -n ncurses-devel
735 %defattr(-,root,root)
736 %dir %{_defaultdocdir}/ncurses/
737 %doc %{_defaultdocdir}/ncurses/*
738 %{_bindir}/ncurses*-config
739 %{_bindir}/captoinfo
740 %{_bindir}/infocmp
741 %{_bindir}/infotocap
742 %{_bindir}/tic
743 %dir %{_incdir}/ncurses/
744 %dir %{_incdir}/ncursesw/
745 %dir %{_incdir}/ncurses6/
746 %dir %{_incdir}/ncurses6/ncurses/
747 %dir %{_incdir}/ncurses6/ncursesw/
748 %{_incdir}/*.h
749 %{_incdir}/ncurses*/*.h
750 %{_incdir}/ncurses*/*/*.h
751 %dir %{_libdir}/ncurses6/
752 %{_libdir}/lib*.a
753 %{_libdir}/lib*.so
754 %{_libdir}/ncurses6/lib*.a
755 %{_libdir}/ncurses6/lib*.so
756 %doc %{_mandir}/man1/*-config.1.gz
757 %doc %{_mandir}/man1/captoinfo.1.gz
758 %doc %{_mandir}/man1/infocmp.1.gz
759 %doc %{_mandir}/man1/infotocap.1.gz
760 %doc %{_mandir}/man1/tic.1.gz
761 %doc %{_mandir}/man3/*.gz
762 %doc %{_mandir}/man7/*.gz
763
764 %files -n tack
765 %defattr(-,root,root)
766 %{_bindir}/tack
767 %doc %{_mandir}/man1/tack.1.gz
768
769 %files -f extension.list -n terminfo
770 %defattr(-,root,root)
771
772 %changelog