[python-humanize] First release

stevetraylen stevetraylen at fedoraproject.org
Wed Apr 30 15:21:19 UTC 2014


commit 6956ef5642767d7c8c82c04989063173b70358ef
Author: Steve Traylen <steve.traylen at cern.ch>
Date:   Wed Apr 30 15:21:02 2014 +0000

    First release

 .gitignore           |    1 +
 python-humanize.spec |  126 ++++++++++++++++++++++++++++++++++++++++++++++++++
 sources              |    1 +
 3 files changed, 128 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..e091cf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/humanize-0.5.tar.gz
diff --git a/python-humanize.spec b/python-humanize.spec
new file mode 100644
index 0000000..5ff641a
--- /dev/null
+++ b/python-humanize.spec
@@ -0,0 +1,126 @@
+%if 0%{?fedora} > 12
+%global with_python3 1
+%endif
+
+%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())")}
+%endif
+
+# Tests are available in head version but not in release 0.5
+# enable them at next release.
+%global with_checks 0
+
+Name:           python-humanize
+Version:        0.5
+Release:        3%{?dist}
+Summary:        Turns dates in to human readable format, e.g '3 minutes ago'
+
+License:        MIT
+URL:            https://github.com/jmoiron/humanize
+Source0:        https://pypi.python.org/packages/source/h/humanize/humanize-0.5.tar.gz
+
+BuildArch:      noarch
+BuildRequires:  python-setuptools
+BuildRequires:  python2-devel
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+BuildRequires:  python3-tools
+%endif
+
+
+%description
+This modest package contains various common humanization utilities, like turning
+a number into a fuzzy human readable duration ('3 minutes ago') or into a human
+readable size or throughput.
+
+
+%if 0%{?with_python3}
+%package -n python3-humanize
+Summary:        Turns dates in to human readable format, e.g '3 minutes ago'
+
+%description -n python3-humanize
+This modest package contains various common humanization utilities, like turning
+a number into a fuzzy human readable duration ('3 minutes ago') or into a human
+readable size or throughput.
+%endif
+
+%prep
+%setup -q -n humanize-%{version}
+
+# Remove shebangs from libs.
+for lib in humanize/time.py humanize/filesize.py humanize/number.py; do
+ sed '1{\@^#!/usr/bin/env python at d}' $lib > $lib.new &&
+ touch -r $lib $lib.new && mv $lib.new $lib
+done
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
+
+%build
+%if 0%{?with_python3}
+pushd %{py3dir}
+# LANG required so README.rst can be parsed.
+LANG=en_US.UTF-8 %{__python3} setup.py build
+popd
+%endif
+
+%{__python2} setup.py build
+
+%install
+%if 0%{?with_python3}
+pushd %{py3dir}
+LANG=en_US.UTF-8 %{__python3} setup.py install --skip-build --root %{buildroot}
+%find_lang humanize
+popd
+%endif
+
+%{__python2} setup.py install --skip-build --root %{buildroot}
+%find_lang humanize
+
+# Remove python3 lang files
+%if 0%{?with_python3}
+sed -i 's|^.*%{python3_sitelib}.*||' humanize.lang
+%endif
+
+%check
+%if 0%{?with_checks}
+%{__python2} setup.py test
+%if 0%{?with_python3}
+pushd %{py3dir}
+LANG=en_US.UTF-8 %{__python3} setup.py test
+popd
+%endif
+%endif
+
+%files -f humanize.lang
+%doc README.rst LICENCE
+%dir %{python2_sitelib}/humanize
+%{python2_sitelib}/humanize/*.py*
+%{python2_sitelib}/humanize-%{version}-py%{python2_version}.egg-info
+%exclude %{_usr}/lib/python*/site-packages/humanize/locale/*/LC_MESSAGES/*.po
+
+
+%if 0%{?with_python3}
+%files -n python3-humanize -f %{py3dir}/humanize.lang
+%doc README.rst LICENCE
+%dir %{python3_sitelib}/humanize
+%{python3_sitelib}/humanize/*.py
+%{python3_sitelib}/humanize/__pycache__
+%{python3_sitelib}/humanize-%{version}-py%{python3_version}.egg-info
+%exclude %{_usr}/lib/python*/site-packages/humanize/locale/*/LC_MESSAGES/*.po
+%endif
+
+%changelog
+* Wed Apr 23 2014 Steve Traylen <steve.traylen at cern.ch> 0.5-3
+- Use __python2 rather than __python throughout. - rhbz#1088882
+
+* Tue Apr 22 2014 Steve Traylen <steve.traylen at cern.ch> 0.5-2
+- Add python3 package - rhbz#1088882.
+
+* Thu Apr 17 2014 Steve Traylen <steve.traylen at cern.ch> 0.5-1
+- First release
+
diff --git a/sources b/sources
index e69de29..e9912cb 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+2f00150400ae6a6e0e9767c18a3147cd  humanize-0.5.tar.gz


More information about the scm-commits mailing list