%global commit 72771d9f693928f4b58394441aa4e927be8e833c %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global checkout git%{shortcommit} %global srcname pyswip %global summary Python-SWI-Prolog bridge Name: python-%{srcname} Version: 0.2.3 Release: 1.%{checkout}%{?dist} Summary: %summary License: MIT URL: https://github.com/yuce/pyswip Source0: https://github.com/yuce/pyswip/archive/%{commit}/%{srcname}-%{commit}.tar.gz BuildArch: noarch BuildRequires: pl-devel BuildRequires: python2-devel BuildRequires: python3-devel %description PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface. %package -n python2-%{srcname} Summary: %summary # we need to require pl-devel because pyswip uses the unversioned libswipl.so Requires: pl-devel %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface. %package -n python3-%{srcname} Summary: %summary # we need to require pl-devel because pyswip uses the unversioned libswipl.so Requires: pl-devel %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} PySWIP is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface. %prep %autosetup -n %{srcname}-%{commit} %build %py2_build %py3_build %install %py2_install %py3_install %check pushd test # Python2 tests fail, see https://github.com/yuce/pyswip/issues/7 #./runtests ./runtests3 %files -n python2-%{srcname} %license COPYING %doc README.md CHANGELOG %{python2_sitelib}/* %files -n python3-%{srcname} %license COPYING %doc README.md CHANGELOG %{python3_sitelib}/* %changelog * Sun Jan 15 2017 Till Hofmann - 0.2.3-1.git72771d9 - Initial package