commit 8246b600618ad1ec659e9e8f848f507e2b934d8f70331ee260c4b547936f72e9 Author: Matej Cepl Date: Tue May 24 20:41:12 2022 +0000 - Initial packaging effort for fasttext 0.9.2. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fasttext?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/fastText-0.9.2.tar.gz b/fastText-0.9.2.tar.gz new file mode 100644 index 0000000..96ccf4f --- /dev/null +++ b/fastText-0.9.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ea4edcdb64bfc6faaaec193ef181bdc108ee62bb6a04e48b2e80b639a99e27e +size 4036722 diff --git a/python-fasttext.changes b/python-fasttext.changes new file mode 100644 index 0000000..c918c70 --- /dev/null +++ b/python-fasttext.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Tue May 24 18:16:16 UTC 2022 - Matej Cepl + +- Initial packaging effort for fasttext 0.9.2. diff --git a/python-fasttext.spec b/python-fasttext.spec new file mode 100644 index 0000000..9112d8a --- /dev/null +++ b/python-fasttext.spec @@ -0,0 +1,90 @@ +# +# spec file for package python-fasttext +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define modname fastText +Name: python-fasttext +Version: 0.9.2 +Release: 0 +Summary: Library for fast text representation and classification +License: MIT +URL: https://github.com/facebookresearch/fastText +Source: https://github.com/facebookresearch/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pybind11-devel} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: gcc-c++ +BuildRequires: python-rpm-macros +# SECTION test requirements +BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pybind11 >= 2.2} +BuildRequires: %{python_module setuptools >= 0.7.0} +# /SECTION +BuildRequires: fdupes +Requires: python-numpy +Requires: python-pybind11 >= 2.2 +Requires: python-setuptools >= 0.7.0 +Requires(post): update-alternatives +Requires(postun):update-alternatives +%python_subpackages + +%description +fastText is a library for efficient learning of word +representations and sentence classification. + +%prep +%autosetup -p1 -n %{modname}-%{version} + +sed -Ei "1{/^#!\/usr\/bin\/env python/d}" \ + python/fasttext_module/fasttext/util/util.py + +%build +export CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" +%make_build + +%pyproject_wheel + +%install +%pyproject_install +%{python_expand : +install -Dpm 0755 fasttext %{buildroot}%{_bindir}/fasttext +%python_clone -a %{buildroot}%{_bindir}/fasttext +%fdupes %{buildroot}%{$python_sitearch} +} + +%check +# Tests require 300+MB test data + +%post +%python_install_alternative fasttext + +%postun +%python_uninstall_alternative fasttext + +%files %{python_files} +%doc README.md docs/ +%license LICENSE +# fasttext.pc.in +%python_alternative %{_bindir}/fasttext +%{python_sitearch}/fasttext +%{python_sitearch}/fasttext-%{version}*-info +%{python_sitearch}/fasttext_pybind.*.so + +%changelog