summaryrefslogtreecommitdiffstats
path: root/komikku/python-Js2Py.spec
blob: 2a72560764b4c17d094296a59e819177da9892fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%global shortname Js2Py

%global commit 04241ba58f850cf586c55c25ac033561b9bb82cb
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:           python-%{shortname}
Version:        0.67
Release:        1%{?dist}
Summary:        JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python

License:        MIT
URL:            https://github.com/PiotrDabkowski/%{shortname}
Source0:        %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz

BuildArch:      noarch

%global _description %{expand:
Pure Python JavaScript Translator/Interpreter:

Everything is done in 100% pure Python so it's extremely easy to install and
use. Supports Python 2 & 3. Full support for ECMAScript 5.1, ECMA 6 support is
still experimental.

JavaScript 'VirtualMachine' in Python:

A VM-based JavaScript is also implemented. It is feature complete and faster
than the translation based version.}

%description    %{_description}

%package        -n python3-%{shortname}
Summary:        %{Summary}
BuildRequires:  python3-devel
BuildRequires:  python3-pyjsparser
BuildRequires:  python3-six
BuildRequires:  python3-tzlocal
Requires:       python3-pyjsparser
Requires:       python3-six
Requires:       python3-tzlocal
%{?python_provide:%python_provide python3-%{shortname}}

%description    -n python3-%{shortname} %{_description}

%prep
%autosetup      -n %{shortname}-%{commit}

%build
%py3_build

%install
%py3_install

%check
python3 simple_test.py

# These fail...

#PYTHONPATH=`pwd`; export PYTHONPATH;
#cd tests
#python3 run.py
# Changes the test runtime target
#sed -i "18s/RUNTIME_TO_TEST = 'vm'/RUNTIME_TO_TEST = 'translator'/" run.py
#python3 run.py

%files          -n python3-%{shortname}
%license LICENSE.md
%doc README.md examples
%{python3_sitelib}/js2py
%{python3_sitelib}/%{shortname}-%{version}-py*.egg-info

%changelog
* Tue Mar 31 2020 Lyes Saadi <fedora@lyes.eu> - 0.67-1
- Initial package.