1Name:		dataplot
2Version:	20200619
3Release:	1%{?dist}
4Summary:	Scientific visualization, statistical analysis, and non-linear modeling
5Group:		Applications/Engineering
6License:	Public Domain
7URL:		http://www.itl.nist.gov/div898/software/dataplot/
8#Source:		ftp://ftp.nist.gov/pub/dataplot/unix/dataplot-%{version}.tar.gz
9#Source:		dataplot-%{version}.tar.gz
10Source:		https://www.itl.nist.gov/div898/software/dataplot/ftp/unix/dataplot-%{version}.tar.gz
11BuildRequires:	gcc-gfortran
12BuildRequires:	gd-devel, libpng, libjpeg, zlib, freetype, readline-devel, cairo-devel
13
14
15
16%define dplibdir %{_libdir}/dataplot
17
18%description
19Dataplot is a tool for scientific visualization, statistical analysis,
20and non-linear modeling.  This build uses IBIT=64 and IPREC=64-64 defaults,
21leading to compiler flags: -fdefault-real-8 -fdefault-double-8.
22
23
24%prep
25#%setup -q -c -a 1 -a 2
26# tarball unpacks into unversioned "dataplot", so use -n
27%setup -q -n dataplot
28
29
30%build
31# source will emit lots of warnings when -Wall is used, so brute-force remove it, but leave the rest.
32# 2020/05/21: Dataplot source has been upgraded so that -Wall will not emit a lot of warnings
33export FFLAGS=$(sed 's/\s-Werror=format-security\s/ /g' <<<" %{optflags} ")
34#export FFLAGS=$(sed 's/\s-Wall\s/ /g' <<<" %{optflags} ")
35# below leaves all in but excludes some of the less serious warnings
36#export FFLAGS=" %{optflags} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-unused-dummy-argument -Wno-unused-label"
37
38# Fedora 29 compiles with -Werror=format-security which is an error without -Wformat (i.e., without -Wall).
39#export CFLAGS=$(sed 's/\s-Wall\s/ -Wformat /g' <<< "%{optflags} ")
40export CFLAGS="%{optflags} -Wno-unused-variable -Wno-unused-but-set-variable "
41
42make -C src DPLIBDIR=%{dplibdir}   %{?_smp_mflags}
43
44
45%install
46rm -rf $RPM_BUILD_ROOT
47make -C src install  DPLIBDIR=$RPM_BUILD_ROOT%{dplibdir}  DESTDIR=$RPM_BUILD_ROOT BINDIR=$RPM_BUILD_ROOT%{_bindir}
48
49echo removing zero-length files:
50find $RPM_BUILD_ROOT%{dplibdir} -empty -exec rm -v {} +
51echo
52
53
54echo removing hidden files:
55find $RPM_BUILD_ROOT%{dplibdir} -name '.??*' -exec rm -v {} +
56echo
57
58
59%clean
60rm -rf $RPM_BUILD_ROOT
61
62
63%files
64%defattr(-,root,root,-)
65#%doc %{dplibdir}/frmenus/interp/README.DOC
66%doc README INSTALL
67/usr/bin/*
68%{dplibdir}/*
69
70
71%changelog
72* Fri Apr  5 2019 Chris Schanzle <schanzle@nist.gov> - 20190409-1
73- massive overhaul / reorg, hopefully for the better.
74
75* Sun Oct 30 2011 Chris Schanzle <schanzle@nist.gov> - 20090821-1
76- cleanup, and makefile mods for new files
77- can run upstream build script if necessary to provide sample build
78
79* Tue Feb 26 2008 Chris Schanzle <schanzle@nist.gov> - 2006.12-3
80- rpmlint clean, basic checks OK.
81
82* Tue Feb 26 2008 Chris Schanzle <schanzle@nist.gov> - 2006.12-2
83- rpmlint still reports many zero-length files, hidden files/dirs, non-executable scripts
84
85* Mon Feb 25 2008 Chris Schanzle <schanzle@nist.gov> - 2006.12-2
86- cleanups, buildrequires to build under mock, permissions.
87
88* Wed Feb 21 2007 Chris Schanzle <schanzle@nist.gov> - 2006.12-1
89- Initial package
90