%global modname jnius %global srcname py%{modname} %global sum Dynamic access to Java classes from Python %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif Name: python-%{modname} Version: 1.1.1 Release: 2%{?dist} Summary: %{sum} License: MIT URL: https://github.com/kivy/%{srcname} Source0: %{url}/archive/%{version}.tar.gz#/%{srcname}-%{version}.tar.gz BuildRequires: python2-devel BuildRequires: python2-Cython BuildRequires: python2-nose %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-Cython BuildRequires: python3-nose %endif # with python3 BuildRequires: ant BuildRequires: java-devel BuildRequires: %{_bindir}/sphinx-build # FIXME odd bug with wrong default architecture (i386) # https://github.com/kivy/pyjnius/issues/307 # https://github.com/kivy/pyjnius/issues/306 ExcludeArch: i686 ppc64 ppc64le s390x armv7hl aarch64 %description %{summary}. %package -n python2-%{srcname} Summary: %{sum} Requires: java-headless %{?python_provide:%python_provide python2-%{srcname}} Provides: python2-%{modname} %description -n python2-%{srcname} %{summary}. %if %{with python3} %package -n python3-%{srcname} Summary: %{sum} Requires: java-headless %{?python_provide:%python_provide python3-%{srcname}} Provides: python3-%{modname} %description -n python3-%{srcname} %{summary}. %endif # with python3 %package doc Summary: Documentation files for %{srcname} BuildArch: noarch %description doc %{summary}. %prep %autosetup -c mv %{srcname}-%{version} python2 pushd python2 # don't confuse rpmbuild mv -t.. LICENSE *.md docs # use Fedora policy find -name Makefile |xargs \ sed -i -r -e 's:\$(MAKE):\0 %{_smp_mflags}:g' -e /NOSETESTS=/d popd %if %{with python3} cp -a python2 python3 %endif # with python3 %build pushd python2 CFLAGS="$RPM_OPT_FLAGS" %py2_build make popd %if %{with python3} pushd python3 export PYTHON3=1 CFLAGS="$RPM_OPT_FLAGS" %py3_build make popd %endif # with python3 make -C docs html %install %if %{with python3} pushd python3 %py3_install popd %endif # with python3 pushd python2 %py2_install popd %check export MAKE='make %{_smp_mflags}' export JAVA_HOME=%{_prefix}/lib/jvm/java pushd python2 NOSETESTS=nosetests make tests popd %if %{with python3} pushd python3 export PYTHON3=1 # FIXME some tests fail with python3: # https://github.com/kivy/pyjnius/issues/305 # test_multiple_methods # test_create_bytearray # test_stack NOSETESTS=nosetests-3 make tests ||: popd %endif %files -n python2-%{srcname} %license LICENSE %doc *.md %{python2_sitearch}/%{modname}/ %{python2_sitearch}/%{modname}_config.py* %{python2_sitearch}/%{srcname}-%{version}-py*.egg-info/ %if %{with python3} %files -n python3-%{srcname} %license LICENSE %doc *.md %{python3_sitearch}/%{modname}/ %{python3_sitearch}/%{modname}_config.py* %{python3_sitearch}/%{srcname}-%{version}-py*.egg-info/ %{python3_sitearch}/__pycache__/%{modname}_config.cpython-*.pyc %exclude %{python3_sitearch}/__pycache__ %endif # with python3 %files doc %license LICENSE %doc docs/build/html/ %changelog * Tue Oct 24 2017 Raphael Groner - 1.1.1-2 - be more precisely about owned files * Sun Oct 22 2017 Raphael Groner - 1.1.1-1 - initial