573225c
Name:           grace
40af485
Version:        5.1.19
58417c8
Release:        2%{?dist}
c6e6296
Summary:        Numerical Data Processing and Visualization Tool
573225c
573225c
License:        GPL
58417c8
# Xbae is BSD and cephes is LGPL, see also Source3 and Source4 
573225c
URL:            http://plasma-gate.weizmann.ac.il/Grace/
573225c
Source0:        ftp://plasma-gate.weizmann.ac.il/pub/grace/src/grace5/%{name}-%{version}.tar.gz
573225c
Source1:        %{name}.desktop
573225c
Source2:        %{name}.png
58417c8
Source3:	cephes-license.email
58417c8
Source4:	LICENSE.cephes
573225c
Patch:          %{name}-gracerc-no_auxiliary.diff
573225c
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
573225c
Group:          Applications/Engineering
573225c
573225c
BuildRequires:  libjpeg-devel, libpng-devel, netcdf-devel
58417c8
BuildRequires:  zlib-devel, xorg-x11-devel, fftw2-devel, t1lib-devel
c6e6296
BuildRequires:  openmotif-devel, gcc-g77
573225c
BuildRequires:  desktop-file-utils, font-utils
573225c
Requires:	nedit
573225c
Requires(post): chkfontpath
573225c
Requires(postun): chkfontpath
573225c
573225c
%description
573225c
Grace is a Motif application for two-dimensional data visualization.
573225c
Grace can transform the data using free equations, FFT, cross- and
573225c
auto-correlation, differences, integrals, histograms, and much more. The
573225c
generated figures are of high quality.  Grace is a very convenient tool
573225c
for data inspection, data transformation, and and for making figures for
573225c
publications.
573225c
573225c
573225c
%package devel
573225c
Summary:        Files needed for grace development
573225c
Group:          Development/Libraries
573225c
License:        LGPL
573225c
Requires:       %{name} = %{version}-%{release}
573225c
573225c
%description devel
573225c
Install these files if you need to compile software that requires grace.
573225c
573225c
573225c
%prep
573225c
%setup -q
573225c
%patch
573225c
573225c
%build
58417c8
cp %{SOURCE3} %{SOURCE4} .
573225c
%configure \
573225c
    --enable-editres \
573225c
    --with-editor=nedit \
573225c
    --with-printcmd="lpr" \
573225c
    --enable-grace-home=%{_datadir}/%{name} \
573225c
    --disable-pdfdrv \
573225c
    --with-x \
573225c
    --with-extra-incpath=%{_includedir}/netcdf-3 \
573225c
    --with-extra-ldpath=%{_libdir}/netcdf-3
573225c
    
573225c
make %{?_smp_mflags}
573225c
573225c
573225c
%install
573225c
rm -rf %{buildroot}
573225c
make install DESTDIR=%{buildroot}
573225c
573225c
cp Xbae/LICENSE LICENSE.Xbae
573225c
rm -f doc/*.1
573225c
573225c
mkdir -pm 755                               \
573225c
    %{buildroot}%{_bindir}                  \
573225c
    %{buildroot}%{_includedir}              \
573225c
    %{buildroot}%{_libdir}		    \
573225c
    %{buildroot}%{_datadir}/pixmaps         \
573225c
    %{buildroot}%{_datadir}/applications    \
573225c
    %{buildroot}%{_mandir}/man1             \
573225c
    %{buildroot}%{_sysconfdir}/%{name}
c6e6296
573225c
##
573225c
# Let's have some sanity
573225c
#
573225c
pushd %{buildroot}%{_datadir}/%{name}
573225c
install -pm 755 bin/*   %{buildroot}%{_bindir}/
573225c
rm -rf bin
573225c
ln -s %{_bindir} bin
573225c
install -pm 755 lib/*   %{buildroot}%{_libdir}/
573225c
rm -rf lib
573225c
ln -s %{_libdir} lib
573225c
install -pm 644 include/* %{buildroot}%{_includedir}/
573225c
rm -rf include
573225c
ln -s %{_includedir} include
573225c
install -pm 644 doc/*.1 %{buildroot}%{_mandir}/man1/
573225c
# doc and example directories are removed from GRACE_HOME and put in %doc
573225c
rm -rf doc
573225c
rm -rf examples
573225c
# the convcal source file shouldn't appear in %doc, it is removed here
573225c
rm -f auxiliary/convcal.c
573225c
# move config files to %{_sysconfdir} and do symlinks
573225c
for conf in gracerc templates gracerc.user; do
573225c
    mv $conf %{buildroot}%{_sysconfdir}/%{name}
573225c
    ln -s %{_sysconfdir}/%{name}/$conf $conf
573225c
done
573225c
mv fonts/FontDataBase %{buildroot}%{_sysconfdir}/%{name}
573225c
ln -s %{_sysconfdir}/%{name}/FontDataBase fonts/FontDataBase
573225c
popd
573225c
mkfontdir %{buildroot}%{_datadir}/%{name}/fonts/type1
573225c
##
573225c
# Desktop stuff
573225c
#
573225c
install -pm 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps/%{name}.png
573225c
install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/%{name}.desktop
573225c
desktop-file-install --vendor fedora --delete-original    \
573225c
    --dir %{buildroot}%{_datadir}/applications          \
573225c
    --add-category Application                          \
573225c
    --add-category Graphics	                            \
573225c
    %{buildroot}%{_datadir}/applications/%{name}.desktop
573225c
573225c
573225c
%clean
573225c
rm -rf %{buildroot}
573225c
573225c
573225c
%post
573225c
%{_sbindir}/chkfontpath -q -a %{_datadir}/%{name}/fonts/type1
573225c
573225c
573225c
%postun
573225c
%{_sbindir}/chkfontpath -q -r %{_datadir}/%{name}/fonts/type1
573225c
573225c
573225c
%files
573225c
%defattr(-,root,root,-)
573225c
%doc ChangeLog CHANGES COPYRIGHT DEVELOPERS LICENSE README LICENSE.Xbae
573225c
%doc cephes-license.email LICENSE.cephes
573225c
%doc examples/ doc/ 
573225c
%config(noreplace) %{_sysconfdir}/%{name}/
573225c
%{_bindir}/*
573225c
%{_datadir}/%{name}
573225c
%exclude %{_datadir}/%{name}/include
573225c
%exclude %{_datadir}/%{name}/lib
573225c
%{_datadir}/applications/*
573225c
%{_datadir}/pixmaps/*
573225c
%{_mandir}/man*/*
573225c
573225c
573225c
%files devel
573225c
%defattr(-,root,root,-)
573225c
%doc grace_np/LICENSE
573225c
%{_includedir}/*
573225c
%{_datadir}/%{name}/include
573225c
%{_libdir}/*
573225c
%{_datadir}/%{name}/lib
573225c
573225c
573225c
%changelog
58417c8
* Wed Feb  1 2006 José Matos <jamatos@fc.up.pt> - 5.1.19-2
58417c8
- Update BR from fftw to fftw2.
58417c8
- Remove references to previous profile scripts.
58417c8
58417c8
* Thu Jan 12 2006 José Matos <jamatos@fc.up.pt> - 5.1.19-1
40af485
- new upstream version
40af485
58417c8
* Thu Jan 12 2006 José Matos <jamatos@fc.up.pt> - 5.1.18-8
c6e6296
- remove name from Summary
c6e6296
- disable setting environment variable GRACE_HOME
c6e6296
- use g77 as the fortran compiler
c6e6296
573225c
* Mon Jan  9 2006 Patrice Dumas <dumas@centre-cired.fr> - 5.1.18-7
573225c
- put config files in /etc
573225c
- licence is GPL and not BSD/GPL, as it is not dual licensed
573225c
573225c
* Wed Sep 14 2005 José Matos <jamatos@fc.up.pt> - 5.1.18-6
573225c
- Require nedit as an explicit Require.
573225c
573225c
* Tue Sep 13 2005 José Matos <jamatos@fc.up.pt> - 5.1.18-5
573225c
- Normalize buildroot and change default editor to nedit.
573225c
573225c
* Fri Sep  9 2005 José Matos <jamatos@fc.up.pt> - 5.1.18-4
573225c
- Add license to cephes library as well as the original mail where permission is given.
573225c
- Move permission of profile.d files from 644 to 755.
573225c
573225c
* Sat Sep  3 2005 Patrice Dumas <dumas@centre-cired.fr> - 5.1.18-3
573225c
- cleanup licences
573225c
- put examples/ and doc/ in %doc
573225c
- remove duplicate manpages 
573225c
- add patch to change fdf2fit path in graderc
573225c
573225c
* Sun Aug 21 2005 José Matos <jamatos@fc.up.pt> - 5.1.18-2
573225c
- Add post and postun requires.
573225c
573225c
* Sat Aug 20 2005 José Matos <jamatos@fc.up.pt> - 5.1.18-1
573225c
573225c
- Prepare for Fedora Extras submission, based on a previous spec file
573225c
  from Konstantin Ryabitsev (icon) and Seth Vidal from duke.edu