Blob Blame History Raw
%global srcname xmltodict

Name:               python-xmltodict
Version:            0.12.0
Release:            2%{?dist}
Summary:            A Python to transform XML to JSON

License:            MIT
URL:                https://github.com/martinblech/xmltodict
Source0:            https://github.com/martinblech/xmltodict/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
BuildArch:          noarch

%description
xmltodict is a Python module that makes working with XML feel like you are
working with JSON.  It's very fast (Expat-based) and has a streaming mode
with a small memory footprint, suitable for big XML dumps like Discogs or
Wikipedia.

%if 0%{?fedora} < 31
%package -n python2-%{srcname}
Summary:        %{sum}
BuildRequires:      python2-devel
BuildRequires:      python2-nose
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
xmltodict is a Python module that makes working with XML feel like you are
working with JSON.  It's very fast (Expat-based) and has a streaming mode
with a small memory footprint, suitable for big XML dumps like Discogs or
Wikipedia.
%endif

%package -n python3-%{srcname}
Summary:            %{summary}

BuildRequires:      python3-devel
BuildRequires:      python3-nose
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
xmltodict is a Python module that makes working with XML feel like you are
working with JSON.  It's very fast (Expat-based) and has a streaming mode
with a small memory footprint, suitable for big XML dumps like Discogs or
Wikipedia.

%prep
%autosetup -n %{srcname}-%{version}
rm -rf %{py3dir}
cp -a . %{py3dir}

%build
%if 0%{?fedora} < 31
%py2_build
%endif
pushd %{py3dir}
%py3_build
popd

%install
%if 0%{?fedora} < 31
%py2_install
%endif
pushd %{py3dir}
%py3_install
popd

%check
%if 0%{?fedora} < 31
nosetests-2.7
%endif
pushd %{py3dir}
%{__python3} -m nose
popd

%if 0%{?fedora} < 31
%files -n python2-%{srcname}
%doc README.md
%license LICENSE
%{python2_sitelib}/%{srcname}.py*
%{python2_sitelib}/%{srcname}-%{version}*
%endif

%files -n python3-%{srcname}
%doc README.md
%license LICENSE
%{python3_sitelib}/%{srcname}.py
%{python3_sitelib}/%{srcname}-%{version}-*
%{python3_sitelib}/__pycache__/%{srcname}*

%changelog
* Sun Jun 30 2019 Kevin Fenzi <kevin@scrye.com> - 0.12.0-2
- Conditionalize dropping python2 support so it only happens in f31+
- Fixes bug 1724842

* Sat Jun 08 2019 Fabian Affolter <mail@fabian-affolter.ch> - 0.12.0-1
- Update to latest upstream release 0.12.0

* Wed Mar 27 2019 Miro Hrončok <mhroncok@redhat.com> - 0.10.2-9
- Subpackage python2-xmltodict has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

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

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

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

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

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

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

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

* Tue Nov 15 2016 Fabian Affolter <mail@fabian-affolter.ch> - 0.10.2-1
- Update to latest upstream reelase 0.10.2

* Sun May 01 2016 Fabian Affolter <mail@fabian-affolter.ch> - 0.10.1-1
- Update to latest upstream reelase 0.10.1

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

* Sat Nov 14 2015 Fabian Affolter <mail@fabian-affolter.ch> - 0.9.2-1
- Cleanup
- Update to latest upstream reelase 0.9.2

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

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

* Thu Oct 02 2014 Fabian Affolter <mail@fabian-affolter.ch> - 0.9.0-1
- Update spec file according guidelines 
- Update to upstream release 0.9.0

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

* Wed May 28 2014 Kalev Lember <kalevlember@gmail.com> - 0.4.2-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

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

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

* Fri Jan 04 2013 Ralph Bean <rbean@redhat.com> - 0.4.2-1
- Latest upstream
- Included README and LICENSE
- Running tests now
- https://github.com/martinblech/xmltodict/pull/11
- Added Requires python3 to the python3 subpackage.

* Fri Jan 04 2013 Ralph Bean <rbean@redhat.com> - 0.4.1-1
- Initial packaging for Fedora