Blob Blame History Raw
%global srcver  6.0-1

Name:           ast
Version:        %(echo %srcver | sed s/-/./)
Release:        1%{?dist}
Summary:        A Library for Handling World Coordinate Systems in Astronomy

Group:          System Environment/Libraries
# proj.c proj.h wcsmath.h wcstrig.c wcstrig.h are LGPLv2+
License:        GPLv2+ and LGPLv2+
URL:            http://starlink.jach.hawaii.edu/starlink/AST
#http://starlink.jach.hawaii.edu/starlink/AST?action=AttachFile&do=view&target=ast-%{srcver}.tar.gz
Source0:        ast-%{srcver}.tar.gz
# Fix up library linkages
Patch0:         ast-libs.patch

BuildRequires:  gcc-gfortran

%description
The AST library provides a comprehensive range of facilities for attaching
world coordinate systems to astronomical data, for retrieving and interpreting
that information and for generating graphical output based on it. It's main
selling points are:

* Ease of use.
* Facilities for generating plots of generalized non-linear, potentially
  discontinuous 2-D or 3-D coordinate systems, with detailed control of the
  appearance of the plot.
* Facilities for converting transparently between different coordinate
  systems, including a wide range of celestial, spectral and time coordinate
  systems.
* Facilities for searching a general collection of connected coordinate
  systems for a coordinate system with any given set of characteristics.
* Allows code for handling WCS information to be written in a general way
  without regard to the specific nature of the coordinate systems being
  handled (i.e. whether they represent sky positions, spectral positions,
  focal plane positions, pixel positions, etc).
* Flexible system for saving and retrieving WCS information, including (but
  not limited to) a range of different popular FITS descriptions.
* Written in C but has interfaces for C, Fortran, Java (via JNI), Perl, and
  UNIX shell.
* Extensive documentation. 


%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

Applications should make use of the ast_link command for setting the
libraries to link to, e.g.:

  cc prog.c `ast_link` -o prog


%package        doc
Summary:        Documentation for %{name}
Group:          Documentation

%description    doc
C and Fortran programming documentation for %{name}.


%prep
%setup -q -n %{name}-%{srcver}
%patch0 -p1 -b .libs
sed -i -e '1i#!/bin/bash' ast_link*
# Fix FSF address
sed -i -e 's/59 Temple Place, Suite 330, Boston, MA *02111-1307/51 Franklin Street, Fifth Floor, Boston, MA  02110-1301/' LICENCE pal.*
sed -i -e 's/675 Mass Ave, Cambridge, MA 02139/51 Franklin Street, Fifth Floor, Boston, MA  02110-1301/' COPYING.LIB loader.h proj.* wcstrig.*


%build
%configure --disable-static
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# Docs are installed to the wrong location, don't need source
rm -r $RPM_BUILD_ROOT%{_prefix}/docs
rm -r $RPM_BUILD_ROOT%{_datadir}/ast
rm -r $RPM_BUILD_ROOT%{_prefix}/{help,manifests,news}
# This references an uninstalled library
rm $RPM_BUILD_ROOT%{_bindir}/ast_link_adam
# These reference other libraries
rm $RPM_BUILD_ROOT%{_libdir}/libast_{drama,ems,pgplot{,3d}}.so*


%check
make check


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%doc COPYING.LIB LICENCE
%{_libdir}/*.so.*

%files devel
%{_bindir}/ast_link
%{_includedir}/*
%{_libdir}/*.so

%files doc
%doc sun210.ps sun211.ps


%changelog
* Mon Nov 28 2011 Orion Poplawski <orion@cora.nwra.com> 6.0.1-1
- Update to 6.0-1
- Fixup some lib linkages
- Fix license tag
- Fix FSF license
- Fixup doc install
- Drop BuildRoot, clean, defattr

* Fri Oct 14 2011 Orion Poplawski <orion@cora.nwra.com> 5.7.2-1
- Update to 5.7-2
- Truncate description
- Move documentation to subpackage

* Wed Apr 27 2011 Orion Poplawski <orion@cora.nwra.com> 5.6-1
- Initial package