From 26ef00b12e1640f83f365f3013342f799de64c95 Mon Sep 17 00:00:00 2001 From: Sergio Pascual Date: Jul 23 2014 07:56:17 +0000 Subject: Import python-voluptuous --- diff --git a/.gitignore b/.gitignore index e69de29..038d944 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/voluptuous-0.8.5.tar.gz diff --git a/python-voluptuous.spec b/python-voluptuous.spec new file mode 100644 index 0000000..4195281 --- /dev/null +++ b/python-voluptuous.spec @@ -0,0 +1,84 @@ + +%global upname voluptuous + +Name: python-%{upname} +Version: 0.8.5 +Release: 2%{?dist} +Summary: A Python data validation library +License: BSD +Group: Development/Languages +URL: http://github.com/alecthomas/voluptuous +# The tarball from pypi has missing files (COPYING) +# Use the tarball from github instead +#Source0: http://pypi.python.org/packages/source/v/voluptuous/%{upname}-%{version}.tar.gz +Source0: http://github.com/alecthomas/voluptuous/archive/%{version}.tar.gz#/%{upname}-%{version}.tar.gz +BuildRequires: python2-devel python-setuptools + +BuildArch: noarch +%if 0%{?with_python3} +BuildRequires: python3-devel python3-setuptools +%endif # if with_python3 + +%description +Voluptuous, despite the name, is a Python data validation library. It is +primarily intended for validating data coming into Python as JSON, YAML, etc. + +%if 0%{?with_python3} +%package -n python3-%{upname} +Summary: A Python data validation library + +%description -n python3-%{upname} +Voluptuous, despite the name, is a Python data validation library. It is +primarily intended for validating data coming into Python as JSON, YAML, etc. + +%endif # with_python3 + +%prep +%setup -q -n %{upname}-%{version} +rm -rf %{upname}.egg-info + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' +%endif # with_python3 + +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' + +%build +%{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py build +popd +%endif # with_python3 + +%install + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} +popd +%endif # with_python3 + +%{__python2} setup.py install -O1 --skip-build --root %{buildroot} + +%files +%doc README.md COPYING +%{python2_sitelib}/* + +%if 0%{?with_python3} +%files -n python3-%{upname} +%doc README.md COPYING +%{python3_sitelib}/* +%endif # with_python3 + +%changelog +* Tue Jul 22 2014 Sergio Pascual - 0.8.5-2 +- Use tarball from github +- Add COPYING to doc + +* Mon Mar 17 2014 Sergio Pascual - 0.8.5-1 +- Initial spec file + diff --git a/sources b/sources index e69de29..503c785 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +ad1eb74a17140a7a3dacb6dfd95db07d voluptuous-0.8.5.tar.gz