File python-pygsl.spec of Package python-pygsl

#
# spec file for package python-pygsl
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#

%define modname pygsl
Name:           python-%{modname}
Version:        0.9.5
Release:        1
Summary:        A python binding to the GSL library
URL:            http://pygsl.sourceforge.net/
License:        GPL-2.0
Group:          Development/Libraries/Python
Source:         %{modname}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-buildroot
BuildRequires:  python-devel
BuildRequires:	gsl-devel
BuildRequires:  python-numpy-devel
Requires:       python-numpy
%if 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%else
%{py_requires}
%endif

%description
pygsl is a python binding to the GNU Scientific Library (GSL).

%package devel
Summary:        Development header files for pygsl 
Group:          Development/Libraries/Python
Requires:       %{name} = %{version}
Requires:       gsl-devel
Requires:       python-numpy-devel

%description devel
Development header files for pygsl, the python binding to the GNU
Scientific Library (GSL).

%prep
%setup -q -n %{modname}-%{version}
cp -r doc/html ./
 
%build
export CFLAGS="%{optflags}"
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
chmod +x %{buildroot}%{python_sitearch}/%{modname}/{qrng,_generic_solver,vector,spline,siman,gsl_function,multifit_nlin,block,fit,monte,multifit,multiroots,odeiv,integrate,roots,minimize,interpolation,multiminimize,chebyshev}.py
chmod +x %{buildroot}%{python_sitearch}/%{modname}/gsl_dist/swig_extension.py

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc COPYING CREDITS README TODO examples
%{python_sitearch}/%{modname}/
%{python_sitearch}/%{modname}-%{version}-py%{py_ver}.egg-info

%files devel
%defattr(-,root,root)
%{py_incdir}/%{modname}/

%changelog
openSUSE Build Service is sponsored by