%define gpmainver 4.4
%define gpver %{gpmainver}.3

Summary: A program for plotting mathematical expressions and data.
Summary(ja):  数学系の関数やデータのプロット・プログラム
Name: gnuplot
Version: %{gpver}
Release: 1%{?_dist_release}

License: gnuplot and GPLv2
Group: Applications/Engineering
URL: http://gnuplot.sourceforge.net/

Source: http://prdownloads.sourceforge.net/gnuplot/gnuplot-%{version}.tar.gz

BuildRoot: %{_tmppath}/%{name}-root
BuildRequires: gd-devel >= 2.0.27, libpng-devel, zlib-devel
BuildRequires: libX11-devel, libXt-devel, wx-gtk2-devel
BuildRequires: readline-devel
BuildRequires: lua-devel cairo-devel pango-devel

BuildRequires: texlive
BuildRequires: texlive-collection-latexextra
BuildRequires: texinfo, emacsen
Requires(post): install-info
Requires(preun): install-info

Vendor: Project Vine
Distribution: Vine Linux
Packager: daisuke, inagaki

%description
Gnuplot is a command-line driven, interactive function plotting
program especially suited for scientific data representation.  Gnuplot
can be used to plot functions and data points in both two and three
dimensions and in many different formats.

Install gnuplot if you need a graphics package for scientific data
representation.

%description -l ja
Gnuplotはとりわけ科学データ・プレゼンテーションに適した、コマンド
操作によるインタラクティブな関数プロット・プログラムです。
Gnuplotは関数や座標データを同時にプロットしたり、3次元化やさまざ
まな形式で表現するのに利用することができます。

科学データプレゼンテーション用のグラフィック・パッケージが必要な
場合、gnuplotをインストールしてください。

%prep
%setup -q

%build
#autoreconf -f -i
%ifarch alpha
%define optflags -O0
%endif
%configure --with-readline=gnu --with-png --without-linux-vga --enable-history-file

make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

rm -f demo/Makefile* tutorial/Makefile*

# move app-dafaults to %%_datadir
#mv $RPM_BUILD_ROOT%{_libdir}/X11 $RPM_BUILD_ROOT%{_datadir}/

# move texmf config
mv $RPM_BUILD_ROOT%{_datadir}/texmf-local $RPM_BUILD_ROOT%{_datadir}/texmf

# remove unneeded files
rm -f $RPM_BUILD_ROOT%{_infodir}/dir

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/install-info --quiet --info-dir=%{_infodir} %{_infodir}/gnuplot.info.gz

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

%files
%defattr(-,root,root)
%doc demo tutorial
%doc README README.1ST INSTALL Copyright TODO
%doc PATCHLEVEL VERSION BUGS ChangeLog 
%{_bindir}/gnuplot
%{_libexecdir}/gnuplot/%{gpmainver}/*
%{_datadir}/gnuplot/%{gpmainver}/*
#{_datadir}/X11/app-defaults/Gnuplot
%{_datadir}/texmf/tex/latex/gnuplot
%{_datadir}/emacs/site-lisp/*
%{_infodir}/gnuplot.info*
%{_mandir}/man1/gnuplot.*

%changelog
* Sat Apr 16 2011 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.4.3-1
- update to gnuplot-4.4.3
- use BR: texlive instead of tetex

* Sun May 31 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 4.2.5-1
- update to gnuplot-4.2.5
- drop plus patch (merged in upstream)
- update URL: to new upstream homepage
- fix License:
- build with wxGTK
- add BR: libX11-devel, libXt-devel, wx-gtk2-devel

* Sat Aug 16 2008 Shu KONNO <owa@bg.wakwak.com> 4.0.0-1vl5
- applied new versioning policy, spec in utf-8

* Tue Aug 22 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 4.0.0-0vl6
- add BuildRequires: texinfo, emacsen

* Sun Mar 19 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 4.0.0-0vl5
- rebuild with readline-5.1

* Wed Jun 15 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 4.0.0-0vl4
- update Patch0 to fix 'Invalid char in eps file'
  (thanks to HANAWA Toshihiro)
- add BuildRequires: autoconf, automake

* Sat Nov 20 2004 Satoshi MACHINO <machino@vinelinux.org> 4.0.0-0vl2
- enabled history-file

* Wed Jul 14 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 4.0.0-0vl1
- source update

* Wed Jul 14 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 3.8k.3-0vl1
- source update
- patch update and modified
- add info

* Wed Mar 10 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 3.7.3-2vl3
- rebuild
- fix license
- remove -DUSE_SYSTEM_TIME ([VinePlus:01805])

* Wed Apr 02 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 3.7.3-2vl2
- rebuild with readline-4.3

* Thu Feb 20 2003 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 3.7.3-2vl1
- syncd with RH 3.7.3-2
- modified Yamaga-san's gnuplot3.7.2+1.2.0rc2.patch for 3.7.3

* Fri Jan 25 2002 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 16vl1
- added pathes (patch1,2) from RH

* Sat Aug 25 2001 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 12vl1
- syncd rawhide
- updated to 3.7.1-1.2.0

* Mon Jun  5 2000 Yasuyuki Furukawa <furukawa@vinelinux.org>
- updated to 3.7.1
- updated gnuplot+ patch to 1.1.9 for gnuplot 3.7.1.
- remake SPEC from rawhide.

* Fri May 19 2000 Nalin Dahyabhai <nalin@redhat.com>
- rebuild with new gd, changing gif terminal to jpeg terminal (release 7)

* Mon May 08 2000 Preston Brown <pbrown@redhat.com>
- build for 7.0

* Thu Apr  6 2000 Bill Nottingham <notting@redhat.com>
- use gnu readline, not built-in version

* Mon Apr  3 2000 Bill Nottingham <notting@redhat.com>
- add latex tutorial, demo files, other docs (#10508)

* Wed Mar  1 2000 Bill Nottingham <notting@redhat.com>
- update to 3.7.1. Oops.

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

* Thu Nov  4 1999 Bill Nottingham <notting@redhat.com>
- update to 3.7.1

* Mon Oct 11 1999 Bill Nottingham <notting@redhat.com>
- ship some docs.

* Wed Aug 18 1999 Bill Nottingham <notting@redhat.com>
- add a patch to fix postscript output from Bernd Kischnick
 (kisch@die-herrmanns.de)

* Fri Jul 30 1999 Bill Nottingham <notting@redhat.com>
- fix license

* Thu Jul 15 1999 Bill Nottingham <notting@redhat.com>
- rebuild without svgalib

* Tue Jun 15 1999 Bill Nottingham <notting@redhat.com>
- update to 3.7.0.1

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

* Tue Feb  2 1999 Jeff Johnson <jbj@redhat.com>
- update to 3.7.

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

* Fri Sep 11 1998 Jeff Johnson <jbj@redhat.com>
- update to 2.6beta347

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

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

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

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