[python-gensim/el5] updated to new snapshot git20140510.d1c6d58b9acfec97e6c5d677c652293ae2119276 add Python3-build minor

Björn Esser besser82 at fedoraproject.org
Sun May 11 09:13:35 UTC 2014


commit ccc1f55caec3258537a65d89e2d73c5252077f5d
Author: Björn Esser <bjoern.esser at gmail.com>
Date:   Sun May 11 11:10:54 2014 +0200

    updated to new snapshot git20140510.d1c6d58b9acfec97e6c5d677c652293ae2119276
    add Python3-build
    minor improvements to spec-file

 python-gensim.spec |  140 ++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 130 insertions(+), 10 deletions(-)
---
diff --git a/python-gensim.spec b/python-gensim.spec
index 41d2844..6e873e8 100644
--- a/python-gensim.spec
+++ b/python-gensim.spec
@@ -2,15 +2,20 @@
 #%%global rel_build 1
 
 # Settings used for build from snapshots.
-%{!?rel_build:%global commit		e56d7fd1bb643d772030e645442af3961a4b88aa}
-%{!?rel_build:%global commit_date	20140423}
+%{!?rel_build:%global commit		d1c6d58b9acfec97e6c5d677c652293ae2119276}
+%{!?rel_build:%global commit_date	20140510}
 %{!?rel_build:%global shortcommit	%(c=%{commit};echo ${c:0:7})}
 %{!?rel_build:%global gitver		git%{commit_date}-%{shortcommit}}
 %{!?rel_build:%global gitrel		.git%{commit_date}.%{shortcommit}}
 %{!?rel_build:%global gittar		%{name}-%{version}-%{gitver}.tar.gz}
 %{?rel_build: %global gittar		%{name}-%{version}.tar.gz}
 
-%global		common_description \
+# Can we build a Py3-pkg?
+%if 0%{?fedora} || 0%{?rhel} >= 8
+%global with_python3 1
+%endif #0%{?fedora} || 0%{?rhel} >= 8
+
+%global		common_description					\
 Gensim is a Python library for topic modelling, document indexing	\
 and similarity retrieval with large corpora.  Target audience is	\
 the natural language processing (NLP) and information retrieval		\
@@ -38,7 +43,7 @@ multiple cores.								\
 
 Name:			python-%{pypi_name}
 Version:		0.9.2
-Release:		0.1%{?gitrel}%{?dist}
+Release:		0.2%{?gitrel}%{?dist}
 Summary:		Python framework for fast Vector Space Modelling
 
 License:		LGPLv2
@@ -58,7 +63,7 @@ Summary:		Highly optimized version of word2vec for %{pypi_name}
 BuildRequires:		Cython
 
 Requires:		numpy%{?_isa}
-Requires:		%{name}		== %{version}-%{release}
+Requires:		%{name}			== %{version}-%{release}
 Requires:		scipy%{?_isa}
 
 %description addons
@@ -86,7 +91,7 @@ Requires:		numpy
 Requires:		python-six
 Requires:		scipy
 
-Provides:		%{name}		== %{version}-%{release}
+Provides:		%{name}			== %{version}-%{release}
 
 %description core
 This package contains the pure Python implementation of %{pypi_name}.
@@ -116,14 +121,76 @@ BuildArch:		noarch
 BuildRequires:		python-nose
 
 Requires:		python-nose
-Requires:		%{name}		== %{version}-%{release}
-Requires:		%{name}-addons	== %{version}-%{release}
+Requires:		%{name}			== %{version}-%{release}
+Requires:		%{name}-addons		== %{version}-%{release}
 
 %description test
 This package provides the testsuite for %{name}.  You don't need it
 for everyday usage.
 
 
+%if 0%{?with_python3}
+%package -n python3-%{pypi_name}-addons
+Summary:		Highly optimized version of word2vec for %{pypi_name}
+
+BuildRequires:		python3-Cython
+
+Requires:		python3-numpy%{?_isa}
+Requires:		python3-%{name}		== %{version}-%{release}
+Requires:		python3-scipy%{?_isa}
+
+%description -n python3-%{pypi_name}-addons
+This package contains the highly optimized version of word2vec from
+%{pypi_name}.  It is highly recommend to use this.  If you don't need
+the highly optimized version of word2vec, it is sufficient to install
+the "%{name}-core"-package.
+
+%{common_description}
+
+
+%package -n python3-%{pypi_name}-core
+Summary:		Python framework for fast Vector Space Modelling
+
+BuildArch:		noarch
+
+BuildRequires:		python3-devel
+BuildRequires:		python3-numpy
+BuildRequires:		python3-scipy
+BuildRequires:		python3-setuptools
+BuildRequires:		python3-six
+
+Requires:		python3-numpy
+Requires:		python3-scipy
+Requires:		python3-six
+
+Provides:		python3-%{name}		== %{version}-%{release}
+
+%description -n python3-%{pypi_name}-core
+This package contains the pure Python implementation of %{pypi_name}.
+If you don't need the highly optimized version of word2vec, it is
+sufficient to install this package.  Otherwise installing the
+"%{name}-addons"-package is strongly recommended.
+
+%{common_description}
+
+
+%package -n python3-%{pypi_name}-test
+Summary:		Testsuite for %{name}
+
+BuildArch:		noarch
+
+BuildRequires:		python3-nose
+
+Requires:		python3-nose
+Requires:		python3-%{name}		== %{version}-%{release}
+Requires:		python3-%{name}-addons	== %{version}-%{release}
+
+%description -n python3-%{pypi_name}-test
+This package provides the testsuite for %{name}.  You don't need it
+for everyday usage.
+%endif #0%{?with_python3}
+
+
 %prep
 %setup -q%{?rel_build:n %{pypi_name}-%{version}}%{!?rel_build:n %{pypi_name}-%{commit}}
 
@@ -138,8 +205,8 @@ touch -r ${_file}.orig ${_file} && rm -rf ${_file}.orig
 # Remove hashbangs
 for _file in `find . -type f -name '*.py'`
 do
-  sed '1{\@^#!/usr/bin/env python at d}' ${_file} > ${_file}.new &&
-  touch -r ${_file} ${_file}.new &&
+  sed '1{\@^#!/usr/bin/env python at d}' ${_file} > ${_file}.new &&	\
+  touch -r ${_file} ${_file}.new &&					\
   mv -f ${_file}.new ${_file}
 done
 
@@ -149,13 +216,32 @@ sed -i -e 's!^DEFAULT_VERSION = "1.3.2"!DEFAULT_VERSION = "0.9"!' ez_setup.py
 # Bump version in setup.py
 %{!?rel_build:sed -i -e 's!0\.9\.1!%{version}!' setup.py}
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif #0%{?with_python3}
+
 
 %build
 %{__python2} setup.py build
 
+# Build the Python3-version.
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif #0%{?with_python3}
+
 
 %install
 %{__python2} setup.py install -O1 --skip-build --root %{buildroot}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif #0%{?with_python3}
+
 find %{buildroot} -type f -name '*.pyx' -print0 | xargs -0 rm -f
 
 %fdupes %{buildroot}
@@ -178,6 +264,14 @@ pushd %{buildroot}%{python2_sitelib}/%{pypi_name}
 nosetests -v
 popd
 
+%if 0%{?with_python3}
+PYTHONPATH="%{buildroot}%{python3_sitelib}"
+export PYTHONPATH="${PYTHONPATH}:%{buildroot}%{python3_sitearch}"
+pushd %{buildroot}%{python3_sitelib}/%{pypi_name}
+nosetests-%{python3_version} -v
+popd
+%endif #0%{?with_python3}
+
 
 %files addons
 %{python2_sitearch}/%{pypi_name}_addons
@@ -199,6 +293,32 @@ popd
 %{python2_sitelib}/%{pypi_name}/nosy.py*
 %{python2_sitelib}/%{pypi_name}/test
 
+%if 0%{?with_python3}
+%files -n python3-%{pypi_name}-addons
+%{python3_sitearch}/%{pypi_name}_addons
+%{python3_sitearch}/%{pypi_name}_addons-%{version}-py%{python3_version}.egg-info
+
+%files -n python3-%{pypi_name}-core
+%doc CHANGELOG* COPYING* README*
+%dir %{python3_sitelib}/%{pypi_name}
+%exclude %{python3_sitelib}/%{pypi_name}/nosy.py
+%exclude %{python3_sitelib}/%{pypi_name}/__pycache__/nosy*
+%exclude %{python3_sitelib}/%{pypi_name}/test
+%{python3_sitelib}/%{pypi_name}/*
+%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
+
+%files -n python3-%{pypi_name}-test
+%{python3_sitelib}/%{pypi_name}/nosy.py
+%{python3_sitelib}/%{pypi_name}/__pycache__/nosy*
+%{python3_sitelib}/%{pypi_name}/test
+%endif #0%{?with_python3}
+
+
+%changelog
+* Sun May 11 2014 Björn Esser <bjoern.esser at gmail.com> - 0.9.2-0.2.git20140510.d1c6d58
+- updated to new snapshot git20140510.d1c6d58b9acfec97e6c5d677c652293ae2119276
+- add Python3-build
+- minor improvements to spec-file
 
 %changelog
 * Thu May 01 2014 Björn Esser <bjoern.esser at gmail.com> - 0.9.2-0.1.git20140423.e56d7fd


More information about the scm-commits mailing list