diff --git a/.gitignore b/.gitignore index ff8ddd1..80f6477 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /xmltodict-0.4.2.tar.gz /xmltodict-0.9.0.tar.gz +/xmltodict-0.9.2.tar.gz diff --git a/python-xmltodict.spec b/python-xmltodict.spec index 4d0626f..87e28bc 100644 --- a/python-xmltodict.spec +++ b/python-xmltodict.spec @@ -1,20 +1,11 @@ -%if 0%{?fedora} > 12 -%global with_python3 1 -%{!?py3ver: %global py3ver %(%{__python3} -c "import sys ; print(sys.version[:3])")} -%else -%{!?__python2: %global __python2 /usr/bin/python2} -%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} -%endif -%{!?py2ver: %global py2ver %(%{__python2} -c "import sys ; print sys.version[:3]")} - %global srcname xmltodict +%global sum A Python to transform XML to JSON Name: python-xmltodict -Version: 0.9.0 -Release: 3%{?dist} -Summary: Makes working with XML feel like you are working with JSON +Version: 0.9.2 +Release: 1%{?dist} +Summary: %{sum} -Group: Development/Libraries License: MIT URL: https://github.com/martinblech/xmltodict Source0: http://pypi.python.org/packages/source/x/%{srcname}/%{srcname}-%{version}.tar.gz @@ -22,12 +13,9 @@ Source0: http://pypi.python.org/packages/source/x/%{srcname}/%{srcnam BuildArch: noarch BuildRequires: python2-devel -BuildRequires: python-nose - -%if 0%{?with_python3} +BuildRequires: python2-nose BuildRequires: python3-devel BuildRequires: python3-nose -%endif %description xmltodict is a Python module that makes working with XML feel like you are @@ -35,88 +23,36 @@ 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. - >>> doc = xmltodict.parse(""" - ... - ... - ... elements - ... more elements - ... - ... - ... element as well - ... - ... - ... """) - >>> - >>> doc['mydocument']['@has'] - u'an attribute' - >>> doc['mydocument']['and']['many'] - [u'elements', u'more elements'] - >>> doc['mydocument']['plus']['@a'] - u'complex' - >>> doc['mydocument']['plus']['#text'] - u'element as well' - +%package -n python2-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python2-%{srcname}} -%if 0%{?with_python3} -%package -n python3-xmltodict -Summary: Makes working with XML feel like you are working with JSON -Group: Development/Libraries +%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. -Requires: python3 +%package -n python3-%{srcname} +Summary: %{sum} +%{?python_provide:%python_provide python3-%{srcname}} -%description -n python3-xmltodict +%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. - >>> doc = xmltodict.parse(""" - ... - ... - ... elements - ... more elements - ... - ... - ... element as well - ... - ... - ... """) - >>> - >>> doc['mydocument']['@has'] - u'an attribute' - >>> doc['mydocument']['and']['many'] - [u'elements', u'more elements'] - >>> doc['mydocument']['plus']['@a'] - u'complex' - >>> doc['mydocument']['plus']['#text'] - u'element as well' -%endif - %prep -%setup -q -n %{srcname}-%{version} -rm -rf %{srcname}.egg-info -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' -%if 0%{?with_python3} -rm -rf %{py3dir} -cp -a . %{py3dir} -find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' -%endif +%autosetup -n %{srcname}-%{version} %build -%{__python2} setup.py build -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py build -popd -%endif +%py2_build +%py3_build %install -%if 0%{?with_python3} -pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root=%{buildroot} -popd -%endif -%{__python2} setup.py install -O1 --skip-build --root=%{buildroot} +%py2_install +%py3_install %check nosetests-%{py2ver} @@ -126,20 +62,24 @@ nosetests-%{py3ver} popd %endif -%files -%doc README.md LICENSE PKG-INFO +%files -n python2-%{srcname} +%doc README.md PKG-INFO +%license LICENSE %{python_sitelib}/%{srcname}.py* %{python_sitelib}/%{srcname}-%{version}* -%if 0%{?with_python3} -%files -n python3-xmltodict +%files -n python3-%{srcname} %doc README.md LICENSE PKG-INFO +%license LICENSE %{python3_sitelib}/%{srcname}.py %{python3_sitelib}/%{srcname}-%{version}-* %{python3_sitelib}/__pycache__/%{srcname}* -%endif %changelog +* Sat Nov 14 2015 Fabian Affolter - 0.9.2-1 +- Cleanup +- Update to latest upstream reelase 0.9.2 + * Tue Nov 10 2015 Fedora Release Engineering - 0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 diff --git a/sources b/sources index 8578b8a..0895407 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3dee8f1a5172315119051a3854596244 xmltodict-0.9.0.tar.gz +ab17e53214a8613ad87968e9674d75dd xmltodict-0.9.2.tar.gz