File python-nibabel.spec of Package python-nibabel-snapshot

%define modname nibabel
Name:           python-%{modname}-snapshot
URL:            http://nipy.sf.net/nibabel
Summary:        Access a multitude of neuroimaging data formats
Version:        1.0.0.dev
Release:        1
License:        MIT License
Group:          Development/Libraries/Python
Conflicts:      python-nibabel
# should be here, but doesn't really work
#BuildArch:      noarch
Source:         %{modname}-snapshot-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-root
%if %{defined fedora_version} || %{defined rhel_version} || %{defined centos_version}
BuildRequires:  numpy
Requires:       numpy
%if %{defined fedora_version}
BuildRequires:  atlas lapack
%endif
%else  
# SUSE-related stuff
%{py_requires}
BuildRequires:  fdupes
BuildRequires:  python-numpy python-numpy-devel
Requires:       python-numpy
%endif  
BuildRequires:  python-devel python-nose

%description
ADD ME

%prep
%setup -q -n %{modname}-snapshot-%{version}

%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
python setup.py build
%if 0%{?centos_version} < 600 || 0%{?rhel_version} < 600
echo "Not running unittests: Python 2.4 cannot run them."
%else
PYTHONPATH=.:$(PYTHONPATH) nosetests nibabel
%endif

%install
python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%if %{defined suse_version}
# save some space
%fdupes $RPM_BUILD_ROOT%{py_sitedir}
%endif

%clean
rm -rf %{buildroot}

%files -f INSTALLED_FILES
%defattr(0644,root,root,0755)

%if 0%{?suse_version} >= 1100
%dir
%{py_sitedir}/nibabel
%{py_sitedir}/nibabel/*
%endif



%changelog
* Wed Feb 3 2010 - Michael Hanke <michael.hanke@gmail.com> - 1.0.0.dev
- Initial release