Blob Blame Raw
%global srcname pycosat
%global sum Python bindings to picosat (a SAT solver)
%global pkgdesc \
PicoSAT is a popular SAT solver written by Armin Biere in pure C. This \
package provides efficient Python bindings to picosat on the C level, i.e. \
when importing pycosat, the picosat solver becomes part of the Python process \
itself.

Name:           python-%{srcname}
Version:        0.6.3
Release:        9%{?dist}
Summary:        %{sum}

License:        MIT
URL:            https://github.com/ContinuumIO/%{srcname}
Source0:        https://github.com/ContinuumIO/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  picosat-devel

%description
%{pkgdesc}

%if 0%{?fedora} < 30
%package -n python2-%{srcname}
Summary:        %{sum}
BuildRequires:  python2-devel
BuildRequires:  pytest
%{!?python_provide:Provides: python-%{srcname} = %{version}-%{release}}
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
%{pkgdesc}
%endif


%package -n python%{python3_pkgversion}-%{srcname}
Summary:        %{sum}
BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-pytest
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

%description -n python%{python3_pkgversion}-%{srcname}
%{pkgdesc}


%prep
%setup -q -n %{srcname}-%{version}
sed -i -e s/distutils.core/setuptools/ setup.py
rm picosat.*

# upstream only applies proper flags when build is invoked with --inplace
sed -i "s/if '--inplace' in sys.argv:/if True:/" setup.py

%build
%if 0%{?fedora} < 30
%py2_build
%endif
%py3_build

%install
%if 0%{?fedora} < 30
%py2_install
%endif
%py3_install

%check
%if 0%{?fedora} < 30
PYTHONPATH=%{buildroot}%{python2_sitearch} py.test-%{python2_version} -vv
%endif
PYTHONPATH=%{buildroot}%{python3_sitearch} py.test-%{python3_version} -vv

%if 0%{?fedora} < 30
%files -n python2-%{srcname}
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc CHANGELOG README.rst
%{python2_sitearch}/*
%endif

%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc CHANGELOG README.rst
%{python3_sitearch}/*

%changelog
* Thu Oct 03 2019 Miro Hron훾ok <mhroncok@redhat.com> - 0.6.3-9
- Rebuilt for Python 3.8.0rc1 (#1748018)

* Mon Aug 19 2019 Miro Hron훾ok <mhroncok@redhat.com> - 0.6.3-8
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sun Oct 7 2018 Orion Poplawski <orion@nwra.com> - 0.6.3-5
- Drop Python 2 package for Fedora 30+ (bugz #1634962)

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hron훾ok <mhroncok@redhat.com> - 0.6.3-3
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Feb 5 2018 Orion Poplawski <orion@cora.nwra.com> - 0.6.3-1
- Update to 0.6.3

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hron훾ok <mhroncok@redhat.com> - 0.6.1-9
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-8
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Tue Apr 19 2016 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-7
- Build python3 packages for EPEL7

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jan 13 2016 Jerry James <loganjerry@gmail.com> - 0.6.1-5
- Rebuild for picosat 965

* Sun Jan 3 2016 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-4
- Fix PYTHONPATH in %%check

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Tue Sep 22 2015 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-2
- Quiet setup

* Mon Sep 21 2015 Orion Poplawski <orion@cora.nwra.com> - 0.6.1-1
- Initial package