summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--0001-disable-submodule.patch13
-rw-r--r--python-torchtext.spec52
-rw-r--r--sources1
4 files changed, 67 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..cd8813b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/text-0.16.2.tar.gz
diff --git a/0001-disable-submodule.patch b/0001-disable-submodule.patch
new file mode 100644
index 0000000..efebb4b
--- /dev/null
+++ b/0001-disable-submodule.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index d008cb9c9..f4d455a65 100644
+--- a/setup.py
++++ b/setup.py
+@@ -93,7 +93,7 @@ class clean(distutils.command.clean.clean):
+ shutil.rmtree(str(path), ignore_errors=True)
+
+
+-_init_submodule()
++# _init_submodule()
+ setup_info = dict(
+ # Metadata
+ name="torchtext",
diff --git a/python-torchtext.spec b/python-torchtext.spec
new file mode 100644
index 0000000..11d681e
--- /dev/null
+++ b/python-torchtext.spec
@@ -0,0 +1,52 @@
+%global pypi_name torchtext
+%global pypi_version 0.16.2
+
+Name: python-%{pypi_name}
+Version: %{pypi_version}
+Release: 1%{?dist}
+Summary: Models, data loaders and abstractions for language processing, powered by PyTorch
+
+License: BSD 3-Clause
+URL: https://github.com/pytorch/text
+Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/text-%{version}.tar.gz
+
+Patch0: 0001-disable-submodule.patch
+
+BuildRequires: cmake
+BuildRequires: ninja-build
+BuildRequires: utf8proc-devel
+BuildRequires: re2-devel
+BuildRequires: double-conversion-devel
+
+BuildRequires: python3-tqdm
+BuildRequires: python3-requests
+BuildRequires: python3-devel
+BuildRequires: python3-pytorch >= 2.1.2
+
+%description
+Models, data loaders and abstractions for language processing, powered by PyTorch
+
+%package -n python3-%{pypi_name}
+Summary: %{summary}
+
+%description -n python3-%{pypi_name}
+Models, data loaders and abstractions for language processing, powered by PyTorch
+
+%prep
+%autosetup -p1 -n text-%{pypi_version}
+
+%build
+%py3_build
+
+%install
+%py3_install
+
+%files -n python3-%{pypi_name}
+%license LICENSE
+%doc README.rst
+%{python3_sitearch}/%{pypi_name}
+%{python3_sitearch}/%{pypi_name}-*.egg-info/
+
+%changelog
+* Tue Apr 2 2024 axellance
+- add torchtext
diff --git a/sources b/sources
new file mode 100644
index 0000000..ff8bb40
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+26dfe140f6e92aa3378330f34c951cbb text-0.16.2.tar.gz