File GotoBLAS2.spec of Package gotoblas2

# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 
# Packaged by: <saigkill@opensuse.org>
# 
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# # norootforbuild

Name:           GotoBLAS2
Version:        1.13
Release:        0
Summary:        GotoBlas
Group:          Development/Libraries/Other
License:        BSD
Url:            http://math-atlas.sourceforge.net/
Source0:        %name-%{version}_bsd.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires:  gcc-fortran fdupes

%description
GotoBlas is a mathematical library providing optimised BLAS routines for several architectures.

%package prescott
Group:          Development/Libraries/Other
Summary:  GotoBlas for Prescott 

%description prescott
GotoBlas package optimised for Prescott processor.



%package core2
Group:          Development/Libraries/Other
Summary:  GotoBlas for Core2 

%description core2
GotoBlas package optimised for Core2 processor.

%package penryn
Group:          Development/Libraries/Other
Summary:  GotoBlas for Penryn 

%description penryn
GotoBlas package optimised for Penryn processor.

%package dunnington
Group:          Development/Libraries/Other
Summary:  GotoBlas for Dunnington 

%description dunnington
GotoBlas package optimised for Dunnington processor.

%package nehalem
Group:          Development/Libraries/Other
Summary:  GotoBlas for Nehalem 

%description nehalem
GotoBlas package optimised for Nehalem processor.

%package atom
Group:          Development/Libraries/Other
Summary:  GotoBlas for Atom 

%description atom
GotoBlas package optimised for Atom processor.


%package opteron
Group:          Development/Libraries/Other
Summary:  GotoBlas for Opteron 

%description opteron
GotoBlas package optimised for Opteron processor.

%package barcelona
Group:          Development/Libraries/Other
Summary:  GotoBlas for Barcelona 

%description barcelona
GotoBlas package optimised for Barcelona processor.


%define target "generic PRESCOTT CORE2 PENRYN DUNNINGTON NEHALEM ATOM OPTERON BARCELONA"
  

%prep
%setup -q -n %{name}
cd ..
mkdir target
for target in `echo %target`;do
  mkdir target/$target
  cp -r %{name}/* target/$target/
done

mv target %{name}
  

%build
pushd target
for target in `echo %target`;do
  pushd $target
  make TARGET=$target USE_THREAD=1
  popd
done

%install

mkdir -p %buildroot/%{_libdir}
mkdir -p %buildroot/%{_sysconfdir}/ld.conf.so.d/

pushd target
for target in `echo %target`;do
  mkdir -p %buildroot/%{_libdir}/gotoblas-$target
  pushd $target
  install -m 755 *.so %buildroot/%{_libdir}/gotoblas-$target
  echo '%{_libdir}/gotoblas-$target' >> %buildroot/%{_sysconfdir}/ld.conf.so.d/gotoblas-$target.conf
  popd
done

%fdupes -s  %buildroot

%clean
rm -rf %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%{_libdir}/gotoblas-generic
%dir %{_sysconfdir}/ld.conf.so.d/
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-generic.conf

%files prescott
%defattr(-,root,root,-)
%{_libdir}/gotoblas-PRESCOTT
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-PRESCOTT.conf


%files core2
%defattr(-,root,root,-)
%{_libdir}/gotoblas-CORE2
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-CORE2.conf

%files penryn
%defattr(-,root,root,-)
%{_libdir}/gotoblas-PENRYN
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-PENRYN.conf

%files dunnington
%defattr(-,root,root,-)
%{_libdir}/gotoblas-DUNNINGTON
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-DUNNINGTON.conf

%files nehalem
%defattr(-,root,root,-)
%{_libdir}/gotoblas-NEHALEM
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-NEHALEM.conf

%files atom
%defattr(-,root,root,-)
%{_libdir}/gotoblas-ATOM
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-ATOM.conf


%files opteron
%defattr(-,root,root,-)
%{_libdir}/gotoblas-OPTERON
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-OPTERON.conf

%files barcelona
%defattr(-,root,root,-)
%{_libdir}/gotoblas-BARCELONA
%config(noreplace) %{_sysconfdir}/ld.conf.so.d/gotoblas-BARCELONA.conf

openSUSE Build Service is sponsored by