File python-scalar.spec of Package python-scalar

#
# spec file for package python-scalar
#
# 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 scalar
Name:           python-%{modname}
Version:        2.2
Release:        1
Summary:        A python module for manipulating scalar with physical units
URL:            http://russp.us/scalar.htm
License:        BSD-3-Clause
Group:          Development/Libraries/Python
Source:         %{modname}-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-buildroot
BuildRequires:  python-devel
%if 0%{?suse_version} <= 1110
%{!?python_sitelib:  %global python_sitelib  %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%else
BuildArch:      noarch
%{py_requires}
%endif

%description
Scalar is designed to represent physical scalars and to eliminate errors
involving implicit physical units (e.g., confusing angular degrees and
radians). The standard arithmetic operators are overloaded to provide
syntax identical to that for built-in numeric types. The scalar class
does not define any units itself but is part of a package that includes
a complete implementation of the standard metric system of units and many
standard non-metric units. It also allows the user to define a specialized
or reduced set of appropriate physical units for any particular application
or domain. Once an application has been developed and tested, the scalar
class can easily be switched off, if desired, to achieve the execution
efficiency of operations on built-in numeric types, which can be nearly
two orders of magnitude faster. The scalar class can also be used for
discrete units to enforce type checking of integer counts, thereby enhancing
the built-in dynamic type checking of Python.

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

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

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
chmod +x %{buildroot}%{python_sitelib}/%{modname}/{mathx,units,ATMunits,vector,scalar}.py

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc license
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}-py%{py_ver}.egg-info

%changelog
openSUSE Build Service is sponsored by