diff --git a/.gitignore b/.gitignore index e69de29..406d99e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/anymarkup-0.4.2.tar.gz diff --git a/python-anymarkup.spec b/python-anymarkup.spec new file mode 100644 index 0000000..02e83c7 --- /dev/null +++ b/python-anymarkup.spec @@ -0,0 +1,135 @@ +%if 0%{?rhel} +%global with_python3 0 +%else +%global with_python3 1 +%endif + +# Created by pyp2rpm-1.1.1 +%global pypi_name anymarkup +%global srcname anymarkup +%global modulename anymarkup + +Name: python-%{srcname} +Version: 0.4.2 +Release: 1%{?dist} +Summary: Parse or serialize any markup in Python + +License: BSD +URL: https://github.com/bkabrda/anymarkup +Source0: https://pypi.python.org/packages/source/a/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +BuildArch: noarch + +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: pytest +BuildRequires: python-configobj python-six python-xmltodict PyYAML + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pytest +%endif + +Requires: python-configobj python-six python-xmltodict PyYAML +Requires: pytest >= 2.4.0 + +%description +%{summary} + +Currently supports ini, json, xml and yaml. + +%if 0%{?with_python3} +%package -n python3-%{srcname} +Summary: %{summary} + +BuildRequires: python3-configobj +BuildRequires: python3-six +BuildRequires: python3-xmltodict +BuildRequires: python3-PyYAML + +Requires: python3 +Requires: python3-configobj +Requires: python3-six +Requires: python3-xmltodict +Requires: python3-PyYAML + +%description -n python3-%{srcname} +%{summary} + +Currently supports ini, json, xml and yaml. + +%endif + +%prep +%setup -q -n %{pypi_name}-%{version} +# Remove bundled egg-info +rm -rf %{pypi_name}.egg-info + +%if 0%{?with_python3} +echo %{py3dir} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif + +%install +%{__python2} setup.py install --skip-build --root %{buildroot} + +%if 0%{?with_python3} +%py_byte_compile %{__python2} %{buildroot}%{python_sitelib}/%{srcname} +%else +# py_byte_compile is only defined in python3-devel +%{__python2} -m compileall %{buildroot}%{python_sitelib}/%{srcname} +%endif + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/%{srcname} +popd +%endif + +%check +%{__python2} -m pytest + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} -m pytest +popd +%endif + +%files +%if 0%{?fedora} +%license LICENSE +%else +%if 0%{?rhel} < 7 +%doc LICENSE +%else +%license LICENSE +%endif +%endif +%doc README.rst +%{python2_sitelib}/%{modulename} +%{python2_sitelib}/%{modulename}-%{version}-py?.?.egg-info + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%license LICENSE +%doc README.rst +%{python3_sitelib}/%{modulename}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/%{modulename}/ +%endif + +%changelog +* Thu May 21 2015 jchaloup - 0.4.2-1 +- Initial package + resolves: #1223843 diff --git a/sources b/sources index e69de29..7acf6df 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +4ec22097a132d6b7def8d1cd1dd6969f anymarkup-0.4.2.tar.gz