%global _miscdir %{_datadir}/misc
%global _incdir %{_includedir}
%global root %{_tmppath}/%{name}-%{version}-store
-%global abi %(ver=%{version}; echo ${ver%.*})
%description
As soon as a text application needs to directly control its output to
contains information about any known terminal. The ncurses library
makes use of this database to use terminals correctly.
-%if %abi == 5
%package -n libncurses
Summary: The New curses Libraries
The ncurses library is used by the most curses based terminal
applications for controling its output and input to the screen.
-%endif
%package -n libncurses6
Summary: The New curses Libraries
License: MIT
Group: Base/Libraries
Requires: terminfo-base
-%if %abi == 5
Provides: ncurses = 6.0
-%else
-Provides: ncurses = %{version}
-%endif
%description -n libncurses6
The ncurses library is used by the most curses based terminal
Group: Base/Development
Provides: ncurses:%{_incdir}/ncurses.h
Requires: ncurses = %{version}-%{release}
-%if %abi >= 6
-Requires: libncurses6 = %{version}-%{release}
-%else
Requires: libncurses = %{version}-%{release}
Requires: libncurses6 = %{version}-%{release}
-%endif
%description -n ncurses-devel
This package contains all necessary include files and libraries needed
--with-pkg-config \
--enable-colorfgbg \
--enable-sp-funcs \
-%if %abi >= 6
- --with-pthread \
- --enable-reentrant \
- --enable-ext-mouse \
- --disable-widec \
- --enable-ext-colors \
-%else
--without-pthread \
--disable-reentrant \
--disable-ext-mouse \
--disable-widec \
--disable-ext-colors \
-%endif
--enable-weak-symbols \
--enable-wgetch-events \
--enable-pthreads-eintr \
make install DESTDIR=%{root} includedir=${inc} libdir=${lib}
ln -sf ${inc##*/}/{curses,ncurses,term,termcap}.h %{root}${inc%%/*}/
sh %{S:6} --cflags "-I${inc}" --libs "-lncurses" --libs "-ltinfo" %{root}%{_bindir}/ncurses5-config
-%if %abi < 6
#
# Now use --with-pthread for reentrant pthread support (abi > 5).
#
pushd man
sh ../edit_man.sh normal installing %{root}%{_mandir} . ncurses6-config.1
popd
-%endif
#
# Now use --enable-widec for UTF8/wide character support.
# The libs with 16 bit wide characters are binary incompatible
# to the normal 8bit wide character libs.
#
-%if %abi >= 6
- eval ./${c#*./} --with-pthread --enable-reentrant --enable-ext-mouse --enable-widec --enable-ext-colors --without-progs
-%else
eval ./${c#*./} --disable-ext-mouse --enable-widec --disable-ext-colors --without-progs
-%endif
find -name fallback.o | xargs -r rm -vf
cp fallback.c.backup ncurses/fallback.c
make %{?_smp_mflags}
pushd man
sh ../edit_man.sh normal installing %{root}%{_mandir} . ncursesw5-config.1
popd
-%if %abi < 6
#
# Do both --enable-widec and --with-pthread (abi > 5).
#
pushd man
sh ../edit_man.sh normal installing %{root}%{_mandir} . ncursesw6-config.1
popd
-%endif
%install
GZIP="-9"
chmod 0755 %{buildroot}/%{_libdir}/lib*.so.*
chmod 0755 %{buildroot}/%{_libdir}/lib*.so.*
chmod a-x %{buildroot}/%{_libdir}/lib*.a
-%if %abi < 6
if test -d %{buildroot}%{_libdir}/ncurses6 ; then
mv %{buildroot}%{_libdir}/ncurses6/*.so.6* %{buildroot}%{_libdir}/
for lib in %{buildroot}%{_libdir}/ncurses6/*.so
chmod 0755 %{buildroot}/%{_libdir}/lib*.so.6*
chmod a-x %{buildroot}/%{_libdir}/ncurses6/lib*.a
fi
-%endif
test -n "%{buildroot}" || ldconfig -N
mkdir -p %{buildroot}%{_defaultdocdir}/ncurses
bzip2 -c misc/terminfo.src > misc/terminfo.src.bz2
grep -v -F -x -f default.list \
> extension.list
rm -f %{buildroot}%{_prefix}/lib/terminfo
-%if %abi < 6
%post -n libncurses -p /sbin/ldconfig
%postun -n libncurses -p /sbin/ldconfig
-%endif
%post -n libncurses6 -p /sbin/ldconfig
%doc %{_mandir}/man1/tput.1.gz
%doc %{_mandir}/man1/tset.1.gz
%doc %{_mandir}/man5/*.gz
-%if %abi == 5
%files -n libncurses
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/lib*.so.5*
-%endif
%files -n libncurses6
%manifest %{name}.manifest