%define major 4 Summary: A library for reading and returning lines from a terminal. Name: readline Version: 4.2a Release: 1 Copyright: GPL Group: System Environment/Libraries Source: ftp://prep.ai.mit.edu/pub/gnu/readline-%{version}.tar.gz Prereq: /sbin/install-info Patch: readline-%{version}-aix5.patch Prefix: %{_prefix} Buildroot: /var/tmp/readline-root %ifarch ia64 %define stdlib lib/ia64l32 %define stdlib64 lib/ia64l64 %define liblink ../../.. %define PKG64 %{name}-%{version}-ia64l64 %define DIRS . %{_builddir}/%{PKG64}/%{name}-%{version} %define DEFCCIA cc %define DEFCC %{DEFCCIA} %else %define stdlib lib %define liblink ../.. %define DIRS . %define DEFCC cc %endif %description The readline library reads a line from the terminal and returns it, allowing the user to edit the line with standard Emacs editing keys. The readline library allows programmers to provide an easy to use and more intuitive interface for users. If you want to develop programs that will use the readline library, you'll also need to install the readline-devel package. %package devel Summary: Development files for programs which will use the readline library. Group: Development/Libraries Requires: readline = %{PACKAGE_VERSION} %description devel The readline library will read a line from the terminal and return it. Use of the readline library allows programmers to provide an easy to use and more intuitive interface for users. If you want to develop programs which will use the readline library, you'll need to have the readline-devel package installed. You'll also need to have the readline package installed. %prep %ifarch ia64 %setup -q -c -n %{PKG64} cd %{name}-%{version} %patch -p1 -b .aix5 %endif %setup -q %patch -p1 -b .aix5 %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} else export CC=gcc fi fi if [[ "$CC" != "gcc" ]] then %ifarch ia64 if [[ "$CC" = "bcc" ]] then export CC="bcc -Nilp32" export CC64=bcc else export CC64="$CC -q64" fi %endif export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` fi for dir in %{DIRS}; do cd $dir; if [[ $dir != "." ]]; then export CC="$CC64"; fi CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix} --with-curses make static shared done %install rm -rf $RPM_BUILD_ROOT # Potential loop if building 64-bit libraries for IA64 for dir in %{DIRS}; do cd $dir; if [[ $dir = "." ]]; then INSTDIR=%{_prefix}; else INSTDIR=/%{PKG64}%{_prefix}; fi make install-shared prefix=$RPM_BUILD_ROOT${INSTDIR} if [[ $dir = "." ]]; then cd doc make install prefix=$RPM_BUILD_ROOT${INSTDIR} fi done ( cd $RPM_BUILD_ROOT gzip -9nf .%{_prefix}/info/*info* rm -f .%{_prefix}/info/dir ) %ifarch ppc || %ifarch rs6000 ( cd $RPM_BUILD_ROOT%{prefix}/lib # Create the archives rm -f libreadline.a libhistory.a ar -qv libreadline.a libreadline.so.%major ar -qv libhistory.a libhistory.so.%major # Create a compatibility member to mitigate differences with Bull Freeware # offering COMPATLIBS="libreadline.a:libreadline.so libhistory.a:libhistory.so" for libspec in $COMPATLIBS do lib=`echo $libspec | cut -d: -f1` COMPATMEMBER=`echo $libspec | cut -d: -f2` /usr/bin/dump -Tv $lib |/usr/bin/awk 'match($4,"EXP|Exp") { print $NF }' > tmp.exp libbase=`print $lib | sed -e 's/.a$//' -e 's/^lib//'` ld -L. -bI:tmp.exp -bE:tmp.exp -l$libbase -bM:SRE -bnoentry -o $COMPATMEMBER /usr/bin/strip -e $COMPATMEMBER # Make shr.o a load-only module /usr/bin/ar -r $lib $COMPATMEMBER rm -f $COMPATMEMBER tmp.exp done ) %endif ( cd $RPM_BUILD_ROOT mkdir -p usr/include cd usr/include ln -sf ../..%{prefix}/include/* . cd - mkdir -p usr/%{stdlib} cd usr/%{stdlib} ln -sf %{liblink}%{prefix}/lib/* . ) %ifarch ia64 # Add 64-bit libs to main install tree mkdir -p $RPM_BUILD_ROOT%{_prefix}/%{stdlib64} mv ${RPM_BUILD_ROOT}/%{PKG64}%{_prefix}/lib/* $RPM_BUILD_ROOT%{_prefix}/%{stdlib64} # Add system links cd $RPM_BUILD_ROOT mkdir -p usr/%{stdlib64} cd usr/%{stdlib64} ln -sf %{liblink}%{prefix}/%{stdlib64}/* . %endif %clean rm -rf $RPM_BUILD_ROOT %post /sbin/install-info /%{_prefix}/info/history.info.gz /%{_prefix}/info/dir /sbin/install-info /%{_prefix}/info/readline.info.gz /%{_prefix}/info/dir %preun if [ $1 = 0 ]; then /sbin/install-info --delete /%{_prefix}/info/history.info.gz /%{_prefix}/info/dir /sbin/install-info --delete /%{_prefix}/info/readline.info.gz /%{_prefix}/info/dir fi %files %defattr(-,root,root) %{_prefix}/man/man*/* %{_prefix}/info/*info* %{_prefix}/lib/lib* /usr/%{stdlib}/lib* %ifarch ia64 %{_prefix}/%{stdlib64}/lib* /usr/%{stdlib64}/lib* %endif %files devel %defattr(-,root,root) %{_prefix}/include/readline /usr/include/readline %changelog * Wed Jan 30 2002 David Clissold - Update to version 4.2a * Wed Mar 21 2001 Marc Stephenson - Build both 32- and 64-bit libraries - Add AIX5 logic to shared library support section * Thu Mar 08 2001 Marc Stephenson - Add logic for default compiler - Generate shared objects - Add Bull freeware compatibility entry * Tue Feb 20 2001 aixtoolbox - Account for different standard lib location in IA64 32-bit ABI * Fri Oct 27 2000 pkgmgr - Modify for AIX Freeware distribution * Mon Feb 7 2000 Jeff Johnson - compress man pages. * Fri Apr 09 1999 Michael K. Johnson - added guard patch from Taneli Huuskonen * Sun Mar 21 1999 Cristian Gafton - auto rebuild in the new build environment (release 4) * Sun Jul 26 1998 Jeff Johnson - updated to 2.2.1 * Wed May 06 1998 Prospector System - translations modified for de, fr, tr * Wed May 06 1998 Cristian Gafton - don't package /usr/info/dir * Thu Apr 30 1998 Cristian Gafton - devel package moved to Development/Libraries * Tue Apr 21 1998 Cristian Gafton - updated to 2.2 * Tue Oct 14 1997 Donnie Barnes - spec file cleanups * Fri Oct 10 1997 Erik Troan - added proper sonames * Tue Jul 08 1997 Erik Troan - updated to readline 2.1 * Tue Jun 03 1997 Erik Troan - built against glibc