%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %global modname appstream %global distname python_appstream Name: python-appstream Version: 0.2 Release: 1%{?dist} Summary: Parse AppStream files when you don't have libappstream-glib Group: Development/Libraries License: LGPLv2+ URL: http://pypi.python.org/pypi/python-appstream Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools %description If you want to parse AppStream files in Python you probably should just install libappstream-glib, and use the GObjectIntrospection bindings for that. AppStreamGlib is a much better library than this and handles many more kinds of component. If AppStreamGlib is not available to you (e.g. you're trying to run in an OpenShift instance on RHEL 6.2), this project might be somewhat useful. %prep %setup -q -n %{name}-%{version} # Remove bundled egg-info in case it exists rm -rf %{distname}.egg-info %build %{__python2} setup.py build %install %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} %check python test.py %files %doc README.md LICENSE %{python2_sitelib}/%{modname}/ %{python2_sitelib}/%{distname}-%{version}* %changelog * Sat Oct 24 2015 Ralph Bean - 0.2-1 - Initial package for Fedora (really, for EPEL6).