%define _sysconfdir /etc/joe

Summary: An easy to use, modeless text editor.
Name: joe
Version: 2.9.7
Release: 12
License: GPL
Group: Applications/Editors
Source: http://prdownloads.sourceforge.net/joe-editor/joe-%{version}.tgz
URL: http://sourceforge.net/projects/joe-editor/
Requires: ncurses
BuildRequires: ncurses-devel
Buildroot: %{_tmppath}/%{name}-%{version}-root
Patch0: joe-2.9.7-bounds.patch
Patch1: joe-2.9.7-help.patch
Patch2: joe-2.9.7-zerorc.patch
Patch3: joe-2.9.7-restrict.patch
Patch4: joe-2.9.7-build.patch

%description
Joe is a powerful, easy to use, modeless text editor.
It uses the same WordStar keybindings used in Borland's development
environment.

%prep
%setup -q

%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
./configure --prefix=/usr --sysconfdir=/etc/joe
make

%install
rm -fr $RPM_BUILD_ROOT
%makeinstall

# This is strange...
pushd $RPM_BUILD_ROOT/usr/bin
popd

# This is automatically compressed afterwards...
pushd $RPM_BUILD_ROOT/%{_mandir}/man1
ln -s joe.1 jmacs.1
ln -s joe.1 jpico.1
ln -s joe.1 jstar.1
ln -s joe.1 rjoe.1
popd

%files
%defattr(-,root,root)
%doc README TODO INFO
/usr/bin/*
%dir /etc/joe
%config(noreplace) /etc/joe/*
%{_mandir}/man1/*

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Thu Jan 2 2003 Lon Hohberger <lhh@redhat.com> 2.9.7-11
- Added fix for #80673 - 'restrict' (C99 keyword) used as variable.
- Fixed build bugs on i386.

* Tue Nov 11 2002 Lon Hohberger <lhh@redhat.com> 2.9.7-9
- Fixed zero-byte rc file hang.

* Tue Nov 06 2002 Lon Hohberger <lhh@redhat.com> 2.9.7-8
- Cleaned up warnings on ppc/ia32/ia64.
- Fixed help message.
- Fixed bugs on ia64 and ppc architectures.
- Fixed build bugs on ia64.

* Mon Jul 22 2002 Trond Eivind Glomsrød <teg@redhat.com> 2.9.7-7
- Make it build again (auto*... sigh. #69409)

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Feb 21 2002 Trond Eivind Glomsrød <teg@redhat.com> 2.9.7-4
- Rebuild

* Mon Feb  4 2002 Trond Eivind Glomsrød <teg@redhat.com> 2.9.7-3
- The joe.1 man-page was called <autoconf-arch-string>-joe.1

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Nov  8 2001 Trond Eivind Glomsrød <teg@redhat.com> 2.9.7-1
- 2.9.7

* Mon Jul 30 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Patch for wordwrap problem (#50321)

* Mon Jun  4 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 2.9.6 - someone's developing it again, on sourceforge
- all patches absorbed or unnecesarry
- add doc files and URL
- use %%configure and %%makeinstall

* Wed Feb 28 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Don't try to read .joerc from CWD (#30031)
- make sure the docs say /etc/joe everywhere

* Fri Nov 17 2000 Trond Eivind Glomsrød <teg@redhat.com>
- clean up the patch file from yesterday

* Thu Nov 16 2000 Trond Eivind Glomsrød <teg@redhat.com>
- security fix - don't blindly write to DEADJOE, unlink it
  and create it safely first

* Mon Oct 09 2000 Trond Eivind Glomsrød <teg@redhat.com>
- added patch so it will build on Red Hat 6.x (#18639)

* Wed Jul 19 2000 Jakub Jelinek <jakub@redhat.com>
- fix the vfile patch

* Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Fri Jun 30 2000 Trond Eivind Glomsrød <teg@redhat.com>
- added new patch for supporting big files (15+ MB).
- obsoleted one of our which is contained within the
  above patch

* Tue Jun 27 2000 Trond Eivind Glomsrød <teg@redhat.com>
- move config files to /etc/joe

* Tue Jun 27 2000 Trond Eivind Glomsrød <teg@redhat.com>
- added new patch for resizing, by Seth Vidal
- removed an old patch which did almost the same thing,
  but not as well

* Tue Jun 20 2000 Trond Eivind Glomsrød <teg@redhat.com>
- disabled a patch which no longer works

* Mon Jun 19 2000 Trond Eivind Glomsrød <teg@redhat.com>
- and yet another

* Mon Jun 19 2000 Trond Eivind Glomsrød <teg@redhat.com>
- once more

* Mon Jun 19 2000 Trond Eivind Glomsrød <teg@redhat.com>
- rebuild

* Wed Jun 07 2000 Trond Eivind Glomsrød <teg@redhat.com>
- use symlinked man pages
- use %%{_mandir}

* Wed May  3 2000 Bill Nottingham <notting@redhat.com>
- fix for ia64 (sizeof(int) != sizeof(time_t))

* Wed Apr 26 2000 Trond Eivind Glomsrød <teg@redhat.com>
- fixed a problem loading .joerc. Thanks to Jeff Peters
  for the patch (#11049)

* Wed Apr 26 2000 Trond Eivind Glomsrød <teg@redhat.com>
- patched it to restore the tty after exiting

* Thu Apr 20 2000 Trond Eivind Glomsrød <teg@redhat.com>
- gzip man page
- hardlink the joe man page to jmacs, jpico, jstar, rjoe


* Fri Mar 31 2000 Bill Nottingham <notting@redhat.com>
- add patch to fix coredumps on quit for large files
  (b4506055@csie,ntu.edu.tw, #5372)

* Mon Feb  7 2000 Bill Nottingham <notting@redhat.com>
- handle compressed manpages

* Tue Jan 18 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Add patch from Hans de Goede <hans@highrise.nl> to fix the End key

* Tue Sep 07 1999 Cristian Gafton <gafton@redhat.com>
- patch for closing on some buffer overflow problems (not that is really
  critical...)

* Thu Sep  2 1999 Jeff Johnson <jbj@redhat.com>
- DEADJOE files shouldn't be world readable (#4219).

* Thu Aug 12 1999 Cristian Gafton <gafton@redhat.com>
- add patch from Giuseppe Ghibo' <ghibo@caesar.polito.it> to fix resizing
  problems

* Sun May 16 1999 Jeff Johnson <jbj@redhat.com>
- don't rely on (broken!) rpm %patch (#2735)

* Fri Apr 09 1999 Cristian Gafton <gafton@redhat.com>
- added locale patch from  Petr Kolar <PETR.KOLAR@vslib.cz>
  (yeah, finally!)

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

* Wed Jan 20 1999 Alex deVries <puffin@redhat.com>
- added mipseb support

* Fri Dec 18 1998 Cristian Gafton <gafton@redhat.com>
- build for glibc 2.1

* Tue Sep 15 1998 Cristian Gafton <gafton@redhat.com>
- built with Alan's -port patch

* Fri May 08 1998 Cristian Gafton <gafton@redhat.com>
- enable -asis in the config files so international keyboards will be better
  supported

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

* Fri May 01 1998 Cristian Gafton <gafton@redhat.com>
- /usr/lib/joe/* are config files

* Thu Apr 09 1998 Cristian Gafton <gafton@redhat.com>
- manhattan build

* Thu Dec 11 1997 Cristian Gafton <gafton@redhat.com>
- fixed termcap problems for terms other than 80x25
- added support for buildroot and BuildRoot

* Mon Jul 21 1997 Erik Troan <ewt@redhat.com>
- built against glibc