Blob Blame History Raw
%global github_name warlock
%global commit 460080eb27fd8598c6b00f0df70e597058152323
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:           python-warlock
Version:        1.3.0
Release:        4%{?dist}
Summary:        Python object model built on top of JSON schema

License:        ASL 2.0
URL:            http://pypi.python.org/pypi/warlock
# pypi tarball does not contain LICENSE.txt
# TODO return pypi tarball when github.com/bcwaldon/warlock/pull/12 is done
#Source0:        https://github.com/bcwaldon/%{github_name}/archive/%{commit}/%{github_name}-%{version}-%{shortcommit}.tar.gz
Source0:        https://files.pythonhosted.org/packages/source/w/warlock/warlock-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python-setuptools

BuildRequires:	python-jsonschema
BuildRequires:	python-jsonpatch

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:	python3-jsonschema
BuildRequires:	python3-jsonpatch

# Tests requires for python 3
BuildRequires:	python3-six

%description
Build self-validating python objects using JSON schemas

%package -n python2-%{github_name}
Summary:        Python object model built on top of JSON schema
%{?python_provide:%python_provide python2-%{github_name}}

Requires: python-jsonschema
Requires: python-jsonpatch
Requires: python-six

%description -n python2-%{github_name}
Build self-validating python objects using JSON schemas

%package -n python3-%{github_name}
Summary:        Python object model built on top of JSON schema
%{?python_provide:%python_provide python3-%{github_name}}

Requires: python3-jsonschema
Requires: python3-jsonpatch
Requires: python3-six

%description -n python3-%{github_name}
Build self-validating python objects using JSON schemas

%prep
%setup -q -n %{github_name}-%{version}

# Remove bundled egg-info
rm -rf warlock.egg-info
# let RPM handle deps
sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
rm -f requirements.txt

%build
%py2_build
%py3_build

%install
%py3_install
%py2_install

%check
%{__python2} setup.py test
%{__python3} setup.py test

%files -n python2-%{github_name}
%doc README.md
%license LICENSE.txt
%{python2_sitelib}/warlock
%{python2_sitelib}/warlock-%{version}-py?.?.egg-info

%files -n python3-%{github_name}
%doc README.md
%license LICENSE.txt
%{python3_sitelib}/warlock
%{python3_sitelib}/warlock-%{version}-py?.?.egg-info

%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

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

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

* Wed Jul 27 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.3.0-1
- Update to 1.3.0
- Provide a python 3 subpackage
- Modernize SPEC

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

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

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

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Thu Oct 10 2013 Alan Pevec <apevec@redhat.com> 1.0.1-1
- update to 1.0.1

* Tue Aug 13 2013 Alan Pevec <apevec@redhat.com> 0.4.0-5
- fix FTBFS in rawhide rhbz#993177

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

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

* Wed Aug 22 2012 Alan Pevec <apevec@redhat.com> 0.4.0-2
- Add missing build requirements

* Fri Aug 10 2012 Dan Prince - 0.4.0-1
- Initial package.