Summary: A library for editing typed in command lines.
Summary(ja): readline ライブラリ

Name: readline
Version: 5.2
Release: 4%{?_dist_release}
License: GPLv2
Group: System Environment/Libraries
URL: http://tiswww.tis.case.edu/~chet/readline/rltop.html
Source: ftp://ftp.gnu.org/gnu/readline/readline-%{version}.tar.gz

# upstream patches
Patch1: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-001
Patch2: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-002
Patch3: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-003
Patch4: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-004
Patch5: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-005
Patch6: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-006
Patch7: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-007
Patch8: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-008
Patch9: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-009
Patch10: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-010
Patch11: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-011
Patch12: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-012
Patch13: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-013
Patch14: ftp://ftp.gnu.org/gnu/readline/readline-%{version}-patches/readline52-014

Patch20: readline-5.2-shlib.patch

Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: sed
BuildRequires: ncurses-devel
Requires(post): /sbin/install-info, /sbin/ldconfig
Requires(preun): /sbin/install-info
Requires(postun): /sbin/ldconfig


Vendor: Project Vine
Distribution: Vine Linux

%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

%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.


%description -l ja
"readline" ライブラリを用いると、端末から読みこんだ一行を、emacs の標準キー
と同キーバインディングで編集できるようになります。これをプログラム中で使うと、
より使いやすいインタフェースをユーザに提供できます。


%package devel
Summary: Files needed to develop programs which use the readline library.
Summary(ja): readline ライブラリを使うプログラムための開発用ライブラリ
Group: Development/Libraries
Requires: readline = %{version}
Requires: ncurses-devel

%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.


%package -n compat32-%{name}
Summary: A library for editing typed in command lines.
Summary(ja): readline ライブラリ
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
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.


%description -n compat32-%{name} -l ja
"readline" ライブラリを用いると、端末から読みこんだ一行を、emacs の標準キー
と同キーバインディングで編集できるようになります。これをプログラム中で使うと、
より使いやすいインタフェースをユーザに提供できます。


%package -n compat32-%{name}-devel
Summary: Files needed to develop programs which use the readline library.
Summary(ja): readline ライブラリを使うプログラムための開発用ライブラリ
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-ncurses-devel


%description -n compat32-%{name}-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
%setup -q

# upstream patches
%patch1 -p0 -b .001
%patch2 -p0 -b .002
%patch3 -p0 -b .003
%patch4 -p0 -b .004
%patch5 -p0 -b .005
%patch6 -p0 -b .006
%patch7 -p0 -b .007
%patch8 -p0 -b .008
%patch9 -p0 -b .009
%patch10 -p0 -b .010
%patch11 -p0 -b .011
%patch12 -p0 -b .012
%patch13 -p0 -b .013
%patch14 -p0 -b .014

%patch20 -p1 -b .shlib

%build
export CPPFLAGS="-I%{_includedir}/ncurses"
%configure
make %{?_smp_mflags} all shared


%install
[ "${RPM_BUILD_ROOT}" != "/" ] && %__rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}


%makeinstall

mkdir $RPM_BUILD_ROOT/%{_lib}
mv $RPM_BUILD_ROOT%{_libdir}/libreadline.so.* $RPM_BUILD_ROOT/%{_lib}
for l in $RPM_BUILD_ROOT%{_libdir}/libreadline.so; do
    ln -sf $(echo %{_libdir} | \
     sed 's,\(^/\|\)[^/][^/]*,..,g')/%{_lib}/$(readlink $l) $l
done

rm -f $RPM_BUILD_ROOT%{_infodir}/dir

%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && %__rm -rf ${RPM_BUILD_ROOT}

%post
/sbin/ldconfig
/sbin/install-info %{_infodir}/history.info.gz %{_infodir}/dir
/sbin/install-info %{_infodir}/readline.info.gz %{_infodir}/dir

%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%preun
if [ $1 = 0 ]; then
   /sbin/install-info --delete %{_infodir}/history.info.gz %{_infodir}/dir
   /sbin/install-info --delete %{_infodir}/readline.info.gz %{_infodir}/dir
fi

%files
%defattr(-,root,root)
%doc CHANGELOG CHANGES COPYING INSTALL MANIFEST README USAGE
%doc doc/*.{html,pdf}
%{_mandir}/man*/*
%{_infodir}/*.info*
/%{_lib}/libreadline*.so.*
%{_libdir}/libhistory*.so.*


%files devel
%defattr(-,root,root)
%doc examples/
%{_includedir}/readline
%{_libdir}/lib*.a
%{_libdir}/lib*.so

%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
/%{_lib}/libreadline*.so.*
%{_libdir}/libhistory*.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/lib*.a
%{_libdir}/lib*.so
%endif

%changelog
* Sun Apr 17 2011 IWAI, Masaharu <iwai@alib.jp> 5.2-4
- add upstream patches 13,14 (Patch13,14)

* Fri Mar  5 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 5.2-3
- rebuilt with new toolchain
- add Requires(post,pre): /sbin/ldconfig

* Tue Aug 19 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 5.2-2vl5
- build with ncurses-devel
- spec in utf8
- move libncurses.so.* to %%_lib from %%_libdir

* Sat Apr 19 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.2-1vl5
- added upstream patches (patch8-12)

* Fri Oct 19 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 5.2-0vl1
- new upstream release
- update upstream patches (patch1-7)

* Sun Mar 19 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 5.1-0vl1
- new upstream release
- update upstream patches (patch1-4)
- add doc/*.{html,pdf} instead of doc/

* Sun Mar 19 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 4.3-5vl3
- s/Copyright/License/
- add URL
- update source URL
- add PreReq: ldconfig
- move outdated.patch (patch1) to patch10
- add upstream patches (patch1-5)
- add no_rpath.patch (patch11)

* Fri Oct 28 2005 NAKAMURA Kenta <kenta@c.csce.kyushu-u.ac.jp> 4.3-5vl2
- added compat32- packages for x86_64 architecture support
- fixed %files section (TODO* has been removed)

* Sat Mar  8 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 4.3-5vl1
- new upstream release 4.3
- merged with rawhide package.
  * Wed Nov 20 2002 Tim Powers <timp@redhat.com>
  - rebuild in current collinst
  - BuildRequires autoconf only
  * Wed Aug 07 2002 Phil Knirsch <pknirsch@redhat.com> 4.3-3
  - Fixed Esc-O-M stack overflow bug.
  * Mon Jul 22 2002 Phil Knirsch <pknirsch@redhat.com> 4.3-1
  - Updated to latest readline release 4.3
  * Thu Jul 11 2002 Phil Knirsch <pknirsch@redhat.com> 4.2a-7
  - Fixed problem with alpha build.
  * Wed Jul 10 2002 Phil Knirsch <pknirsch@redhat.com>
  - Fixed utf8 problem (originally observed in bash).
  * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 4.2a-6
  - automated rebuild
  * Thu May 23 2002 Tim Powers <timp@redhat.com> 4.2a-5
  - automated rebuild
  * Wed Mar 20 2002 Trond Eivind Glomsrod <teg@redhat.com> 4.2a-4
  - Use autoconf 2.53, not 2.52
  * Mon Mar  4 2002 Bernhard Rosenkraenzer <bero@redhat.com> 4.2a-3
  - Rebuild
  * Mon Nov 26 2001 Matt Wilson <msw@redhat.com> 4.2a-2
  - removed the manual symlinking of .so, readline handles this by itself
  - call only %%makeinstall, not %%makeinstall install install-shared as
    this makes bogus .old files in the buildroot
  * Tue Nov 20 2001 Bernhard Rosenkraenzer <bero@redhat.com> 4.2a-1
  - 4.2a
  * Tue Oct  2 2001 Bernhard Rosenkraenzer <bero@redhat.com> 4.2-4
  - Work around autoconf bug
  * Mon Oct  1 2001 Bernhard Rosenkraenzer <bero@redhat.com> 4.2-3
  - Don't use readline's internal re-implementation of strpbrk on systems
    that have strpbrk - the system implementation is faster and better maintained.
  * Tue Aug  7 2001 Bernhard Rosenkraenzer <bero@redhat.com> 4.2-2
  - Make sure headers can be included from C++ applications (#51131)
    (Patch based on Debian's with the bugs removed ;) )
  * Wed May 09 2001 Florian La Roche <Florian.LaRoche@redhat.de>
  - update to 4.2 and adapt patches
  * Fri Apr  6 2001 Nalin Dahyabhai <nalin@redhat.com>
  - change the paths listed for the header files in the man page to reflect
    the location changes from previous versions (#35073)
  - note that "on" is acceptable instead of "On" in the man page (#21327)
  * Thu Mar  8 2001 Preston Brown <pbrown@redhat.com>
  - fix reading of end key termcap value (@7 is correct, was kH) (#30884)
  * Tue Jan 30 2001 Nalin Dahyabhai <nalin@redhat.com>
  - mark the man page as currently out-of-date (#25294)

* Tue Sep  4 2001 Jun Nishii <jun@vinelinux.org> 4.1-6vl5
- remove texi2dvi and texi2html from doc/

* Fri Jun 29 2001 Jun Nishii <jun@vinelinux.org> 4.1-6vl4
- added doc and examples

* Mon Jun 11 2001 MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
- 4.1-6vl3
- rebuilt for VineSeed

* Wed Dec 13 2000 MATSUBAYASHI 'Shaolin' Kohji <shaolin@rhythmaning.org>
- 4.1-6vl2
- Oops, spec was written in SJIS...

* Sat Dec  9 2000 Jun Nishii <jun@vinelinux.org>
- 4.1-6vl1
- got i18n patch from Kondara

* Thu Sep  7 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging (64bit systems need to use libdir).

* Thu Aug 17 2000 Jeff Johnson <jbj@redhat.com>
- summaries from specspo.

* Wed Aug  2 2000 Florian La Roche <Florian.LaRoche@redhat.com>
- use "rm -f" in specfile

* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Mon Jun  5 2000 Jeff Johnson <jbj@redhat.com>
- FHS packaging.

* Tue Mar 21 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 4.1

* Thu Feb 03 2000 Nalin Dahyabhai <nalin@redhat.com>
- update to 4.0

* Fri Apr 09 1999 Michael K. Johnson <johnsonm@redhat.com>
- added guard patch from Taneli Huuskonen <huuskone@cc.helsinki.fi>

* Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com> 
- auto rebuild in the new build environment (release 4)

* Sun Jul 26 1998 Jeff Johnson <jbj@redhat.com>
- updated to 2.2.1

* Wed May 06 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr

* Wed May 06 1998 Cristian Gafton <gafton@redhat.com>
- don't package /usr/info/dir

* Thu Apr 30 1998 Cristian Gafton <gafton@redhat.com>
- devel package moved to Development/Libraries

* Tue Apr 21 1998 Cristian Gafton <gafton@redhat.com>
- updated to 2.2

* Tue Oct 14 1997 Donnie Barnes <djb@redhat.com>
- spec file cleanups

* Fri Oct 10 1997 Erik Troan <ewt@redhat.com>
- added proper sonames

* Tue Jul 08 1997 Erik Troan <ewt@redhat.com>
- updated to readline 2.1

* Tue Jun 03 1997 Erik Troan <ewt@redhat.com>
- built against glibc
