%global commit 72771d9f693928f4b58394441aa4e927be8e833c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global checkout git%{shortcommit}
%global srcname pyswip
Name: python-%{srcname}
Version: 0.2.3
Release: 2.%{checkout}%{?dist}
Summary: Python-SWI-Prolog bridge
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}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
%files -n python3-%{srcname}
%license COPYING
%doc README.md CHANGELOG
%{python3_sitelib}/%{srcname}
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
%changelog
* Mon Mar 13 2017 Till Hofmann <till.hofmann@posteo.de> - 0.2.3-2.git72771d9
- Don't glob %{python_sitelib}/* but add files separately instead
* Sun Jan 15 2017 Till Hofmann <till.hofmann@posteo.de> - 0.2.3-1.git72771d9
- Initial package