Sisyphus repository
Last update: 17 july 2019 | SRPMs: 17686 | Visits: 14331543
en ru br
ALT Linux repos
S:6.1.20180407-alt2
5.0: 5.7-alt1
4.1: 5.6-alt4
4.0: 5.6-alt3
3.0: 5.4.20050108-alt3

Group :: System/Base
RPM: ncurses

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: ncurses
Version: 5.6
Release: alt3

Packager: Stanislav Ievlev <inger at altlinux.org>

%define rootdatadir /lib

Summary: A CRT screen handling and optimization package
Copyright: MIT
Group: System/Base
Url: http://invisible-island.net/%name/%name.html
Source: ftp://invisible-island.net/%name/%name-%version.tar

Source100: %name-alt-terms.tar
Source101: %name-baseterms
Source102: %name-resetall.sh

Obsoletes: ncurses3
Requires: termutils-devel = 0:%version-%release

# Automatically added by buildreq on Tue Apr 27 2004

BuildRequires: libgpm-devel libncurses-devel libtinfo-devel sharutils

#build parameters

%def_with utf8
%def_with shared
%def_with normal
%def_without debug
%def_without profile
%def_without cxx
%def_with gpm
%def_without ada
%def_without libtool

%package -n terminfo
Summary: Descriptions of common terminal types
Group: System/Base
Conflicts: %name < 0:%version-%release
Conflicts: screen < 3.9.11-alt1

%package -n terminfo-extra
Summary: Additional terminal type definitions
Group: System/Base
Provides: %name-extraterms = %version
Obsoletes: %name-extraterms
PreReq: terminfo = 0:%version-%release

%package -n libtinfo
Summary: A low-level terminfo shared library
Group: System/Libraries
PreReq: terminfo = 0:%version-%release

%package -n libtinfo-devel
Summary: A low-level terminfo development library
Group: Development/C
Conflicts: libtermcap-devel < 0:2.0.8-ipl24mdk
# due to incorrect terminfo handling in old libgpm.
Conflicts: libgpm < 1.20.1-alt3.1
Requires: libtinfo = 0:%version-%release

%package -n libtinfo-devel-static
Summary: A low-level terminfo static library
Group: Development/C
Requires: libtinfo-devel = 0:%version-%release

%package -n termutils
Summary: Basic terminal utilities
Group: System/Base
PreReq: terminfo = 0:%version-%release, libtinfo = 0:%version-%release
Provides: /bin/tput

%package -n termutils-devel
Summary: Additional terminal utilities
Group: Development/Other
Requires: termutils = 0:%version-%release

%package -n lib%name
Summary: A CRT screen handling and optimization libraries
Group: System/Libraries
Provides: libncurses.so.4 libncurses.so.3
PreReq: libtinfo = 0:%version-%release
Conflicts: %name < 0:%version-%release

%package -n lib%name-devel
Summary: Development files for applications which use %name
Group: Development/C
Requires: lib%name = 0:%version-%release, libtinfo-devel = 0:%version-%release
Provides: %name-devel = 0:%version-%release
Obsoletes: %name-devel

%package -n lib%name-devel-static
Summary: Development static %name libraries
Group: Development/C
Requires: lib%name-devel = 0:%version-%release, libtinfo-devel-static = 0:%version-%release

%package -n lib%name++
Summary: C++ interface to lib%name
Group: System/Libraries
Requires: lib%name = 0:%version-%release

%package -n lib%name++-devel
Summary: Development files for applications which use lib%name++
Group: Development/C++
Requires: lib%name++ = 0:%version-%release, lib%name-devel = 0:%version-%release

%package -n lib%name++-devel-static
Summary: Development static lib%name++ library
Group: Development/C++
Requires: lib%name++-devel = 0:%version-%release, lib%name-devel-static = 0:%version-%release

# UTF-8 extentions

%if_with utf8
%package -n lib%{name}w
Summary: A CRT screen handling and optimization libraries with wide character support
Group: System/Libraries
PreReq: libtinfo = 0:%version-%release

%package -n lib%{name}w-devel
Summary: Development files for applications which use %name (widechar version)
Group: Development/C
Requires: lib%{name}w = 0:%version-%release, lib%name-devel = 0:%version-%release
%endif

%description
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

%description -n terminfo
Terminfo is a data base describing terminals, used by screen-oriented
programs and libraries such as curses(3X).  Terminfo describes terminals
by giving a set of capabilities which they have, by specifying how to
perform screen operations, and by specifying padding requirements and
initialization sequences.

This package contains what should be a reasonable subset of terminal
definitions, including: ansi, dumb, linux, rxvt, screen, sun, vt100,
vt102, vt220, vt52, and xterm.

%description -n terminfo-extra
Terminfo is a data base describing terminals, used by screen-oriented
programs and libraries such as curses(3X).  Terminfo describes terminals
by giving a set of capabilities which they have, by specifying how to
perform screen operations, and by specifying padding requirements and
initialization sequences.

This package contains all of the terminal definitions not found in
the terminfo package.  There are far too many to list here.

%description -n libtinfo
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains a low-level terminfo shared library.

%description -n libtinfo-devel
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains a low-level terminfo development library and include
files.

%description -n libtinfo-devel-static
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains a low-level terminfo static library.

%description -n termutils
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains basic terminal manipulation utilities.

%description -n termutils-devel
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains additional terminal manipulation utilities.

%description -n lib%name
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

%description -n lib%name-devel
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains include files for developing applications that use
the %name CRT screen handling and optimization package.

%description -n lib%name-devel-static
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains staic libraries for developing statically linked
applications that use the %name CRT screen handling and optimization package.

%description -n lib%name++
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains a c++ interface shared library.

%description -n lib%name++-devel
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains include files for developing applications that use
c++ interface to ncurses routines.

%description -n lib%name++-devel-static
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains staic library for developing statically linked
applications that use c++ interface to ncurses routines.

#UTF8 extentions

%if_with utf8
%description -n lib%{name}w
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.
This package contains a %name library with wide character support.

%description -n lib%{name}w-devel
The curses library routines are a terminal-independent method of updating
character screens with reasonable optimization.  The %name (new curses)
library is a freely distributable replacement for the discontinued 4.4BSD
classic curses library.

This package contains include files for developing applications that use
the %name CRT screen handling and optimization package (widechar version).
%endif

%prep
%setup -q -a100

%__subst 's/EXTRA_LIBS="-ldl -lncurses $EXTRA_LIBS"/EXTRA_LIBS="$EXTRA_LIBS"/
s/SHLIB_LIST="-ldl $SHLIB_LIST"/SHLIB_LIST="-lgpm $SHLIB_LIST"/
s/TINFO_LIST="$SHLIB_LIST"/TINFO_LIST=/' ./configure


%build
%remove_optflags %optflags_notraceback %optflags_nocpp
%ifarch %ix86
%add_optflags -momit-leaf-frame-pointer
%endif


# Predefine these for configure:

export \
ac_cv_func_mkstemp=yes \
ac_cv_prog_AWK=gawk \
ac_cv_prog_MAKE_LOWER_TAGS=yes \
ac_cv_prog_MAKE_UPPER_TAGS=yes \
ac_cv_prog_MAN=man \
#

%define _configure_script ../configure
%__rm -rf build-classic build-utf8
%__mkdir_p build-classic build-utf8

# configure classic version

pushd build-classic
%configure \
--program-transform-name= \
%{subst_with shared} \
%{subst_with normal} \
%{subst_with debug} \
%{subst_with profile} \
%{subst_with cxx} \
%{subst_with ada} \
%{subst_with libtool} \
%{subst_with gpm} \
--without-dlsym \
--with-termlib \
--with-ospeed="unsigned int" \
--with-terminfo-dirs="%rootdatadir/terminfo:%_datadir/terminfo" \
--disable-termcap \
--enable-const \
--enable-hard-tabs \
--enable-no-padding \
--enable-sigwinch \
--enable-echo \
--enable-warnings \
--disable-rpath \
--disable-root-environ \
--disable-home-terminfo \
--with-chtype=long \
#

popd # build-classic

# configure utf8 version

%if_with utf8
pushd build-utf8
%configure \
--program-transform-name= \
%{subst_with shared} \
%{subst_with normal} \
%{subst_with debug} \
%{subst_with profile} \
%{subst_with cxx} \
%{subst_with ada} \
%{subst_with libtool} \
%{subst_with gpm} \
--without-dlsym \
--with-termlib=tinfo \
--with-ospeed="unsigned int" \
--with-terminfo-dirs="%rootdatadir/terminfo:%_datadir/terminfo" \
--disable-termcap \
--enable-const \
--enable-hard-tabs \
--enable-no-padding \
--enable-sigwinch \
--enable-echo \
--enable-warnings \
--disable-rpath \
--disable-root-environ \
--disable-home-terminfo \
--with-chtype=long \
--enable-widec \
#
# Workaround for utf8, rename libtinfow to libtinfo, addon for ncurses-*-alt-utf8-fix.patch
# will be removed when Thomas finish termlib=name feature
   find -type f -name Makefile -print0 |
xargs -r0 subst s,tinfow,tinfo,g

popd # build-utf8
%endif # with_utf8

# build classic version

pushd build-classic
#NO SMP
%make

%if_with cxx
# Build c++ shared library.
pushd lib
g++ -shared -Wl,-soname,libncurses++.so.5 -o libncurses++.so.%version \
-Wl,-whole-archive libncurses++.a -Wl,-no-whole-archive \
-L. -lform -lmenu -lpanel -lncurses -ltinfo
%__ln_s libncurses++.so.%version libncurses++.so.5
%__ln_s libncurses++.so.5 libncurses++.so
popd # lib
# Rebuild c++ demo.
%__rm -f c++/demo
make -C c++
%endif # with_cxx
popd # build-classic

# build utf8 version

%if_with utf8
pushd build-utf8
#NO SMP
%make

%if_with cxx
# Build c++ shared library.
pushd lib
g++ -shared -Wl,-soname,libncursesw++.so.5 -o libncursesw++.so.%version \
-Wl,-whole-archive libncursesw++.a -Wl,-no-whole-archive \
-L. -lform -lmenu -lpanel -lncurses -ltinfo
%__ln_s libncursesw++.so.%version libncursesw++.so.5
%__ln_s libncursesw++.so.5 libncursesw++.so
popd # lib
# Rebuild c++ demo.
%__rm -f c++/demo
make -C c++
%endif # with_cxx
popd # build-utf8
%endif # with_utf8

%install
#install classic ncurses library version
pushd build-classic
%make_install install \
DESTDIR=$RPM_BUILD_ROOT \
includedir=%_includedir/%name

%if_with cxx
# Install c++ shared library.
%__install -p -m644 lib/libncurses++.so.%version $RPM_BUILD_ROOT%_libdir/
%__ln_s libncurses++.so.%version $RPM_BUILD_ROOT%_libdir/libncurses++.so.5
%__ln_s libncurses++.so.5 $RPM_BUILD_ROOT%_libdir/libncurses++.so
%endif # with_cxx
popd # build-classic

#install utf8 ncurses library version

%if_with utf8
pushd build-utf8
%make_install install \
DESTDIR=$RPM_BUILD_ROOT \
includedir=%_includedir/%name



%__ln_s %name $RPM_BUILD_ROOT%_includedir/%{name}w
%if_with cxx
# Install c++ shared library.
%__install -p -m644 lib/libncursesw++.so.%version $RPM_BUILD_ROOT%_libdir/
%__ln_s libncursesw++.so.%version $RPM_BUILD_ROOT%_libdir/libncursesw++.so.5
%__ln_s libncursesw++.so.5 $RPM_BUILD_ROOT%_libdir/libncursesw++.so
%endif # with_cxx
popd # build-utf8
%endif # with_utf8

# The resetall script.

%__install -pD -m755 %SOURCE102 $RPM_BUILD_ROOT%_bindir/resetall

%__ln_s -nf %name/curses.h $RPM_BUILD_ROOT%_includedir/%name.h
for n in curses eti form menu panel term termcap unctrl; do
%__ln_s -nf "%name/$n.h" "$RPM_BUILD_ROOT%_includedir/$n.h"
done

# Relocate libtinfo from %_libdir/ to /lib/.

for f in $RPM_BUILD_ROOT%_libdir/libtinfo*.so; do
t=`objdump -p "$f" |awk '/SONAME/ {print $2}'`
[ -n "$t" ]
%__ln_s -nf ../../%_lib/"$t" "$f"
done
%__mkdir_p $RPM_BUILD_ROOT/%_lib
%__mv $RPM_BUILD_ROOT%_libdir/libtinfo*.so.* $RPM_BUILD_ROOT/%_lib/

%__ln_s -nf lib%name.so $RPM_BUILD_ROOT%_libdir/libcurses.so

t=`objdump -p "$RPM_BUILD_ROOT%_libdir/lib%name.so" |awk '/SONAME/ {print $2}'`
# Library compatibility symlinks.
for v in 4 3; do
%__ln_s "$t" "$RPM_BUILD_ROOT%_libdir/lib%name.so.$v"
done

chmod 644 $RPM_BUILD_ROOT{/%_lib,%_libdir}/lib*.so.* ||:

# Relocate tput.

%__mkdir_p $RPM_BUILD_ROOT/bin
%__mv $RPM_BUILD_ROOT%_bindir/tput $RPM_BUILD_ROOT/bin/
%__ln_s ../../bin/tput $RPM_BUILD_ROOT%_bindir/

# Generate new terminfo entries (deb).

for n in rxvt rxvt-unicode screen; do
LD_LIBRARY_PATH=$RPM_BUILD_ROOT/%_lib:$RPM_BUILD_ROOT%_libdir \
       TERMINFO=$RPM_BUILD_ROOT%_datadir/terminfo \
$RPM_BUILD_ROOT%_bindir/tic -s %name-alt-terms/$n.ti
done

# Split terminfo entries into /lib/terminfo and %_datadir/terminfo.

%__ln_s -nf ../l/linux $RPM_BUILD_ROOT%_datadir/terminfo/c/console

%__rm -f relocation_error
cat %SOURCE101 |while read -r n; do
f="${n:0:1}"
%__mkdir_p "$RPM_BUILD_ROOT/%rootdatadir/terminfo/$f"
%__mv "$RPM_BUILD_ROOT%_datadir/terminfo/$f/$n" "$RPM_BUILD_ROOT/%rootdatadir/terminfo/$f/" ||
{ touch relocation_error; exit 1; }
%__ln_s `relative "$RPM_BUILD_ROOT/%rootdatadir/terminfo/$f/$n" "$RPM_BUILD_ROOT%_datadir/terminfo/$f/"` \
"$RPM_BUILD_ROOT%_datadir/terminfo/$f/" ||
{ touch relocation_error; exit 1; }
echo "%dir %_datadir/terminfo/$f"
echo "%_datadir/terminfo/$f/$n"
done |sort -u >base.list
[ ! -f relocation_error ]

find $RPM_BUILD_ROOT%_datadir/terminfo -type f -mindepth 2 |
%__sed -e "s|$RPM_BUILD_ROOT||g" >extra.list

# Prepare docs.

%__rm -rf $RPM_BUILD_ROOT%_docdir/%name-%version
%__mkdir_p $RPM_BUILD_ROOT%_docdir/%name-%version
%__install -p -m644 ANNOUNCE NEWS README TO-DO \
c++/demo.cc doc/*.doc doc/html/*.html \
$RPM_BUILD_ROOT%_docdir/%name-%version/
%__install -p -m644 c++/README-first \
$RPM_BUILD_ROOT%_docdir/%name-%version/README.c++
#make clean -C test

#replace ncurses.so symlink with a special linker script

rm -f $RPM_BUILD_ROOT%_libdir/lib%name.so
cat >>$RPM_BUILD_ROOT%_libdir/lib%name.so<<EOF
/* GNU ld script */
GROUP(%_libdir/lib%name.so.5 -ltinfo)
EOF


%post -n libtinfo -p %post_ldconfig
%postun -n libtinfo -p %postun_ldconfig

%post -n lib%name -p %post_ldconfig
%postun -n lib%name -p %postun_ldconfig

%post -n lib%{name}w -p %post_ldconfig
%postun -n lib%{name}w -p %postun_ldconfig

%files
# ncurses is pure virtual package.

# TERMINFO

%files -n terminfo -f base.list
%rootdatadir/terminfo
%dir %_datadir/terminfo
%ifnarch x86_64
%_libdir/terminfo
%endif
%_datadir/tabset
%_man5dir/*

%files -n terminfo-extra -f extra.list
%dir %_datadir/terminfo
%dir %_datadir/terminfo/*
%_datadir/terminfo/c/console

# LIBTINFO

%files -n libtinfo
/%_lib/libtinfo.*

%files -n libtinfo-devel
%_libdir/libtinfo.so
%_includedir/termcap.h
%_includedir/term.h
%dir %_includedir/%name
%_includedir/%name/termcap.h
%_includedir/%name/term.h
%_includedir/%name/ncurses_dll.h

%files -n libtinfo-devel-static
%_libdir/libtinfo.a

# TERMUTILS

%files -n termutils
/bin/tput
%_bindir/clear
%_bindir/reset*
%_bindir/toe
%_bindir/tput
%_bindir/tset
%_man7dir/*
%_man1dir/clear.*
%_man1dir/reset.*
%_man1dir/toe.*
%_man1dir/tput.*
%_man1dir/tset.*

%files -n termutils-devel
%_bindir/*info*
%_bindir/tack
%_bindir/tic
%_man1dir/*info*
%_man1dir/tack.*
%_man1dir/tic.*

# LIBNCURSES

%files -n lib%name
%_libdir/lib*[musl].so.*
%if_with cxx
%exclude %_libdir/libncurses++*.so.*
%endif # with_cxx
%dir %_docdir/%name-%version
%_docdir/%name-%version/[A-Z]*

%files -n lib%name-devel
%_bindir/%{name}5-config
%_libdir/lib*.so
%if_with utf8
%exclude %_libdir/lib*[musl]w.so
%endif # with_utf8
%exclude %_libdir/libtinfo*.so
%if_with cxx
%exclude %_libdir/libncurses++*.so
%endif # with_cxx
%_includedir/*
%exclude %_includedir/term*.h
%exclude %_includedir/%name/term*.h
%exclude %_includedir/%name/ncurses_dll.h
%if_with cxx
%exclude %_includedir/%name/cursesapp.h
%exclude %_includedir/%name/curses?.h
%exclude %_includedir/%name/cursslk.h
%exclude %_includedir/%name/etip.h
%endif # with_cxx
%if_with utf8
%exclude %_includedir/%{name}w
%endif # with_utf8
%_man3dir/*
%dir %_docdir/%name-%version
%_docdir/%name-%version/[a-z]*
#%doc test

%files -n lib%name-devel-static
%_libdir/lib*.a
%exclude %_libdir/libtinfo.a
%if_with cxx
%exclude %_libdir/libncurses++*.a
%endif # with_cxx

# LIBNCURSES++

%if_with cxx
%files -n lib%name++
%_libdir/libncurses++*.so.*

%files -n lib%name++-devel
%_libdir/libncurses++*.so
%dir %_includedir/%name
%_includedir/%name/cursesapp.h
%_includedir/%name/curses?.h
%_includedir/%name/cursslk.h
%_includedir/%name/etip.h

%files -n lib%name++-devel-static
%_libdir/libncurses++*.a
%endif # with_cxx

%if_with utf8
%files -n lib%{name}w
%_libdir/lib*[musl]w.so.*

%files -n lib%{name}w-devel
%_bindir/%{name}w5-config
%_libdir/lib*[musl]w.so
%_includedir/%{name}w
%endif # with_utf8

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin