91577cb
%global srcname jep
91577cb
91577cb
%global desc \
91577cb
Java Embedded Python\
91577cb
JEP embeds CPython in Java through JNI and is safe to use in a\
91577cb
heavily threaded environment.\
91577cb
\
91577cb
Some benefits of embedding CPython in a JVM:\
91577cb
    Using the native Python interpreter may be much faster than\
91577cb
    alternatives.\
91577cb
    Python is mature, well supported, and well documented.\
91577cb
    Access to high quality Python modules, both native CPython\
91577cb
    extensions and Python-based.\
91577cb
    Compilers and assorted Python tools are as mature as the\
91577cb
    language.\
91577cb
    Python is an interpreted language, enabling scripting of\
91577cb
    established Java code without requiring recompilation.\
91577cb
    Both Java and Python are cross platform, enabling deployment\
91577cb
    to different operating system.
91577cb
91577cb
Name:           python-%{srcname}
fcaac14
Version:        3.9.1 
0929f8b
Release:        3%{?dist}
91577cb
Summary:        Embed Python in Java
91577cb
91577cb
License:        zlib
91577cb
URL:            https://github.com/ninia/%{srcname}
a9d8703
Source0:        %{url}/archive/v%{version}.tar.gz
91577cb
91577cb
BuildRequires:  python3-devel
c6ea627
BuildRequires:  python3-setuptools
91577cb
BuildRequires:  python3-numpy
91577cb
91577cb
BuildRequires:  java-devel
de0fd24
BuildRequires:  gcc
91577cb
91577cb
Requires:       java-headless
91577cb
91577cb
%description %desc
91577cb
91577cb
%package     -n python3-%{srcname}
91577cb
Summary:        Embed Python in Java
91577cb
%{?python_provide:%python_provide python3-%{srcname}}
91577cb
91577cb
%description -n python3-%{srcname} %desc
91577cb
91577cb
%package javadoc
91577cb
Summary:        Javadoc files for %{name}
91577cb
BuildArch:      noarch
91577cb
91577cb
%description javadoc
91577cb
%{summary}.
91577cb
91577cb
91577cb
%prep
7e31044
%autosetup -p1 -n%{srcname}-%{version}
91577cb
find . -name \*.jar -print -delete
91577cb
91577cb
91577cb
%build
91577cb
export JAVA_HOME=%{_prefix}/lib/jvm/java
91577cb
CFLAGS="$RPM_OPT_FLAGS" %py3_build
f2b316e
%{__python3} setup.py javadoc
91577cb
91577cb
91577cb
%install
91577cb
export JAVA_HOME=%{_prefix}/lib/jvm/java
91577cb
%py3_install
91577cb
91577cb
# install javadoc
91577cb
install -dm755 %{buildroot}%{_javadocdir}/%{name}
91577cb
cp -pr javadoc/* %{buildroot}%{_javadocdir}/%{name}
91577cb
91577cb
91577cb
%check
a2ba294
export JAVA_HOME=%{_prefix}/lib/jvm/java
f2b316e
# be more verbose about tests, FIXME ugly hack!
f2b316e
sed -i -r 's:TextTestRunner\(:\0verbosity=2:' src/test/python/runtests.py
7e31044
%{__python3} setup.py test || cat *.log
7e31044
# jdk may crash aka 'An error report file with more information is saved'
fcaac14
true --- maybe core dumps
7e31044
cat core* || :
91577cb
91577cb
91577cb
%files -n python3-%{srcname}
91577cb
%license LICENSE
f2b316e
%doc README.rst
91577cb
%doc AUTHORS release_notes/
b04f360
%{python3_sitearch}/%{srcname}/
b04f360
%{python3_sitearch}/%{srcname}-%{version}-py*.egg-info
91577cb
%{_bindir}/%{srcname}
91577cb
91577cb
%files javadoc
91577cb
%license LICENSE
91577cb
%{_javadocdir}/%{name}/
91577cb
91577cb
91577cb
%changelog
0929f8b
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.1-3
0929f8b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
0929f8b
f68b8f4
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 3.9.1-2
f68b8f4
- Rebuilt for Python 3.10
f68b8f4
fcaac14
* Mon Feb 01 2021 Raphael Groner <raphgro@fedoraproject.org> - 3.9.1-1
fcaac14
- bump to v3.9.1 to fix FTBFS and improve support for python 3.9+, rhbz#1792062 
fcaac14
- drop upstream patch
fcaac14
4054c8e
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-8
4054c8e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
4054c8e
7a86415
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-7
7a86415
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
7a86415
bae3ffb
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 3.9.0-6
bae3ffb
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
bae3ffb
7e31044
* Sat Jun 06 2020 Raphael Groner <raphgro@fedoraproject.org> - 3.9.0-5
7e31044
- add patch for python 3.9, avoid daemon thread, rhbz#1792062
7e31044
55233f1
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.9.0-4
55233f1
- Rebuilt for Python 3.9
55233f1
372801d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-3
372801d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
372801d
475a073
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0-2
475a073
- Rebuilt for Python 3.8.0rc1 (#1748018)
475a073
a2ba294
* Sat Aug 31 2019 Raphael Groner <projects.rg@smart.ms> - 3.9.0-1
a2ba294
- new version
a2ba294
5f4181a
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.2-5
5f4181a
- Rebuilt for Python 3.8
5f4181a
c86cd36
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.2-4
c86cd36
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
c86cd36
b04f360
* Fri May 10 2019 Raphael Groner <projects.rg@smart.ms> - 3.8.2-3
b04f360
- adjust execution of tests to fix for python 3.8, rhbz#1706238
b04f360
- fix path of module installation
b04f360
6e819dd
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.2-2
6e819dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
6e819dd
aa04ecf
* Mon Dec 17 2018 Raphael Groner <projects.rg@smart.ms> - 3.8.2-1
aa04ecf
- new version
aa04ecf
a9d8703
* Thu Jul 12 2018 Raphael Groner <projects.rg@smart.ms> - 3.8.0-1
a9d8703
- new version
a9d8703
f2b316e
* Sat Jul 07 2018 Raphael Groner <projects.rg@smart.ms> - 3.8-0.1.rc
f2b316e
- new version (RC) with support for Python 3.7
f2b316e
- generate javadoc because not provided in tarball any more
f2b316e
- drop optional python2
f2b316e
f3115f8
* Sat Jul 07 2018 Raphael Groner <projects.rg@smart.ms> - 3.7.1-1
f3115f8
- new version
f3115f8
c9e3754
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.7.0-4
c9e3754
- Rebuilt for Python 3.7
c9e3754
525de8b
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-3
525de8b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
525de8b
91577cb
* Sat Sep 02 2017 Raphael Groner <projects.rg@smart.ms> - 3.7.0-2
91577cb
- drop precompiled jar files
91577cb
- be more verbose about tests
91577cb
- add javadoc subpackage
91577cb
- move interpreter script into python3 subpackage
91577cb
- add release_notes folder to documentation
91577cb
- handle readme file properly
91577cb
91577cb
* Tue Aug 15 2017 Raphael Groner <projects.rg@smart.ms> - 3.7.0-1
91577cb
- initial