14
0

Accepting request 298769 from Application:ERP:Tryton:3.6

OBS-URL: https://build.opensuse.org/request/show/298769
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-simpleeval?expand=0&rev=1
This commit is contained in:
Denisart Benjamin
2015-04-23 09:34:56 +00:00
committed by Git OBS Bridge
commit 851c699b0c
5 changed files with 96 additions and 0 deletions

60
python-simpleeval.spec Normal file
View File

@@ -0,0 +1,60 @@
#
# spec file for package python-simpleeval
#
# Copyright (c) 2015 Dr. Axel Braun
# Copyright (c) 2015 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 simpleeval
Name: python-%{modname}
Version: 0.8.2
Release: 0
Url: https://pypi.python.org/pypi/simpleeval
Summary: A simple, safe single expression evaluator library
License: MIT
Group: Development/Languages/Python
Source: https://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-setuptools
%if 0%{?suse_version} && 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
A quick single file library for easily adding evaluatable expressions into python projects. Say you want to allow a user to set an alarm volume, which could depend on the time of day, alarm level, how many previous alarms had gone off, and if there is music playing at the time.
Or if you want to allow simple formulae in a web application, but dont want to give full eval() access, or dont want to run in javascript on the client side.
%prep
%setup -q -n %{modname}-%{version}
rm -f %{modname}.egg-info/*.orig
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
rm -rf %{buildroot}%{python_sitelib}/%{mod2nam}/tests # Don't install tests
rm -rf %{buildroot}%{python_sitelib}/%{mod2nam}/*.exe # Remove unneeded files
%files
%defattr(-,root,root,-)
%{python_sitelib}/*
%changelog