Skip to content

Instantly share code, notes, and snippets.

@VitToCode
Created June 11, 2013 21:22
Show Gist options
  • Save VitToCode/5760827 to your computer and use it in GitHub Desktop.
Save VitToCode/5760827 to your computer and use it in GitHub Desktop.
RPM spec for latest gnuplot (http://www.gnuplot.info) Gnuplot >= 4.6.2
Summary: Command-line driven interactive datafile and function plotting utility
Name: gnuplot
Version: 4.6.2
Release: 1.el6
#Epoch: 2
License: GPL
Group: Applications/Mathematics
URL: http://www.gnuplot.info
Source0: http://downloads.sourceforge.net/project/gnuplot/gnuplot/%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-icon.png
Source2: %{name}.pdf.gz
Patch0: %{name}-4.6.2-texinfo-5.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
BuildRequires: glibc-devel atk-devel cairo-devel fontconfig-devel freetype-devel libgcc gd-devel glib-devel gtk2-devel libjpeg-devel
BuildRequires: ncurses-devel pango-devel lua-devel libpng-devel readline-devel libstdc++-devel wxBase wxGTK-devel libX11-devel
BuildRequires: libXpm-devel zlib-devel pdflib-lite-devel tetex tetex-latex tetex-dvips groff texinfo >= 4.8 emacs >= 21.4
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#Requires:
#%_signature gpg
#%_gpg_path /root/.gnupg
#%_gpg_name F7A7F370
#%_gpgbin /usr/bin/gpg
%description
Gnuplot is a portable command-line driven interactive datafile (text or binary) and function plotting utility for UNIX, IBM OS/2, MS Windows, DOS, Apple Macintosh, VMS, Atari and many other platforms.
It was originally intended as graphical program which would allow scientists and students to visualize mathematical functions and data.
It does this job pretty well, and in addition it serves as non-interactive plotting engine for miscellaneous portable third-party applications, like Octave.
Gnuplot is developed and supported since 1986, and having its scripts and commands easy to understand text files, it is time-portable as well.
%package doc
Group: Documentation
Summary: Gnuplot documentation
%description doc
Gnuplot is a portable command-line driven interactive datafile (text or binary) and function plotting utility for UNIX, IBM OS/2, MS Windows, DOS, Apple Macintosh, VMS, Atari and many other platforms.
It was originally intended as graphical program which would allow scientists and students to visualize mathematical functions and data.
It does this job pretty well, and in addition it serves as non-interactive plotting engine for miscellaneous portable third-party applications, like Octave.
This package contains the gnuplot manual in PDF format.
%prep
%setup -q
cp %{SOURCE2} .
%patch0 -p1
%build
%configure
make %{?_smp_mflags}
#make -C docs/psdoc
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
install -D -m644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_datadir}/pixmaps/gnuplot.png
# create the system menu entry
install -d ${RPM_BUILD_ROOT}%{_datadir}/applications
cat > ${RPM_BUILD_ROOT}%{_datadir}/applications/%{name}.desktop << EOF
[Desktop Entry]
Name=Gnuplot
GenericName=Function plotting utility
GenericName[it]=Strumento per generare grafici
Comment=Function plotting utility
Comment[it]=Strumento per disegnare e generare grafici
Exec=konsole --notoolbar --nomenubar -e gnuplot
Icon=%{_datadir}/pixmaps/gnuplot.png
Type=Application
X-KDE-StartupNotify=false
Categories=Utility;
EOF
rm -rf ${RPM_BUILD_ROOT}%{_infodir}/dir
%clean
rm -rf ${RPM_BUILD_ROOT}
%post
if [ -f %{_infodir}/gnuplot.info* ]; then
/sbin/install-info %{_infodir}/gnuplot.info %{_infodir}/dir || :
fi
%preun
if [ $1 = 0 ] ; then # last uninstall
if [ -f %{_infodir}/gnuplot.info* ]; then
/sbin/install-info --delete %{_infodir}/gnuplot.info %{_infodir}/dir || :
fi
fi
%files
%defattr(-,root,root)
%{_bindir}/gnuplot
%{_datadir}/applications/%{name}.desktop
#%{_libdir}/X11/app-defaults/Gnuplot
%{_libexecdir}/*
%{_datadir}/gnuplot/*
%{_datadir}/pixmaps/gnuplot.png
%{_datadir}/emacs/*
%dir %{_datadir}/texmf/tex/latex/gnuplot
%{_datadir}/texmf/tex/latex/gnuplot/gnuplot.cfg
%{_datadir}/texmf/tex/latex/gnuplot/gnuplot-lua-tikz-common.tex
%{_datadir}/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.sty
%{_datadir}/texmf/tex/latex/gnuplot/gnuplot-lua-tikz.tex
%{_datadir}/texmf/tex/latex/gnuplot/t-gnuplot-lua-tikz.tex
%{_infodir}/gnuplot.info.*
%{_mandir}/man1/gnuplot.1.gz
%doc Copyright
%files doc
%defattr(-,root,root)
%doc gnuplot.pdf.gz
%doc README NEWS README.1ST VERSION
%doc docs/psdoc/ps_*
%doc ChangeLog
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment