Blob Blame History Raw
%global with_python3 1

%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:			pyke
Summary:		Knowledge-based inference engine
Version:		1.1.1
Release:		24%{?dist}
License:		MIT
Group:			System Environment/Libraries
URL:			http://pyke.sourceforge.net/
Source0:		http://download.sourceforge.net/%{name}/%{name}-%{version}.zip
%if 0%{?with_python3}
Source1:		http://download.sourceforge.net/%{name}/%{name}3-%{version}.zip
%endif # if with_python3
BuildArch:		noarch
BuildRequires:		python2-devel, python2-setuptools

%if 0%{?with_python3}
BuildRequires:          python3-devel
%endif # if with_python3

%global _description\
Pyke is a knowledge-based inference engine (expert system) written in 100%\
python that can:\
* Do both forward-chaining (data driven) and backward-chaining (goal\
  directed) inferencing.\
* Automatically generate python programs by assembling individual python\
  functions into complete call graphs.

%description %_description

%package -n python2-pyke
Summary: %summary
Requires:		python2-ply
%{?python_provide:%python_provide python2-pyke}
# Remove before F30
Provides: pyke%{?_isa} = %{version}-%{release}
Obsoletes: pyke < %{version}-%{release}

%description -n python2-pyke %_description

%if 0%{?with_python3}
%package -n python3-pyke
Summary:		Knowledge-based inference engine
Group:			System Environment/Libraries
Requires:		python3-ply

%description -n python3-pyke
Pyke is a knowledge-based inference engine (expert system) written in 100%
python that can:
* Do both forward-chaining (data driven) and backward-chaining (goal
  directed) inferencing.
* Automatically generate python programs by assembling individual python
  functions into complete call graphs.
%endif # with_python3

%package examples
Summary:		Examples from pyke source code
Group:			Documentation
# Overkill, but it is hypothetically possible that the main package could go arch-specific.
BuildArch:		noarch

%description examples
Pyke example code files from the upstream source.

%prep
%if 0%{?with_python3}
%setup -q -a 1
mv %{name}-%{version} %{name}3-%{version}
%else
%setup -q
%endif # with_python3


%build
%{__python} setup.py build

%if 0%{?with_python3}
pushd %{name}3-%{version}
%{__python3} setup.py build
popd
%endif # with_python3

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT

%if 0%{?with_python3}
pushd %{name}3-%{version}
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
popd
%endif # with_python3

rm -rf doc/testdocs*
# This is stupid. Delete this.
rm -rf $RPM_BUILD_ROOT/usr/pyke
rm -rf doc/source/

%files -n python2-pyke
%license LICENSE
%doc README.txt RELEASE_NOTES-* doc/html/
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}-%{version}*.egg-info

%if 0%{?with_python3}
%files -n python3-pyke
%license LICENSE
%doc README.txt RELEASE_NOTES-* doc/html/
%{python3_sitelib}/%{name}/
%{python3_sitelib}/%{name}-%{version}*.egg-info
%endif # with_python3

%files examples
%doc examples/

%changelog
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.1.1-24
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

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

* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.1-22
- Python 2 binary package renamed to python2-pyke
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

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

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

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

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

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

* Tue Jan 19 2016 Tom Callaway <spot@fedoraproject.org> - 1.1.1-16
- spec file cleanups

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

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue May 27 2014 Kalev Lember <kalevlember@gmail.com> - 1.1.1-12
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Fri Aug 03 2012 David Malcolm <dmalcolm@redhat.com> - 1.1.1-9
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jan 23 2012 Tom Callaway <spot@fedoraproject.org> - 1.1.1-7
- rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Jul 18 2011 Tom Callaway <spot@fedoraproject.org> - 1.1.1-5
- add examples subpackage

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.1.1-3
- rebuild with python3.2
  http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html

* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 1.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Tue Apr 27 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 1.1.1-1
- update to 1.1.1
- enable python3 support

* Mon Mar 15 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 1.1-1
- update to 1.1

* Thu Nov  5 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0.4-1
- update to 1.0.4

* Mon Oct 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0.3-1
- update to 1.0.3

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Apr 22 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.0.2-1
- update to 1.0.2

* Mon Apr  6 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.0.1-1
- update to 1.0.1

* Thu Mar 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> 1.0-1
- update to 1.0

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Mon Jan 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> 0.7-1
- update to 0.7

* Tue Jan  6 2009 Tom "spot" Callaway <tcallawa@redhat.com> 0.6-1
- update to 0.6

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
- Rebuild for Python 2.6

* Tue Nov 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.5-1
- update to 0.5

* Fri Sep 12 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.4-1
- update to 0.4

* Wed Apr 23 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2-2
- add BR: python-setuptools

* Sat Mar 15 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2-1
- Initial package for Fedora