Blob Blame History Raw
%global pname pykwalify

# Python3 support in OpenStack starts with version 3.5,
# which is only in Fedora 24+
%if 0%{?fedora} >= 24
%global with_python3 1
%global default_python 3
%else
%global default_python 2
%endif

Name:           python-%{pname}
Version:        1.5.1
Release:        9%{?dist}
Summary:        Python lib/cli for JSON/YAML schema validation

License:        MIT
URL:            http://github.com/grokzen/pykwalify
Source0:        https://files.pythonhosted.org/packages/source/p/%{pname}/%{pname}-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
 
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools

%description
It is a YAML/JSON validation library.
This framework is a port with a lot added functionality
of the java version of the framework kwalify that can be
found at: http://www.kuwata-lab.com/kwalify/


%package -n     python2-%{pname}
Summary:        Python lib/cli for JSON/YAML schema validation
%{?python_provide:%python_provide python2-%{pname}}
 
Requires:       python2-docopt
Requires:       python2-pyyaml
Requires:       python2-dateutil
Requires:       python2-setuptools

%description -n python2-%{pname}
It is a YAML/JSON validation library.
This framework is a port with a lot added functionality
of the java version of the framework kwalify that can be
found at: http://www.kuwata-lab.com/kwalify/

%if 0%{?with_python3}
%package -n     python3-%{pname}
Summary:        Python lib/cli for JSON/YAML schema validation
%{?python_provide:%python_provide python3-%{pname}}
 
Requires:       python3-docopt
Requires:       python3-PyYAML
Requires:       python3-dateutil
Requires:       python3-setuptools

%description -n python3-%{pname}
It is a YAML/JSON validation library.
This framework is a port with a lot added functionality
of the java version of the framework kwalify that can be
found at: http://www.kuwata-lab.com/kwalify/
%endif

%prep
%autosetup -n %{pname}-%{version}
rm -rf *.egg-info

%build
%py2_build

%if 0%{?with_python3}
%py3_build
%endif

%install
%py2_install
mv %{buildroot}%{_bindir}/%{pname} %{buildroot}%{_bindir}/python2-%{pname}

%if 0%{?with_python3}
%py3_install
mv %{buildroot}%{_bindir}/%{pname} %{buildroot}%{_bindir}/python3-%{pname}
%endif

%if 0%{?default_python} >= 3
ln -s %{_bindir}/python3-%{pname} %{buildroot}%{_bindir}/%{pname}
%else
ln -s %{_bindir}/python2-%{pname} %{buildroot}%{_bindir}/%{pname}
%endif


%files -n python2-%{pname}
%license docs/License.txt
%doc README.md
%if 0%{?default_python} <= 2
%{_bindir}/%{pname}
%endif
%{_bindir}/python2-%{pname}
%{python2_sitelib}/%{pname}
%{python2_sitelib}/%{pname}-%{version}-py?.?.egg-info

%if 0%{?with_python3}
%files -n python3-%{pname}
%license docs/License.txt
%doc README.md
%if 0%{?default_python} >= 3
%{_bindir}/%{pname}
%endif
%{_bindir}/python3-%{pname}
%{python3_sitelib}/%{pname}
%{python3_sitelib}/%{pname}-%{version}-py?.?.egg-info
%endif

%changelog
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.5.1-8
- Rebuilt for Python 3.7

* Fri Feb 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.5.1-7
- 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.5.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

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

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

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

* Mon Oct 17 2016 Chandan Kumar <chkumar@redhat.com> - 1.5.1-2
- Removed versions of BR
- Removed unnecessary files

* Thu Oct 13 2016 Chandan Kumar <chkumar@redhat.com> - 1.5.1-1
- Initial package.