File python-railgun.spec of Package python-railgun

#
# spec file for package python-railgun
#
# Copyright (c) 2014 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/
#


Name:           python-railgun
Version:        0.1.8
Release:        0
Summary:        Ctypes utilities for faster and easier simulation programming
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/tkf/railgun
Source:         https://pypi.python.org/packages/source/r/railgun/railgun-%{version}.tar.gz
BuildRequires:  python-devel
BuildRequires:  python-numpy-devel
BuildRequires:  python-setuptools
Requires:       python-numpy
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif

%description
RailGun is a ctypes utilities for faster and easier simulation
programming in C and Python.  It automatically creates Python
class to call C functions easily and safely.  All you need is
a few constraints in C code.

RailGun does more than just exporting C functions to Python world [#]_.
For example, when you write simulation code, you may face situation
like this many times:

    I am accessing array like ``x[i][j]`` and ``y[j][k]``, so I want
    the second axis of the array ``x`` and the first axis of the array
    ``y`` to be of the same length.

RailGun solves this problem by keeping shape of all arrays to be
consistent.  Memory allocation for these arrays is done automatically.

RailGun also provides some value check before passing it to C function.
For example, you may want to pass an index of some array to C function.
When you do that, you need to check if the index is in a certain range,
to avoid segmentation fault.  RailGun provides a short hand notation
to check that automatically.  Also, you can wrap C function to put any
kind of complex value check and pre/post-processing.

With these features and other useful utilities provided by RailGun,
you can really focus on guts of computation in C code.

.. [#] Well, that's what ctypes does.


%prep
%setup -q -n railgun-%{version}

%build
CFLAGS="%{optflags}" python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%files
%defattr(-,root,root,-)
%{python_sitearch}/railgun/
%{python_sitearch}/railgun-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by