summaryrefslogtreecommitdiff
path: root/python-js2py.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-10 15:39:40 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-10 15:39:40 +0000
commit39d51583bd3cc2196f497745cc816626bc7a08ae (patch)
treeab227bee7caadc791ac4134ba4c16e0110c73c37 /python-js2py.spec
parent6e0146835aff4d1cdb11bd4fa1f7871dfda5e686 (diff)
automatic import of python-js2py
Diffstat (limited to 'python-js2py.spec')
-rw-r--r--python-js2py.spec123
1 files changed, 123 insertions, 0 deletions
diff --git a/python-js2py.spec b/python-js2py.spec
new file mode 100644
index 0000000..eb9f4b7
--- /dev/null
+++ b/python-js2py.spec
@@ -0,0 +1,123 @@
+%global _empty_manifest_terminate_build 0
+Name: python-Js2Py
+Version: 0.74
+Release: 1
+Summary: JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python.
+License: MIT
+URL: https://github.com/PiotrDabkowski/Js2Py
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/cb/a5/3d8b3e4511cc21479f78f359b1b21f1fb7c640988765ffd09e55c6605e3b/Js2Py-0.74.tar.gz
+BuildArch: noarch
+
+Requires: python3-tzlocal
+Requires: python3-six
+Requires: python3-pyjsparser
+
+%description
+Translates JavaScript to Python code. Js2Py is able to translate and execute virtually any JavaScript code.
+
+Js2Py is written in pure python and does not have any dependencies. Basically an implementation of JavaScript core in pure python.
+
+
+ import js2py
+
+ f = js2py.eval_js( "function $(name) {return name.length}" )
+
+ f("Hello world")
+
+ # returns 11
+
+Now also supports ECMA 6 through js2py.eval_js6(js6_code)!
+
+More examples at: https://github.com/PiotrDabkowski/Js2Py
+
+
+%package -n python3-Js2Py
+Summary: JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python.
+Provides: python-Js2Py
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-Js2Py
+Translates JavaScript to Python code. Js2Py is able to translate and execute virtually any JavaScript code.
+
+Js2Py is written in pure python and does not have any dependencies. Basically an implementation of JavaScript core in pure python.
+
+
+ import js2py
+
+ f = js2py.eval_js( "function $(name) {return name.length}" )
+
+ f("Hello world")
+
+ # returns 11
+
+Now also supports ECMA 6 through js2py.eval_js6(js6_code)!
+
+More examples at: https://github.com/PiotrDabkowski/Js2Py
+
+
+%package help
+Summary: Development documents and examples for Js2Py
+Provides: python3-Js2Py-doc
+%description help
+Translates JavaScript to Python code. Js2Py is able to translate and execute virtually any JavaScript code.
+
+Js2Py is written in pure python and does not have any dependencies. Basically an implementation of JavaScript core in pure python.
+
+
+ import js2py
+
+ f = js2py.eval_js( "function $(name) {return name.length}" )
+
+ f("Hello world")
+
+ # returns 11
+
+Now also supports ECMA 6 through js2py.eval_js6(js6_code)!
+
+More examples at: https://github.com/PiotrDabkowski/Js2Py
+
+
+%prep
+%autosetup -n Js2Py-0.74
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-Js2Py -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.74-1
+- Package Spec generated