File python-python-spidermonkey.spec of Package python-python-spidermonkey
#
# spec file for package python-python-spidermonkey
#
# Copyright (c) 2013 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-python-spidermonkey
Version: 0.0.10
Release: 0
Summary: JavaScript / Python bridge
License: MIT and (GPL-2.0+ or LGPL-2.1+ or MPL-1.1)
Group: Development/Languages/Python
Url: http://github.com/davisp/python-spidermonkey
Source: http://pypi.python.org/packages/source/p/python-spidermonkey/python-spidermonkey-%{version}.tar.gz
# PATCH-FIX-OPENSUSE: saschpe@suse.de -- js is threadsafe and has a different name
Patch0: python-spidermonkey-opensuse-js.patch
# PATCH-FIX-OPENSUSE: dvaleev@suse.com -- add missing powerpc headers
Patch1: python-spidermonkey-powerpc.patch
BuildRequires: js-devel
BuildRequires: mozilla-nspr-devel
BuildRequires: python-devel
BuildRequires: python-distribute
BuildRequires: python-nose
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
Python/JavaScript bridge module, making use of Mozilla's spidermonkey
JavaScript implementation. Allows implementation of JavaScript classes,
objects and functions in Python, and evaluation and calling of JavaScript
scripts and functions respectively. Borrows heavily from Claes Jacobssen's
Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.
%prep
%setup -q -n python-spidermonkey-%{version}
%if 0%{?suse_version}
# Mozilla's 'js' library is called differently on openSUSE. pkg-config doesn't
# contain "-DJS_THREADSAFE", but openSUSE's js was built this way:
%patch0 -p1
# Drop currently failing test:
rm tests/test-syntax-error.py
%endif
%patch1 -p1
%build
CFLAGS="%{optflags}" python setup.py build
#TODO/FIXME: Use system js:
#CFLAGS="%{optflags}" python setup.py --system-library build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%check
python setup.py test
%files
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitearch}/*
%changelog