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