From: František Dvořák Date: Wed, 26 Aug 2015 10:22:27 +0000 (+0200) Subject: Initial import. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d400d60bd9dec8640762e48743bc73b8b8925d0c;p=packaging-rpm-pOCCI.git Initial import. --- d400d60bd9dec8640762e48743bc73b8b8925d0c diff --git a/branches.txt b/branches.txt new file mode 100644 index 0000000..37c6daf --- /dev/null +++ b/branches.txt @@ -0,0 +1,4 @@ +EPEL6: +old python 2 (failUnlessRaises() takes at least 3 arguments (2 given), ...) + +==> F21, EPEL7 diff --git a/pOCCI-2to3.diff b/pOCCI-2to3.diff new file mode 100644 index 0000000..1d421e4 --- /dev/null +++ b/pOCCI-2to3.diff @@ -0,0 +1,22 @@ +Enable 2to3 conversion in setuptools with workaround for tests. + +diff --git a/setup.py b/setup.py +index 76d7dc8..7ec9658 100644 +--- a/setup.py ++++ b/setup.py +@@ -50,7 +50,7 @@ setup( + + keywords='OCCI cloud compliance testing pycurl', + +- packages=find_packages(exclude=['doc', 'tests']), ++ packages=find_packages(exclude=['doc']), + + install_requires=['pycurl'], + +@@ -68,4 +68,6 @@ setup( + }, + + test_suite='tests', ++ ++ use_2to3 = True, + ) diff --git a/python-pOCCI.spec b/python-pOCCI.spec new file mode 100644 index 0000000..5ff6d67 --- /dev/null +++ b/python-pOCCI.spec @@ -0,0 +1,167 @@ +%global srcname pOCCI +%global commit d61185f1ed58d8bfb8606be256936483d110b78a +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +%{!?py2_build:%global py2_build %{__python2} setup.py build --executable="%{__python2} -s"} +%{!?py2_install:%global py2_install %{__python2} setup.py install -O1 --skip-build --root %{buildroot}} +%{!?py3_build:%global py3_build %{__python3} setup.py build --executable="%{__python3} -s"} +%{!?py3_install:%global py3_install %{__python3} setup.py install -O1 --skip-build --root %{buildroot}} + +%if 0%{?rhel} +%global with_python3 0 +%else +%global with_python3 1 +%endif + +Name: python-%{srcname} +Version: 0.0.1 +Release: 0.20150826git%{shortcommit}%{?dist} +Summary: OCCI compliance testing + +License: MIT +URL: https://github.com/CESNET/pOCCI +Source0: https://github.com/CESNET/%{srcname}/archive/%{commit}/%{srcname}-%{commit}.tar.gz +# enable 2to3 with workarounds for buggy setuptools +# (not intended for inclusion in the code) +Patch1: %{srcname}-2to3.diff + +BuildArch: noarch +BuildRequires: python2-devel python-pycurl +%if 0%{?with_python3} +BuildRequires: python3-devel python3-pycurl +%endif +BuildRequires: python-sphinx + +%description +OCCI compliance testing. + + +%package -n python2-%{srcname} +Summary: %{summary} +BuildArch: noarch +Requires: python-pycurl +Requires: python-setuptools +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-pOCCI +OCCI compliance testing. + +%if 0%{?with_python3} + +%package -n python3-%{srcname} +Summary: %{summary} +Requires: python3-pycurl +Requires: python3-setuptools +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +OCCI compliance testing. + +%endif + +%package doc +Summary: Documentation for %{srcname} + +%description doc +User and API documentation for OCCI compliance testing python modules. + + +%prep +%setup -qc +pushd %{srcname}-%{commit} +%patch1 -p1 +# can be removed upstream +sed -e "/'numpydoc'/d" -i doc/conf.py +%if 0%{?rhel} && 0%{?rhel} <= 6 +sed -e "/'sphinx.ext.viewcode'/d" -i doc/conf.py +%endif +popd +cp -a %{srcname}-%{commit} python2 +cp -a %{srcname}-%{commit} python3 + + +%build +pushd python2 +%py2_build +make html +rm -f build/html/.buildinfo +popd + +%if 0%{?with_python3} +pushd python3 +%py3_build +popd +%endif + + +%install +pushd python2 +%py2_install +popd +cp -p %{buildroot}%{_bindir}/pOCCI %{buildroot}%{_bindir}/pOCCI-2.7 +rm -f %{buildroot}%{python2_sitelib}/%{srcname}/pOCCI.cfg +rm -rf %{buildroot}%{python2_sitelib}/tests +chmod +x %{buildroot}%{python2_sitelib}/%{srcname}/pOCCI.py + +%if 0%{?with_python3} +pushd python3 +%py3_install +cp -p %{buildroot}%{_bindir}/pOCCI %{buildroot}%{_bindir}/pOCCI-3.4 +rm -f %{buildroot}%{python3_sitelib}/%{srcname}/pOCCI.cfg +rm -rf %{buildroot}%{python3_sitelib}/tests +chmod +x %{buildroot}%{python3_sitelib}/%{srcname}/pOCCI.py +rm -f %{buildroot}%{python3_sitelib}/%{srcname}/pOCCI.1 +popd +%endif + +mkdir -p %{buildroot}%{_mandir}/man1 +mv %{buildroot}%{python2_sitelib}/%{srcname}/pOCCI.1 %{buildroot}%{_mandir}/man1/ +rm -f %{buildroot}%{_sysconfdir}/pOCCI.cfg + + +%check +pushd python2 +%{__python2} setup.py test +popd + +%if 0%{?with_python3} +# workaround problems with tests in setuptools +pushd python3/build/lib/tests +%{__python3} ./test_parse_http.py +%{__python3} ./test_parse_text.py +%{__python3} ./test_parse_uri.py +popd +%endif + + +%files -n python2-%{srcname} +%license python2/LICENSE +%doc python2/README.rst +%doc python2/%{srcname}/pOCCI.cfg +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-%{version}*.egg-info/ +%{_bindir}/pOCCI-2* +%{_mandir}/man1/pOCCI.1* +%if ! 0%{?with_python3} +%{_bindir}/pOCCI +%endif + +%if 0%{?with_python3} +%files -n python3-%{srcname} +%license python3/LICENSE +%doc python3/README.rst +%doc python3/%{srcname}/pOCCI.cfg +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-%{version}*.egg-info/ +%{_bindir}/pOCCI +%{_bindir}/pOCCI-3* +%{_mandir}/man1/pOCCI.1* +%endif + +%files doc +%doc python2/build/html/ + + +%changelog +* Tue Aug 25 2015 FrantiÅ¡ek Dvořák - 0.0.1-0.20150826git72fa242 +- Initial package