Name: wgrib
Version: 1.8.0.12o
Release: 2%{?dist}
Summary: Manipulate, inventory and decode GRIB files
Group: Applications/Engineering
License: Public Domain
URL: http://www.cpc.ncep.noaa.gov/products/wesley/wgrib.html
Source0: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/wgrib.c.v%{version}
Source1: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/Changes
Source2: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/NOTICE
Source3: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/double_prec.txt
Source4: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/formats.txt
Source5: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/formats_update.txt
Source6: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/grib2ieee.txt
Source7: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/misc.txt
Source8: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/porting.txt
Source9: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/usertables.txt
Source10: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/tricks.wgrib
Source11: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/land.grb
Source12: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/testbin.c
Source13: ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib/testbin.f
Source14: testbin.out
Patch1: testbin.c.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
WGRIB is a program to manipulate, inventory and decode GRIB files.
%prep
%setup -q -c -T
cp %SOURCE0 wgrib.c
cp %SOURCE1 .
cp %SOURCE2 .
cp %SOURCE3 .
cp %SOURCE4 .
cp %SOURCE5 .
cp %SOURCE6 .
cp %SOURCE7 .
cp %SOURCE8 .
cp %SOURCE9 .
cp %SOURCE10 .
cp %SOURCE11 .
cp %SOURCE12 .
cp %SOURCE13 .
%patch1 -p0
%build
gcc $RPM_OPT_FLAGS -o wgrib wgrib.c
%install
rm -rf $RPM_BUILD_ROOT
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
install -m 755 wgrib $RPM_BUILD_ROOT%{_bindir}/
%check
./wgrib land.grb -d 1
gcc $RPM_OPT_FLAGS -o testbin testbin.c -lm
./testbin > testbin.out && diff %SOURCE14 testbin.out
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc Changes *.txt tricks.wgrib testbin.[cf] land.grb
%{_bindir}/wgrib
%changelog
* Thu Aug 23 2007 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12o-2
- Rebuild for BuildID
* Wed Aug 8 2007 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12o-1
- Update to 1.8.0.12o
* Tue Dec 5 2006 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12g-2
- Compile testbin with -lm, needed on x86_64
* Fri Nov 17 2006 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12g-1
- Update to 1.8.0.12g
- Ship testbin.c, testbin.f, and lang.grb for local testing
* Thu Nov 16 2006 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12b-2
- Add check
* Wed Nov 15 2006 - Orion Poplawski <orion@cora.nwra.com> - 1.8.0.12b-1
- Initial version