%define sorev 5 Summary: A terminal handling library Name: ncurses Version: 5.8 Release: 1 License: MIT Group: System Environment/Libraries URL: http://invisible-island.net/ncurses/ncurses.html Source0: ftp://invisible-island.net/ncurses/%{name}-%{version}.tar.gz Source1: ftp://invisible-island.net/ncurses/%{name}-%{version}.tar.gz.asc Source2: ftp://invisible-island.net/ncurses/%{name}-%{version}.tar.gz.sig Patch1: %{name}-%{version}-20110305-20110319.patch.bz2 Patch11: %{name}-%{version}-urxvt.patch Patch12: %{name}-%{version}-kbs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: sed, patch %define _libdir64 %{_prefix}/lib64 %description The curses library routines are a terminal-independent method of updating character screens with reasonable optimization. The ncurses (new curses) library is a freely distributable replacement for the discontinued 4.4 BSD classic curses library. %package devel Summary: Development files for the ncurses library Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The header files and libraries for developing applications that use the ncurses terminal handling library. Install the ncurses-devel package if you want to develop applications which will use ncurses. %prep %setup -q export PATH=/opt/freeware/bin:$PATH %patch1 -p1 %patch11 -p1 -b .urxvt %patch12 -p1 -b .kbs # this will be in documentation, drop executable bits cp -p install-sh test chmod 644 test/* mkdir ../narrowc-32 mv * ../narrowc-32 mv ../narrowc-32 . mkdir narrowc-64 cp -r narrowc-32/* narrowc-64/ mkdir widec-32 cp -r narrowc-32/* widec-32/ mkdir widec-64 cp -r narrowc-32/* widec-64/ %build export CC="xlc_r" export CXX="xlC_r" # shell function to configure ncurses configurencurses() { ./configure \ --prefix=%{_prefix} \ --without-ada \ --without-curses-h \ --without-libtool \ --without-shared \ --with-normal \ --disable-relink \ --without-debug \ --without-profile \ --without-gpm \ --disable-overwrite \ --disable-overwrite \ --enable-pc-files \ --enable-hard-tabs \ --enable-xmc-glitch \ --enable-colorfgbg \ $* } # shell function to build proper AIX-style shared libraries build_aix_shared_libs() { cd lib for i in ncurses$2 form$2 menu$2 panel$2 ncurses++$2; do if [ -f "lib${i}.a" ] ; then CreateExportList -X$1 lib${i}.exp lib${i}.a if [ "${i}" = "ncurses++$2" ] ; then ${CXX} -q$1 -qmkshrobj lib${i}.a -o lib${i}.so.%{sorev} -bE:lib${i}.exp -Wl,-bernotok -Wl,-blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib/threads:/usr/lib:/lib -L. -lncurses$2 -lpanel$2 -lform$2 -lmenu$2 elif [ "${i}" != "ncurses$2" ] ; then ${CC} -q$1 -qmkshrobj lib${i}.a -o lib${i}.so.%{sorev} -bE:lib${i}.exp -Wl,-bernotok -Wl,-blibpath:/opt/freeware/lib:/usr/vac/lib:/usr/lib/threads:/usr/lib:/lib -L. -lncurses$2 else ${CC} -q$1 -qmkshrobj lib${i}.a -o lib${i}.so.%{sorev} -bE:lib${i}.exp -Wl,-bernotok fi rm -f lib${i}.exp lib${i}.a ar -X$1 -rv lib${i}.a lib${i}.so.%{sorev} fi done cd .. } cd narrowc-32 export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export PKG_CONFIG_LIBDIR=%{_libdir}/pkgconfig configurencurses gmake %{?_smp_mflags} libs build_aix_shared_libs 32 gmake %{?_smp_mflags} -C progs cd ../narrowc-64 export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export PKG_CONFIG_LIBDIR=%{_libdir64}/pkgconfig configurencurses \ --libdir=%{_libdir64} gmake %{?_smp_mflags} LIBTOOL="/usr/bin/libtool --tag=CC" libs build_aix_shared_libs 64 gmake %{?_smp_mflags} LIBTOOL="/usr/bin/libtool --tag=CC" -C progs cd ../widec-32 export OBJECT_MODE=32 export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export PKG_CONFIG_LIBDIR=%{_libdir}/pkgconfig configurencurses \ --enable-widec --enable-ext-colors --without-progs gmake %{?_smp_mflags} LIBTOOL="/usr/bin/libtool --tag=CC" libs build_aix_shared_libs 32 w cd ../widec-64 export OBJECT_MODE=64 export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" export PKG_CONFIG_LIBDIR=%{_libdir64}/pkgconfig configurencurses \ --libdir=%{_libdir64} \ --enable-widec --enable-ext-colors --without-progs gmake %{?_smp_mflags} LIBTOOL="/usr/bin/libtool --tag=CC" libs build_aix_shared_libs 64 w %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} cd narrowc-64 export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install.libs gmake DESTDIR=${RPM_BUILD_ROOT} install.progs gmake DESTDIR=${RPM_BUILD_ROOT} install.data ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) cd ../narrowc-32 export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install.libs gmake DESTDIR=${RPM_BUILD_ROOT} install.progs gmake DESTDIR=${RPM_BUILD_ROOT} install.data cd ../widec-64 export OBJECT_MODE=64 gmake DESTDIR=${RPM_BUILD_ROOT} install.libs gmake DESTDIR=${RPM_BUILD_ROOT} install.includes gmake DESTDIR=${RPM_BUILD_ROOT} install.man # fix ncursesw-config ( cd ${RPM_BUILD_ROOT}%{_bindir} cat ncursesw6-config | sed 's|echo "6"|echo "5"|g' > ncursesw5-config_64 rm -f ncursesw6-config ) cd ../widec-32 export OBJECT_MODE=32 gmake DESTDIR=${RPM_BUILD_ROOT} install.libs gmake DESTDIR=${RPM_BUILD_ROOT} install.includes gmake DESTDIR=${RPM_BUILD_ROOT} install.man # fix ncursesw-config ( cd ${RPM_BUILD_ROOT}%{_bindir} cat ncursesw6-config | sed 's|echo "6"|echo "5"|g' > ncursesw5-config rm -f ncursesw6-config ) /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : # fix man path filenames ( cd ${RPM_BUILD_ROOT}%{_mandir}/man3 for f in *.3x ; do mv ${f} `basename ${f} .3x`.3 done ) # fix shared libraries ( cd ${RPM_BUILD_ROOT}%{_libdir64} for file in *.a ; do /usr/bin/ar -X64 -x ${file} done cd ${RPM_BUILD_ROOT}%{_libdir} for file in *.a ; do f=`basename ${file} .a` /usr/bin/ar -X32 -x ${file} /usr/bin/ar -X64 -q ${file} ${RPM_BUILD_ROOT}%{_libdir64}/${f}.so.%{sorev} done ) ( cd ${RPM_BUILD_ROOT} for dir in bin lib lib64 include share do mkdir -p usr/${dir} cd usr/${dir} ln -sf ../..%{_prefix}/${dir}/* . cd - done mkdir -p usr/share cd usr/share ln -sf ../..%{_datadir}/* . cd - mkdir -p usr/linux/include cd usr/linux/include ln -sf ../../..%{_includedir}/ncurses* . cd - mkdir -p usr/linux/bin cd usr/bin rm -f captoinfo* clear* infocmp* infotocap* reset* tic* tput* tset* cd - cd usr/linux/bin for f in captoinfo clear infocmp infotocap reset tic tput tset ; do ln -sf ../../..%{bindir}/${f} . ln -sf ../../..%{bindir}/${f}_64 . done cd - mkdir -p usr/linux/lib cd usr/linux/lib ln -sf ../../..%{_libdir}/* . cd - mkdir -p usr/linux/lib64 cd usr/linux/lib64 ln -sf ../../..%{_libdir64}/* . ) %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system) %doc narrowc-32/ANNOUNCE narrowc-32/AUTHORS narrowc-32/README narrowc-32/TO-DO %doc narrowc-32/NEWS %doc narrowc-32/misc/ncurses.supp %{_bindir}/[cirt]* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.so* %{_libdir}/terminfo %{_datadir}/terminfo %{_datadir}/tabset %{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man7/* /usr/lib/*.a /usr/lib/*.so* /usr/lib64/*.so* /usr/share/tabset /usr/share/terminfo /usr/linux/bin/* /usr/linux/lib/*.a /usr/linux/lib/*.so* /usr/linux/lib64/*.so* %files devel %defattr(-,root,system) %doc narrowc-32/doc/html/hackguide.html narrowc-32/doc/html/ncurses-intro.html %doc narrowc-32/c++/README* %{_bindir}/ncurses*-config* %{_includedir}/* %{_libdir}/pkgconfig/*.pc %{_libdir64}/pkgconfig/*.pc %{_mandir}/man3/* /usr/bin/ncurses*-config* /usr/include/* /usr/linux/include/* %changelog * Sun May 13 2012 Michael Perzl - 5.8-1 - updated to version 5.8-20110319 * Sun May 13 2012 Michael Perzl - 5.7-1 - updated to version 5.7-20100130 * Mon Jan 17 2011 Michael Perzl - 5.6-2 - updated to version 5.6-20080927 - added 64-bit shared libraries - added RTL-style libraries - added wide-char/UTF-8 libraries - enabled experimental 256-color support * Sat Mar 15 2008 Michael Perzl - 5.6-1 - first version for AIX5L v5.1 and higher