-Summary: GNU plotting package
-Summary(de): GNU-Plotter-Paket
-Summary(fr): Le programme de traçage de courbe de GNU.
-Summary(pl): GNU program do robienia wykresów
-Summary(tr): Matematiksel görselleþtirme paketi
-Name: gnuplot
-Version: 3.7
-Release: 1
-Copyright: GPL
-Group: Applications/Math
-Group(pl): Aplikacje/Matematyczne
-Source: ftp://ftp.gnuplot.vt.edu/pub/gnuplot/%{name}-%{version}.tar.gz
-URL: http://www.geocities.com/SiliconValley/Foothills/6647/
-BuildPrereq: readline-devel
-BuildPrereq: libpng-devel
-BuildPrereq: XFree86-devel
-BuildPrereq: gd-devel
-BuildPrereq: svgalib-devel
-BuildPrereq: zlib-devel
-BuildPrereq: ncurses-devel
-BuildRoot: /tmp/%{name}-%{version}-%{release}-root
+#
+# Conditional build:
+%bcond_without pdf # don't use pdflib
+#
+Summary: A program for plotting mathematical expressions and data
+Summary(de): GNU-Plotter-Paket
+Summary(es): Paquete para trazar gráficos
+Summary(fr): Le programme de traçage de courbe de GNU
+Summary(pl): Program GNU do robienia wykresów
+Summary(pt_BR): Pacote para traçar gráficos
+Summary(ru): ðÒÏÇÒÁÍÍÁ ÄÌÑ ÐÏÓÔÒÏÅÎÉÑ ÇÒÁÆÉËÏ× ÍÁÔÅÍÁÔÉÞÅÓËÉÈ ×ÙÒÁÖÅÎÉÊ É ÄÁÎÎÙÈ
+Summary(tr): Matematiksel görselleþtirme paketi
+Summary(uk): ðÒÏÇÒÁÍÁ ÄÌÑ ÐÏÂÕÄÏ×É ÇÒÁÆ¦Ë¦× ÍÁÔÅÍÁÔÉÞÎÉÈ ×ÉÒÁÚ¦× ÔÁ ÄÁÎÉÈ
+Name: gnuplot
+Version: 4.0.0
+Release: 5
+License: distributable (with modifications properly marked if any)
+Group: Applications/Math
+Source0: http://dl.sourceforge.net/gnuplot/%{name}-%{version}.tar.gz
+# Source0-md5: 66258443d9f93cc4f46b147dac33e63a
+Source1: %{name}.desktop
+Source2: %{name}.png
+Patch0: %{name}-info.patch
+Patch1: %{name}-info_install.patch
+Patch2: %{name}-no_lisp.patch
+URL: http://gnuplot.sourceforge.net/
+BuildRequires: autoconf >= 2.59-9
+BuildRequires: automake
+BuildRequires: gd-devel
+BuildRequires: libpng-devel >= 1.0.8
+BuildRequires: libtool
+BuildRequires: ncurses-devel
+%{?with_pdf:BuildRequires: pdflib-devel}
+BuildRequires: readline-devel
+BuildRequires: texinfo
+#BuildRequires: xemacs-lisp-programming
+BuildRequires: xorg-lib-libX11-devel
+BuildRequires: zlib-devel
+#or --without-lisp-files
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _datadir %{_prefix}/share/misc
%description
-This is the GNU plotting package. It can be used to graph
-data in an X window or to a file.
+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.
%description -l de
-Das GNU-Plotting-Paket. Dient zur grafischen Ausgabe von Daten in
-einem X-Fenster oder in eine Datei.
+Das GNU-Plotting-Paket. Dient zur grafischen Ausgabe von Daten in
+einem X-Fenster oder in eine Datei.
+
+%description -l es
+Este es el paquete GNU de ploteado. Se puede usar para crear gráficos
+en X Window o para archivo.
%description -l fr
Paquetage de tracé de GNU. Il peut être utilisé pour faire des graphes
GNU plot rysuje wykresy, które mo¿na drukowaæ, zapisywaæ w pliku albo
ogl±daæ w okienku X.
+%description -l pt_BR
+Este é o pacote GNU de plotagem. Pode ser usado para gerar gráficos em
+X Window ou para arquivo.
+
+%description -l ru
+Gnuplot - ÜÔÏ ÉÎÔÅÒÁËÔÉ×ÎÁÑ ÐÒÏÇÒÁÍÍÁ ÐÏÓÔÒÏÅÎÉÑ ÇÒÁÆÉËÏ×, ÕÐÒÁ×ÌÑÅÍÁÑ
+Ó ËÏÍÁÎÄÎÏÊ ÓÔÒÏËÉ. Gnuplot ÏÓÏÂÅÎÎÏ ÈÏÒÏÛÏ ÐÏÄÈÏÄÉÔ ÄÌÑ ÐÒÅÚÅÎÔÁÃÉÉ
+ÎÁÕÞÎÙÈ ÄÁÎÎÙÈ É ÍÏÖÅÔ ÐÒÉÍÅÎÑÔØÓÑ ÄÌÑ ÏÔÏÂÒÁÖÅÎÉÑ ÆÕÎËÃÉÊ É ÄÁÎÎÙÈ ×
+2-È É 3-È ÉÚÍÅÒÅÎÉÑÈ É ×Ï ÍÎÏÇÉÈ ÒÁÚÌÉÞÎÙÈ ÆÏÒÍÁÔÁÈ.
+
%description -l tr
-Gnuplot, bir fonksiyonun ya da bir veri kümesinin grafiðinin elde edilmesinde
-kullanýlan, çok yetenekli bir görselleþtirme aracýdýr.
+Gnuplot, bir fonksiyonun ya da bir veri kümesinin grafiðinin elde
+edilmesinde kullanýlan, çok yetenekli bir görselleþtirme aracýdýr.
+
+%description -l uk
+Gnuplot - ÃÅ ¦ÎÔÅÒÁËÔÉ×ÎÁ ÐÒÏÇÒÁÍÁ ÐÏÂÕÄÏ×É ÇÒÁƦ˦×, ÑËÁ ËÅÒÕ¤ÔØÓÑ Ú
+ËÏÍÁÎÄÎÏÇÏ ÒÑÄËÁ. Gnuplot ÏÓÏÂÌÉ×Ï ÇÁÒÎÏ Ð¦ÄÈÏÄÉÔØ ÄÌÑ ÐÒÅÚÅÎÔÁæ§
+ÎÁÕËÏ×ÉÈ ÄÁÎÉÈ ÔÁ ÍÏÖÅ ÚÁÓÔÏÓÏ×Õ×ÁÔÉÓØ ÄÌÑ ×¦ÄÏÂÒÁÖÅÎÎÑ ÆÕÎËÃ¦Ê ÔÁ
+ÄÁÎÉÈ × 2-È ÔÁ 3-È ×ÉͦÒÁÈ ÔÁ × ÂÁÇÁÔØÏÈ Ò¦ÚÎÉÈ ÆÏÒÍÁÔÁÈ.
%prep
-%setup -q
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
%build
-CFLAGS="$RPM_OPT_FLAGS" \
-./configure \
- --target=%{_target_platform} \
- --host=%{_host} \
- --prefix=/usr/X11R6 \
- --with-gnu-readline \
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoheader}
+%{__autoconf}
+%{__automake}
+
+%configure \
+ --with-readline=gnu \
+ --enable-history-file \
--with-png \
--with-gd \
- --with-x
-make
+ --with-x \
+ --without-lisp-files \
+ --without-linux-vga \
+ %{!?with_pdf:--without-pdf} \
+ --without-tutorial
+
+# The source tarball incorrectly includes a file that should not be there.
+rm -f src/getcolor_x11.*
+
+%{__make}
+cd docs
+makeinfo gnuplot.texi
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/usr/X11R6/{bin,share/man/man1}
+install -d $RPM_BUILD_ROOT{%{_infodir},%{_desktopdir},%{_pixmapsdir}}
-install -s gnuplot gnuplot_x11 $RPM_BUILD_ROOT/usr/X11R6/bin
-install docs/gnuplot.1 $RPM_BUILD_ROOT/usr/X11R6/share/man/man1
-install docs/gnuplot.gih $RPM_BUILD_ROOT/usr/X11R6/share
+install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
+install %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
-gzip -9fn $RPM_BUILD_ROOT/usr/X11R6/share/man/man1/*
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
+%post
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
+%postun
+[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
+
%files
%defattr(644,root,root,755)
-%attr(755,root,root) /usr/X11R6/bin/*
-/usr/X11R6/share/man/man1/*
-/usr/X11R6/share/gnuplot.gih
-
-%changelog
-* Sun Jan 24 1999 Artur Frysiak <wiget@usa.net>
- [3.7-1]
-- changed Sources address
-- changed URL address
-
-* Sat Oct 17 1998 Tomasz K³oczko <kloczek@rudy.mif.pg.gda.pl>
- [3.6beta347-2]
-- changed way pass $RPM_OPT_FLAGS (as a configure eviroment variable).
-
-* Mon Sep 28 1998 Marcin 'Qrczak' Kowalczyk <qrczak@knm.org.pl>
- [3.6beta347-1]
-- changed Version / Release numbering scheme,
-- use %{name} and %{version} macros,
-- `mkdir -p' replaced with more standard `install -d',
-- added full %attr description in %files,
-- removed unnecessary empty /usr/share/gnuplot directory,
-- added pl translation,
-- fixed using $RPM_OPT_FLAGS.
-
-* 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
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_libdir}/%{name}
+%{_mandir}/man1/*
+%{_datadir}/%{name}
+%{_infodir}/gnuplot*
+%{_desktopdir}/*.desktop
+%{_pixmapsdir}/*