diff options
author | Mateusz Korniak | 2014-10-06 13:03:50 (GMT) |
---|---|---|
committer | Mateusz Korniak | 2014-10-06 13:03:50 (GMT) |
commit | ae31b8b9f6f2ae12eb7fe06ae12ccc35b0b2144d (patch) | |
tree | b14460fb3fa69cab10d64d64f7c8a60f974dfa4b | |
download | python-enum-ae31b8b9f6f2ae12eb7fe06ae12ccc35b0b2144d.zip python-enum-ae31b8b9f6f2ae12eb7fe06ae12ccc35b0b2144d.tar.gz |
Initial version 0.4.4-1
-rw-r--r-- | python-enum-py3_setup_fix.patch | 28 | ||||
-rw-r--r-- | python-enum.spec | 122 |
2 files changed, 150 insertions, 0 deletions
diff --git a/python-enum-py3_setup_fix.patch b/python-enum-py3_setup_fix.patch new file mode 100644 index 0000000..d190b68 --- /dev/null +++ b/python-enum-py3_setup_fix.patch @@ -0,0 +1,28 @@ +--- ./setup.py.py3_setup_fix 2014-10-06 14:50:58.345807216 +0200 ++++ ./setup.py 2014-10-06 14:51:06.456180332 +0200 +@@ -13,6 +13,8 @@ + """ + + import textwrap ++import sys ++print (sys.version) + + from setuptools import setup, find_packages + +@@ -22,11 +24,15 @@ main_module_name = 'enum' + main_module = __import__(main_module_name) + version = main_module.__version__ + +-main_module_doc = main_module.__doc__.decode('utf-8') ++if sys.version_info < (3,0,0): ++ main_module_doc = main_module.__doc__.decode('utf-8') ++else: ++ main_module_doc = main_module.__doc__ + short_description, long_description = ( + textwrap.dedent(desc).strip() + for desc in main_module_doc.split('\n\n', 1) + ) ++ + + + setup( diff --git a/python-enum.spec b/python-enum.spec new file mode 100644 index 0000000..1db0660 --- /dev/null +++ b/python-enum.spec @@ -0,0 +1,122 @@ +# +# Conditional build: +%bcond_with doc # don't build doc +%bcond_with tests # do not perform "make test" +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module + +%define module enum +Summary: Robust enumerated type support in Python. +Summary(pl.UTF-8): Odporny typ wyliczeniowy dla Pythona +# Name must match the python module/package name (as in 'import' statement) +Name: python-%{module} +Version: 0.4.4 +Release: 1 +License: GPL or PSF +Group: Libraries/Python +Source: http://pypi.python.org/packages/source/e/%{module}/%{module}-%{version}.tar.gz +Patch0: %{name}-py3_setup_fix.patch +URL: http://pypi.python.org/pypi/enum/ +BuildRequires: rpm-pythonprov +# if py_postclean is used +BuildRequires: rpmbuild(macros) >= 1.219 +%if %{with python2} +BuildRequires: python-distribute +%endif +%if %{with python3} +BuildRequires: python3-distribute +BuildRequires: python3-modules +%endif +# Below Rs only work for main package (python2) +#Requires: python-libs +Requires: python-modules +BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Package provides a module for robust enumerations in Python. + +# %description -l pl.UTF-8 + +%package -n python3-%{module} +Summary: - +Summary(pl.UTF-8): - +Group: Libraries/Python +Requires: python3-modules + +%description -n python3-%{module} + +%description -n python3-%{module} -l pl.UTF-8 + +%package apidocs +Summary: %{module} API documentation +Summary(pl.UTF-8): Dokumentacja API %{module} +Group: Documentation + +%description apidocs +API documentation for %{module}. + +%description apidocs -l pl.UTF-8 +Dokumentacja API %{module}. + +%prep +%setup -q -n %{module}-%{version} +%patch0 -p1 + + +%build +%if %{with python2} +%{__python} setup.py build --build-base build-2 %{?with_tests:test} +%endif + +%if %{with python3} +%{__python3} setup.py build --build-base build-3 %{?with_tests:test} +%endif + +%install +rm -rf $RPM_BUILD_ROOT + +%if %{with python2} +%{__python} setup.py \ + build --build-base build-2 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT + +%py_postclean +%endif + +%if %{with python3} +%{__python3} setup.py \ + build --build-base build-3 \ + install --skip-build \ + --optimize=2 \ + --root=$RPM_BUILD_ROOT +%endif + + +%clean +rm -rf $RPM_BUILD_ROOT + +%if %{with python2} +%files +%defattr(644,root,root,755) +%{py_sitescriptdir}/*.py[co] +%if "%{py_ver}" > "2.4" +%{py_sitescriptdir}/%{module}-%{version}-py*.egg-info +%endif +%endif + +%if %{with python3} +%files -n python3-%{module} +%defattr(644,root,root,755) +%{py3_sitescriptdir}/%{module}.py +%{py3_sitescriptdir}/__pycache__/*py[co] +%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info +%endif + +%if %{with doc} +%files apidocs +%defattr(644,root,root,755) +%doc docs/_build/html/* +%endif |