[python-freezegun] Initial packaging (#1064576)

Ralph Bean ralph at fedoraproject.org
Thu Feb 27 18:10:50 UTC 2014


commit 849704c5e8398f8cd2e7cb974490a4af6ee5864e
Author: Ralph Bean <rbean at redhat.com>
Date:   Thu Feb 27 13:11:37 2014 -0500

    Initial packaging (#1064576)

 .gitignore                             |    1 +
 python-freezegun-unconstrain-six.patch |   25 +++++++
 python-freezegun.spec                  |  111 ++++++++++++++++++++++++++++++++
 sources                                |    1 +
 4 files changed, 138 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..37ce2ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/freezegun-0.1.12.tar.gz
diff --git a/python-freezegun-unconstrain-six.patch b/python-freezegun-unconstrain-six.patch
new file mode 100644
index 0000000..6f3468d
--- /dev/null
+++ b/python-freezegun-unconstrain-six.patch
@@ -0,0 +1,25 @@
+From f627be59881f26b7da4392e89189e09d1153b215 Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Wed, 12 Feb 2014 16:27:15 -0500
+Subject: [PATCH] Unconstrain six.
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 1b5632e..fc2d769 100644
+--- a/setup.py
++++ b/setup.py
+@@ -3,7 +3,7 @@
+ import sys
+ from setuptools import setup, find_packages
+ 
+-requires = ['six<=1.4']
++requires = ['six']
+ 
+ if sys.version_info[0] == 2:
+     requires += ['python-dateutil>=1.0, <2.0, >=2.1']
+-- 
+1.8.5.3
+
diff --git a/python-freezegun.spec b/python-freezegun.spec
new file mode 100644
index 0000000..f8df649
--- /dev/null
+++ b/python-freezegun.spec
@@ -0,0 +1,111 @@
+%if 0%{?fedora}
+%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())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
+%global modname freezegun
+
+Name:               python-freezegun
+Version:            0.1.12
+Release:            1%{?dist}
+Summary:            Let your Python tests travel through time
+
+Group:              Development/Libraries
+License:            ASL 2.0
+URL:                http://pypi.python.org/pypi/freezegun
+Source0:            http://pypi.python.org/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz
+#https://github.com/spulec/freezegun/pull/33
+Patch0:             python-freezegun-unconstrain-six.patch
+
+BuildArch:          noarch
+
+
+BuildRequires:      python2-devel
+BuildRequires:      python-setuptools
+BuildRequires:      python-six
+BuildRequires:      python-dateutil
+BuildRequires:      python-sure
+
+%if 0%{?with_python3}
+BuildRequires:      python3-devel
+BuildRequires:      python3-setuptools
+BuildRequires:      python3-six
+BuildRequires:      python3-dateutil
+BuildRequires:      python3-sure
+%endif
+
+Requires:           python-six
+Requires:           python-dateutil
+
+%description
+python-freezegun is a library that allows your python tests to travel through
+time by mocking the datetime module.
+
+%if 0%{?with_python3}
+%package -n python3-freezegun
+Summary:            Let your Python tests travel through time
+Group:              Development/Libraries
+
+Requires:           python3-six
+Requires:           python3-dateutil
+
+%description -n python3-freezegun
+python3-freezegun is a library that allows your python tests to travel through
+time by mocking the datetime module.
+%endif
+
+%prep
+%setup -q -n %{modname}-%{version}
+%patch0 -p1
+
+# Remove bundled egg-info in case it exists
+rm -rf %{modname}.egg-info
+%if 0%{?with_python3}
+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
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
+popd
+%endif
+%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
+
+%check
+%{__python2} setup.py test
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
+
+%files
+%doc README.rst LICENSE
+%{python2_sitelib}/%{modname}/
+%{python2_sitelib}/%{modname}-%{version}*
+
+%if 0%{?with_python3}
+%files -n python3-freezegun
+%doc README.rst LICENSE
+%{python3_sitelib}/%{modname}/
+%{python3_sitelib}/%{modname}-%{version}-*
+%endif
+
+%changelog
+* Wed Feb 12 2014 Ralph Bean <rbean at redhat.com> - 0.1.12-1
+- initial package for Fedora
diff --git a/sources b/sources
index e69de29..c66ca1c 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+6e32a43e9fa8e28f8262952f55fbb1af  freezegun-0.1.12.tar.gz


More information about the scm-commits mailing list