Summary: A X front-end for the Ghostscript PostScript(TM) interpreter
Summary(ja): PostScript(TM) インタープリタである ghostscript の拡張フロントエンド
Name: gv
Version: 3.6.8
Release: 1%{?_dist_release}
License: GPL
Group: Applications/Publishing
URL: http://www.gnu.org/software/gv/
Source0: ftp://ftp.gnu.org/gnu/gv/gv-%{version}.tar.gz
Source1: gv.desktop

Patch0: gv-3.5.8-buffer.patch
Patch1: gv-3.6.1-pkglibdir.patch

# security fix
Patch100: gv-3.6.2-CVE-2006-5864.patch

Requires: ghostscript
Requires(post): desktop-file-utils, install-info
Requires(preun): install-info
Requires(postun): desktop-file-utils
BuildRequires: Xaw3d-devel, texinfo
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Obsoletes: ghostview

Distribution: Vine Linux
Vendor: Project Vine

%description
Gv is a user interface for the Ghostscript PostScript(TM) interpreter.
Gv can display PostScript and PDF documents on an X Window System.

Install the gv package if you'd like to view PostScript and PDF
documents on your system.  You'll also need to have the ghostscript
package and X installed.

%description -l ja
Gv は PostScript(TM) インタープリターである ghostscript のための
ユーザーインターフェースを提供します。ghostscript プログラムにより、
gv は X Window System を使用して、PostScript と PDF ドキュメントを
表示することができます。

システム上で PostScript や PDF のドキュメントを表示したいときには
gv プログラムをインストールしてください。ghostscript と X Window System
も必要です。

%prep
%setup -q

##%patch0 -p1 -b .buffer
%patch1 -p1 -b .pkglibdir

# security fix
#%patch100 -p1 -b .CVE-2006-5864

%build
%configure
%__make %{?_smp_mflags}

%install
%__rm -rf %{buildroot}
%makeinstall

# symlink
%__mkdir_p %{buildroot}%{_bindir}
%__ln_s -f gv %{buildroot}%{_bindir}/ghostview

# desktop file
%__mkdir_p %{buildroot}%{_datadir}/applications
%__install -p -m644 %{SOURCE1} %{buildroot}%{_datadir}/applications/

%clean
%__rm -rf %{buildroot}

%post
%{_bindir}/update-desktop-database %{_datadir}/applications > /dev/null 2>&1 ||:
%{_syssbindir}/install-info %{_infodir}/%{name}.info %{_infodir}/dir ||:

%preun
[ "$1" = "1" ] && exit
%{_syssbindir}/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir ||:

%postun
[ "$1" = "1" ] && exit
%{_bindir}/update-desktop-database %{_datadir}/applications > /dev/null 2>&1 ||:

%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_bindir}/gv
%{_bindir}/ghostview
%{_datadir}/gv
%{_datadir}/applications/*.desktop
%{_infodir}/gv.info*
%{_mandir}/man1/gv.*

%changelog
* Tue Mar 23 2010 Shu KONNO <owa@bg.wakwak.com> 3.6.8-1
- rebuit with new toolchain
- new upstream release
- dropt Patch0: gv-3.5.8-buffer.patch

* Sat Aug 23 2008 Shu KONNO <owa@bg.wakwak.com> 3.6.5-1vl5
- new upstream release
- dropt gv-3.6.2-CVE-2006-5864.patch (fixed)
- applied new versioning policy, spec in utf-8

* Sun Mar 11 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.6.2-0vl4
- rebuild with Xaw3d-1.5E

* Sun Dec 17 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.6.2-0vl3
- s/descrption/description/

* Wed Dec 13 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.6.2-0vl2
- add BuildRequires: texinfo

* Tue Dec 12 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.6.2-0vl1
- [SECURITY FIX]
  - new upstream release
  - add patch100 to fix stack-based buffer overflow (CVE-2006-5864)
- drop obsolete patches
- update URLs
- update desktop file
  - add application/pdf into MimeType
  - use postscript-viewer.png as icon

* Fri Sep 08 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 3.5.8_jp-23vl4
- add and update desktop file (source1)
- move desktop file to /usr/share/applications
- exec update-desktop-database at %post,%postun
- add Requires(post,postun): desktop-file-utils

* Sun Jul 23 2006 NAKAMURA Kenta <kenta@vinelinux.org> 3.5.8_jp-23vl3
- rebuild with Xaw3d-1.5-17vl3 (libXaw3d.so.8)
- /Copyright/License/

* Wed Dec 10 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 3.5.8_jp-23vl2
- merged with rawhide package
- added pathc7

* Wed Mar 06 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 3.5.8_jp-9vl2
- merged with rawhide package
  * Tue Aug  8 2000 Jun Nishii <jun@vinelinux.org>
  - gv-3.5.8_jp-9vl1
  - follow up with RHL62
  * Tue Nov 23 1999 Norihito Ohmori <ohmori@flatout.org>
  - modify for Vine Linux.
  * Mon Nov 8 1999 Toru Hoshina <t@kondara.org>
  - be a NoSrc :-P
  * Tue Nov 2 1999 Norihito Ohmori <nono@kondara.org>
  - I18N-mb.patch build bug fix.
  * Sat Oct 29 1999 Norihito Ohmori <nono@kondara.org>
  - rebuild for Kondara.
  * Tue Oct 12 1999 Norihito Ohmori <ohmori@flatout.org>
  - change papersize Letter -> A4
  * Tue Oct 12 1999 Yasuyuki Furukawa <yasu@on.cs.keio.ac.jp>
  - (Vine)adjust font settings and some Japanese messages
  - added I18N patch (by Daisuke Suzuki)

* Thu Feb 21 2002 Bill Nottingham <notting@redhat.com>
- rebuild

* Fri Jan 25 2002 Bill Nottingham <notting@redhat.com>
- fix anti-aliasing (#58686)

* Fri Jul 13 2001 Bill Nottingham <notting@redhat.com>
- fix some build issues (#48983, #48984)

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

* Fri Jun  9 2000 Bill Nottingham <notting@redhat.com>
- add filename quoting patch from debian
- rebuild in new build environment

* Mon May  8 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- rebuild with new libXaw3d

* Mon Feb 07 2000 Preston Brown <pbrown@redhat.com>
- wmconfig -> desktop

* Thu Feb  3 2000 Bill Nottingham <notting@redhat.com>
- handle compressed man pages

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

* Mon Jan 23 1999 Michael Maher <mike@redhat.com>
- fixed bug #272, changed group

* Thu Dec 17 1998 Michael Maher <mike@redhat.com>
- built pacakge for 6.0

* Sat Aug 15 1998 Jeff Johnson <jbj@redhat.com>
- build root

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

* Fri Apr 10 1998 Cristian Gafton <gafton@redhat.com>
- Manhattan build

* Thu Nov 06 1997 Cristian Gafton <gafton@redhat.com>
- we are installin a symlink to ghostview

* Wed Oct 21 1997 Cristian Gafton <gafton@redhat.com>
- updated to 3.5.8

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

* Tue Apr 15 1997 Erik Troan <ewt@redhat.com>
- added ghostscript requirement, added errlist patch for glibc.
