%define name aips
%define version 31DEC07
%define release 1
%define _use_internal_dependency_generator 0
%define __find_requires %{SOURCE900}

Summary: Aips
Name: %{name}
Version: %{version}
Release: %{release}
Source: ftp://ftp.aoc.nrao.edu/pub/software/aips/31DEC07/31DEC07.tar.gz
Source900: filter-requires
Source901: AIPS/install.pl
Source902: AIPS/.AIPSRC
Vendor: NRAO
URL: http://www.aips.nrao.edu
License: Unknown
Group: Applications/Engineering
Prefix: %{_prefix}
BuildRoot: /var/tmp/%{name}-%{version}-%{release}

%description
AIPS

%install
rm -rf $RPM_BUILD_ROOT ; mkdir -p $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/aips
sudo ln -sf $RPM_BUILD_ROOT/usr/local/aips /usr/local/aips
cp %{_topdir}/SOURCES/AIPS/%{version}.tar.gz $RPM_BUILD_ROOT/usr/local/aips
cp %{_topdir}/SOURCES/AIPS/.AIPSRC ~/
tar -xzvf $RPM_BUILD_ROOT/usr/local/aips/%{version}.tar.gz -C $RPM_BUILD_ROOT/usr/local/aips/
/usr/local/bin/perl %{_topdir}/SOURCES/AIPS/install.pl -n
rm -f $RPM_BUILD_ROOT/usr/local/aips/aips 
ln -sf /usr/local/aips $RPM_BUILD_ROOT/usr/local/aips/aips 
mv ~/do_daily.localhost $RPM_BUILD_ROOT/usr/local/aips/
mkdir -p $RPM_BUILD_ROOT/etc/profile.d/
cp /usr/local/aips/LOGIN.SH $RPM_BUILD_ROOT/etc/profile.d/aips.sh
cp /usr/local/aips/LOGIN.CSH $RPM_BUILD_ROOT/etc/profile.d/aips.csh
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
mkdir -p $RPM_BUILD_ROOT/usr/bin
ln -sf /bin/echo $RPM_BUILD_ROOT/usr/bin
ln -sf /usr/local/bin/perl $RPM_BUILD_ROOT/usr/local/bin/perl5
sudo rm -f /usr/local/aips

%files
%defattr(-,root,-)
/usr/local/aips
/etc/profile.d/aips.sh
/etc/profile.d/aips.csh
/usr/local/bin/perl5
/usr/bin/echo

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Fri May 27 2008 Joel Eidsath <thras@nmt.edu>
- First draft of the spec file

