File hsl.spec of Package hsl

Name:		hsl
Summary:	Large-scale scientific computation library
Version:	1.0
Release:	0%{?dist}

BuildRequires: scons

%if %{defined fedora_version}
BuildRequires: gcc-gfortran
%else
%if %{defined suse_version}
BuildRequires: gcc-fortran
%else
%if %{defined mandriva_version}
BuildRequires: gcc-gfortran
%else
BuildRequires: gfortran
%endif
%endif
%endif

Source:		%{name}-%{version}.tar.bz2

URL:		http://hsl.rl.ac.uk/
License:	Ambiguous
Group:		Development/Libraries
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
HSL is set of routine for large-scale scientific computation including
a number of well-known and highly-regarded matrix and linear algebra 
routines.

The HSL codes are free for personal use, but they can not be distributed.
With the emergence of a number of leading open source numerical packages
dependending on HSL, it is necessary to provide a way that HSL can be made
available to end-users at minimum fuss and bother.

This package will act as a 'dummy' package, building a bogus
shared library that will cause an error message to be output.

If you want to make it work correctly, just download the source RPM, and add
the line 'define have_hsl' to your .rpmmacros, and make sure you've
downloaded a copy of ma27ad.f into your SOURCES folder. When you do that,
'rpmbuild' will then build you a *proper* MA27 package.

Requires: hsl-libs || hsl-dummy

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

%description devel
This package contains the header files, static libraries and development
documentation for %{name}. If you like to develop programs that make
use of %{name}, you will need to install %{name}-devel.

%if %{defined have_hsl}
#=====================================
%package libs
Summary: Library files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description libs
This package contains the HSL routines compiled as shared libraries.
It is not freely distributable so if you have this package on your machine, 
it should be considered to be for personal use only.
#=====================================
%else
#=====================================
%package dummy
Summary: Dummy library files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description dummy
This package contains dummy HSL libraries that will output errs messages
if you use them. It is provided so that free software that depends on
HSL can be built on open servers. If you really want to use HSL, install 
the package %{name}-libs.
#=====================================
%endif

%prep
%setup -q

%build
scons
										
%install
rm -rf $RPM_BUILD_ROOT
scons \
    INSTALL_ROOT=$RPM_BUILD_ROOT \
    INSTALL_PREFIX=%_prefix \
    INSTALL_LIBS=%_libdir \
    INSTALL_INCLUDES=%_includedir \
  install

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig 2>/dev/null

%postun
/sbin/ldconfig 2>/dev/null

%files
%defattr(-,root,root)
%doc README.txt

%files devel
%defattr(-,root,root)
%{_includedir}/*

%if %{defined have_hsl}
%files lib
%{_libdir}/*.so

%else
%files dummy
%{_libdir}/*.so
%endif

%changelog
* Mon Jun 25 2007 John Pye <john@curioussymbols.com> 1.0
- first attempt at RPM packaging

# -*- coding: UTF-8 -*-
openSUSE Build Service is sponsored by