d1887a8
# relative to datadir
7bdcc63
%define type1fontdir fonts/default/Type1
9465666
573225c
Name:           grace
4c2383d
Version:        5.1.25
Orion Poplawski 63d6fd3
Release:        5%{?dist}
42b5bdb
Summary:        Numerical Data Processing and Visualization Tool
573225c
cca4b42
License:        GPLv2+
b7e59db
# 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
7bdcc63
Source3:        cephes-license.email
7bdcc63
Source4:        LICENSE.cephes
4c2383d
Source5:        http://ftp.de.debian.org/debian/pool/main/g/grace/grace_5.1.25-1.debian.tar.xz
63e6633
63e6633
Patch0:         %{name}-detect-netcdf.diff
63e6633
573225c
BuildRequires:  libjpeg-devel, libpng-devel, netcdf-devel
7f2355d
BuildRequires:  zlib-devel, fftw2-devel, t1lib-devel
67ce883
BuildRequires:  xbae-devel, gcc-gfortran, libXmu-devel
7bdcc63
BuildRequires:  desktop-file-utils
d1887a8
BuildRequires:  libXpm-devel
7bdcc63
# to be able to generate FontDataBase
7bdcc63
BuildRequires:  urw-fonts
7f2355d
d1887a8
Requires:       nedit
d1887a8
Requires:       xdg-utils
7bdcc63
# /usr/share/fonts/default/Type1/
d1887a8
Requires:       urw-fonts
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
14ea548
auto-correlation, differences, integrals, histograms, and much
14ea548
more. The generated figures are of high quality.  Grace is a very
14ea548
convenient tool for data inspection, data transformation, and for
14ea548
making figures for publications.
573225c
573225c
573225c
%package devel
573225c
Summary:        Files needed for grace development
7bdcc63
License:        LGPLv2+
573225c
Requires:       %{name} = %{version}-%{release}
7bdcc63
Provides:       %{name}-static = %{version}-%{release}
573225c
573225c
%description devel
573225c
Install these files if you need to compile software that requires grace.
573225c
573225c
573225c
%prep
Dominik Mierzejewski af57868
%setup -q -D -a 5
67ce883
63e6633
%patch0
b7e59db
# avoid duplicating debian patch
d1887a8
patch -p1 < debian/patches/binary_nostrip.diff
d1887a8
patch -p1 < debian/patches/gracerc.diff
d1887a8
patch -p1 < debian/patches/source-hardening.diff
737ab0d
patch -p1 < debian/patches/tmpnam_to_mkstemp.diff
7bdcc63
d1887a8
# remove bundled libraries
7bdcc63
rm -rf Xbae T1lib
573225c
573225c
%build
a17bf4a
cp %{SOURCE3} %{SOURCE4} .
7218659
export CFLAGS="$RPM_OPT_FLAGS -fPIC"
7218659
export FFLAGS="$RPM_OPT_FLAGS -fPIC"
573225c
%configure \
573225c
    --enable-editres \
573225c
    --with-editor=nedit \
7bdcc63
    --with-helpviewer="xdg-open %s" \
573225c
    --with-printcmd="lpr" \
573225c
    --enable-grace-home=%{_datadir}/%{name} \
573225c
    --disable-pdfdrv \
573225c
    --with-x \
573225c
    --with-f77=gfortran \
cf080a7
    --with-extra-incpath=%{_includedir}/netcdf \
b8de41a
    --with-bundled-xbae=no
b7e59db
573225c
make %{?_smp_mflags}
573225c
573225c
573225c
%install
573225c
make install DESTDIR=%{buildroot}
573225c
573225c
rm -f doc/*.1
573225c
573225c
mkdir -pm 755                               \
573225c
    %{buildroot}%{_bindir}                  \
573225c
    %{buildroot}%{_includedir}              \
7bdcc63
    %{buildroot}%{_libdir}                  \
efc40c3
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps \
573225c
    %{buildroot}%{_datadir}/applications    \
573225c
    %{buildroot}%{_mandir}/man1             \
573225c
    %{buildroot}%{_sysconfdir}/%{name}
42b5bdb
573225c
##
573225c
# Let's have some sanity
573225c
#
573225c
pushd %{buildroot}%{_datadir}/%{name}
2f9234c
573225c
install -pm 755 bin/*   %{buildroot}%{_bindir}/
573225c
rm -rf bin
7bdcc63
ln -s ../../bin bin
2f9234c
7bdcc63
cp -p lib/*   %{buildroot}%{_libdir}/
573225c
rm -rf lib
7bdcc63
ln -s ../../%_lib lib
2f9234c
573225c
install -pm 644 include/* %{buildroot}%{_includedir}/
573225c
rm -rf include
7bdcc63
ln -s ../../include include
2f9234c
7bdcc63
# use fonts from type1fontdir
7bdcc63
rm -rf fonts/type1
7bdcc63
ln -s ../../%{type1fontdir} fonts/type1
7bdcc63
mv fonts/FontDataBase %{buildroot}%{_sysconfdir}/%{name}
7bdcc63
ln -s ../../../../%{_sysconfdir}/%{name}/FontDataBase fonts/FontDataBase
7bdcc63
Dominik Mierzejewski af57868
# regenerate %%{_sysconfdir}/%%{name}/FontDataBase based on what is in
7bdcc63
# type1fontdir and original FontDataBase content
7bdcc63
FontDataBaseFile=%{buildroot}%{_sysconfdir}/%{name}/FontDataBase
7bdcc63
rm -f $FontDataBaseFile.tmp
7bdcc63
for file in %{_datadir}/%{type1fontdir}/*.pfb; do
7bdcc63
  base=`basename $file .pfb`
7bdcc63
  alias=
7bdcc63
  if grep -qs $base $FontDataBaseFile; then
7bdcc63
    # keep original aliases if the exist
7bdcc63
    grep $base $FontDataBaseFile >> $FontDataBaseFile.tmp
7bdcc63
  else
7bdcc63
    # no original alias case. Use FullName from afm file and change space to -
7bdcc63
    if [ -f %{_datadir}/%{type1fontdir}/$base.afm ]; then
7bdcc63
      alias=`grep '^FullName' %{_datadir}/%{type1fontdir}/$base.afm | sed 's/^FullName *//' | sed 's/ *$//' | sed 's/ /-/g'`
7bdcc63
    fi
7bdcc63
    [ "z$alias" = 'z' ] && alias=$base
7bdcc63
    echo "$alias $alias $base.pfb" >> $FontDataBaseFile.tmp
7bdcc63
  fi
7bdcc63
done
7bdcc63
fontcount=`wc -l $FontDataBaseFile.tmp`
7bdcc63
echo $fontcount | sed 's:%{buildroot}.*::' > $FontDataBaseFile
7bdcc63
cat $FontDataBaseFile.tmp >> $FontDataBaseFile
7bdcc63
rm $FontDataBaseFile.tmp
2f9234c
# remove empty lines in file (fixes bug 504413)
2f9234c
sed -i '/^$/d' $FontDataBaseFile
7bdcc63
573225c
install -pm 644 doc/*.1 %{buildroot}%{_mandir}/man1/
Dominik Mierzejewski af57868
# doc and example directories are removed from GRACE_HOME and put in %%doc
375f808
rm -rf doc examples
375f808
ln -s %{?_pkgdocdir}%{!?_pkgdocdir:%{_docdir}/%{name}-%{version}}/{doc,examples} .
2f9234c
7bdcc63
# the convcal source file shouldn't be installed, it is removed here
573225c
rm -f auxiliary/convcal.c
2f9234c
Dominik Mierzejewski af57868
# move config files to %%{_sysconfdir} and do symlinks
573225c
for conf in gracerc templates gracerc.user; do
573225c
    mv $conf %{buildroot}%{_sysconfdir}/%{name}
7bdcc63
    ln -s ../../../%{_sysconfdir}/%{name}/$conf $conf
573225c
done
573225c
popd
7bdcc63
573225c
##
573225c
# Desktop stuff
573225c
#
Dominik Mierzejewski af57868
install -pm 644 debian/icons/grace.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
Dominik Mierzejewski af57868
for sz in 16 22 24 32; do
Dominik Mierzejewski af57868
    install -Dpm 644 debian/icons/grace${sz}.png %{buildroot}%{_datadir}/icons/hicolor/${sz}x${sz}/apps/grace.png
Dominik Mierzejewski af57868
done
359583a
desktop-file-install \
573225c
    --dir %{buildroot}%{_datadir}/applications          \
7bdcc63
    %{SOURCE1}
573225c
7bdcc63
# clean up docs
7bdcc63
rm -rf __dist_doc
7bdcc63
mkdir __dist_doc
7bdcc63
cp -a doc __dist_doc
7bdcc63
rm __dist_doc/doc/Makefile __dist_doc/doc/*.sgml
573225c
573225c
%post
Dominik Mierzejewski af57868
touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
573225c
573225c
%postun
Dominik Mierzejewski af57868
if [ $1 -eq 0 ] ; then
Dominik Mierzejewski af57868
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
Dominik Mierzejewski af57868
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
94f05b8
fi
573225c
Dominik Mierzejewski af57868
%posttrans
Dominik Mierzejewski af57868
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
573225c
573225c
%files
Dominik Mierzejewski af57868
%{!?_licensedir:%global license %%doc}
Dominik Mierzejewski af57868
%license LICENSE
b7e59db
%doc ChangeLog CHANGES COPYRIGHT DEVELOPERS LICENSE README
573225c
%doc cephes-license.email LICENSE.cephes
b7e59db
%doc examples/ __dist_doc/doc/
573225c
%config(noreplace) %{_sysconfdir}/%{name}/
573225c
%{_bindir}/*
573225c
%{_datadir}/%{name}
573225c
%exclude %{_datadir}/%{name}/include
573225c
%exclude %{_datadir}/%{name}/lib
Dominik Mierzejewski af57868
%{_datadir}/applications/grace.desktop
Dominik Mierzejewski af57868
%{_datadir}/icons/hicolor/*/apps/grace.png
Dominik Mierzejewski af57868
%{_mandir}/man1/*.1*
573225c
573225c
%files devel
Dominik Mierzejewski af57868
%license grace_np/LICENSE
Dominik Mierzejewski af57868
%{_includedir}/grace_np.h
573225c
%{_datadir}/%{name}/include
7bdcc63
%{_libdir}/libgrace_np.a
573225c
%{_datadir}/%{name}/lib
573225c
573225c
573225c
%changelog
Orion Poplawski 63d6fd3
* Fri Jan 22 2016 Orion Poplawski <orion@cora.nwra.com> - 5.1.25-5
Orion Poplawski 63d6fd3
- Rebuild for netcdf 4.4.0
Orion Poplawski 63d6fd3
Dominik Mierzejewski af57868
* Sun Oct 18 2015 Dominik Mierzejewski <rpm@greysector.net> - 5.1.25-4
Dominik Mierzejewski af57868
- don't unpack the main source twice
Dominik Mierzejewski af57868
- clean up obsolete specfile parts
Dominik Mierzejewski af57868
- clean up some rpmlint warnings
Dominik Mierzejewski af57868
- tighten file list
Dominik Mierzejewski af57868
- install icons from debian patch
Dominik Mierzejewski af57868
- update icon cache scriptlets
Dominik Mierzejewski af57868
59d31c7
* Fri Oct 16 2015 Kalev Lember <klember@redhat.com> - 5.1.25-3
59d31c7
- Rebuilt for libXm soname bump
59d31c7
9886608
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.25-2
9886608
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9886608
4c2383d
* Wed Feb 25 2015 José Matos <jamatos@fedoraproject.org> - 5.1.25-1
4c2383d
- update to 5.1.25
4c2383d
4c2383d
* Fri Nov 14 2014 José Matos <jamatos@fedoraproject.org> - 5.1.24-1
4c2383d
- update to 5.1.24
4c2383d
ec8edac
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.23-8
ec8edac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
ec8edac
4b7193d
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.23-7
4b7193d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
4b7193d
375f808
* Sat Nov 16 2013 Ville Skyttä <ville.skytta@iki.fi> - 5.1.23-6
375f808
- Fix symlinks to doc and example dirs when doc dir is unversioned (#993800).
375f808
7f7df31
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.23-5
7f7df31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
7f7df31
359583a
* Fri Apr 12 2013 Jon Ciesla <limburgher@gmail.com> - 5.1.23-4
359583a
- Drop desktop vendor tag.
359583a
c9d5edf
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.23-3
c9d5edf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
c9d5edf
Adam Tkac 5a7bc87
* Fri Jan 18 2013 Adam Tkac <atkac redhat com> - 5.1.23-2
Adam Tkac 5a7bc87
- rebuild due to "jpeg8-ABI" feature drop
Adam Tkac 5a7bc87
d1887a8
* Mon Nov 26 2012 José Matos <jamatos@fedoraproject.org> - 5.1.23-1
d1887a8
- New upstream release (bugfixes)
d1887a8
- Drop libpng15 (fixed in this release)
d1887a8
- Use debian patches where it makes sense
d1887a8
f4280dc
* Wed Aug 01 2012 Jon Ciesla <limburgher@gmail.com> - 5.1.22-14
f4280dc
- Tom Lane's zlib, libpng15 fixes, BZ 843647.
f4280dc
4b2b82b
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.22-13
4b2b82b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4b2b82b
7e5f6a0
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.22-12
7e5f6a0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
7e5f6a0
555db80
* Tue Dec 06 2011 Adam Jackson <ajax@redhat.com> - 5.1.22-11
555db80
- Rebuild for new libpng
555db80
e680eb5
* Tue Nov  8 2011 José Matos <jamatos@fedoraproject.org> - 5.1.22-10
e680eb5
- Rebuild for new libpng
e680eb5
Orion Poplawski 19482f3
* Wed Apr 6 2011 Orion Poplawski <orion@cora.nwra.com> - 5.1.22-9
Orion Poplawski 7403638
- Rebuild for netcdf 4.1.2
Orion Poplawski 7403638
9f1ee94
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.22-8
9f1ee94
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
9f1ee94
2f9234c
* Thu Apr  8 2010 José Matos <jamatos@fc.up.pt> - 5.1.22-7
2f9234c
- Fix overzealous fix for bug 504413 (fixes bug 568559).
2f9234c
7218659
* Thu Nov 19 2009 José Matos <jamatos@fc.up.pt> - 5.1.22-6
7218659
- Add compile option -fPIC (#508888)
7218659
e28ed08
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.22-5
e28ed08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e28ed08
60eb658
* Tue Jul 21 2009 José Matos <jamatos@fc.up.pt> - 5.1.22-4
60eb658
- Fix #504413 (remove last newline in FontDataBase)
60eb658
76b34e6
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.22-3
76b34e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
76b34e6
cf080a7
* Thu Oct 16 2008 José Matos <jamatos[AT]fc.up.pt> - 5.1.22-2
cf080a7
- Compile with support for netcdf (# 465458).
cf080a7
198d9d0
* Mon Sep 29 2008 José Matos <jamatos[AT]fc.up.pt> - 5.1.22-1
198d9d0
- new upstream release (5.1.22)
737ab0d
- apply debian patches with -p1
198d9d0
b7e59db
* Thu Feb 14 2008 José Matos <jamatos[AT]fc.up.pt> - 5.1.21-9
b7e59db
- Rebuild for gcc 4.3
b7e59db
cc278ef
* Wed Jan 23 2008 Patrice Dumas <pertusus[AT]free.fr> - 5.1.21-8
cc278ef
- correct netcdf detection patch, thanks José.
cc278ef
1f08680
* Wed Jan 23 2008 Patrice Dumas <pertusus[AT]free.fr> - 5.1.21-7
cc278ef
- add support for previous netcdf version (in epel).
cc278ef
- drop support for monolithic X.
1f08680
e839da5
* Tue Jan 22 2008 Patrice Dumas <pertusus[AT]free.fr> - 5.1.21-6
7bdcc63
- don't add the grace fonts to the X server fonts. Instead use the
7bdcc63
  urw fonts. Regenerate the FontDataBase based on the urw fonts.
7bdcc63
- use xdg-utils instead of htmlview.
7bdcc63
- use relative links.
7bdcc63
- add links to doc and examples in GRACE_HOME to have correct help.
cc278ef
- use debian patch.
cc278ef
- clean docs.
7bdcc63
67ce883
* Fri Sep 28 2007 José Matos <jamatos[AT]fc.up.pt> - 5.1.21-4
67ce883
- Correctly detect netcdf (signature has changed).
67ce883
- Add libXmu-devel as BR.
67ce883
- Add conditional dependency on chkfontpath for <= F8.
67ce883
9465666
* Thu Sep 27 2007 José Matos <jamatos[AT]fc.up.pt> - 5.1.21-3
9465666
- Remove dependency on chkfontpath, thanks to ajax for the patch. (#252277)
9465666
cca4b42
* Tue Aug 28 2007 José Matos <jamatos[AT]fc.up.pt> - 5.1.21-2
cca4b42
- License fix, rebuild for devel (F8).
cca4b42
14ea548
* Thu Mar  8 2007 José Matos <jamatos[AT]fc.up.pt> - 5.1.21-1
14ea548
- Update to 5.1.21 (#231434).
14ea548
- Fix typo in description (#231435).
14ea548
2c8d1f1
* Thu Oct 05 2006 Christian Iseli <Christian.Iseli@licr.org> 5.1.20-6
2c8d1f1
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
2c8d1f1
efc40c3
* Tue Sep 26 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.20-5
efc40c3
- Fix incomplete change from pixmap to icons.
efc40c3
94f05b8
* Sun Sep 24 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.20-4
94f05b8
- Move icon from pixmaps to icons/highcolor/48x48/apps
94f05b8
b8de41a
* Sun Sep 24 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.20-3
b8de41a
- Use external xbae.
b8de41a
- Revert test for fedora macro so that it works by default for latest
b8de41a
  versions if the macro is not defined.
b8de41a
8ac9038
* Mon Sep 11 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.20-2
272313d
- Fix html documentation viewer. (#188696)
272313d
272313d
* Sun Jun 11 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.20-1
7fe7659
- New upstream version
7fe7659
- Do not ship debug files in -devel subpackage (#194769)
7fe7659
272313d
* Wed Apr 12 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.19-5
3d4e6ae
- Add htmlview as help viewer.
3d4e6ae
272313d
* Thu Feb 16 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.19-4
9fdc504
- Remove stripping option from Makefiles to have meaningfull debuginfo packages.
9fdc504
- Thanks to Ville Skyttä for the fix. (bz#180106)
9fdc504
272313d
* Thu Feb 16 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.19-3
7f2355d
- Unify spec file starting from FC-4.
7f2355d
- Rebuild for FC-5.
7f2355d
272313d
* Wed Feb  1 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.19-2
a17bf4a
- Update BR from fftw to fftw2.
a17bf4a
- Remove references to previous profile scripts.
a17bf4a
272313d
* Fri Jan 13 2006 José Matos <jamatos[AT]fc.up.pt> - 5.1.19-1
42b5bdb
- new upstream version
42b5bdb
- remove name from Summary
42b5bdb
- disable setting environment variable GRACE_HOME
7f2355d
- replace x11-xorg-devel by libXpm-devel in BuildRequires for FC-5.
42b5bdb
272313d
* Mon Jan  9 2006 Patrice Dumas <dumas[AT]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
272313d
* Wed Sep 14 2005 José Matos <jamatos[AT]fc.up.pt> - 5.1.18-6
573225c
- Require nedit as an explicit Require.
573225c
272313d
* Tue Sep 13 2005 José Matos <jamatos[AT]fc.up.pt> - 5.1.18-5
573225c
- Normalize buildroot and change default editor to nedit.
573225c
272313d
* Fri Sep  9 2005 José Matos <jamatos[AT]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
272313d
* Sat Sep  3 2005 Patrice Dumas <dumas[AT]centre-cired.fr> - 5.1.18-3
573225c
- cleanup licences
9fdc504
- put examples/ and doc/ in %%doc
b7e59db
- remove duplicate manpages
573225c
- add patch to change fdf2fit path in graderc
573225c
272313d
* Sun Aug 21 2005 José Matos <jamatos[AT]fc.up.pt> - 5.1.18-2
573225c
- Add post and postun requires.
573225c
272313d
* Sat Aug 20 2005 José Matos <jamatos[AT]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