From 9eff96ec0635f4137400e28780dfffdfcf74deb1bda52d6d6ddaae5c20efd27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 13 Feb 2025 13:28:58 +0000 Subject: [PATCH] - Update to 0.9.11 * Cleaned up install * Unicode allowed * Compiling on additional platforms - Add Cython to BuildRequires - Adjust upstream source name in spec file - Drop 159.patch, merged upstream - Exclude C++ source and header files in %files section OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-crfsuite?expand=0&rev=13 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + 159.patch | 28 +++++++++++++++ python-crfsuite-0.9.10.tar.gz | 3 ++ python-python-crfsuite.changes | 63 +++++++++++++++++++++++++++++++++ python-python-crfsuite.spec | 64 ++++++++++++++++++++++++++++++++++ python_crfsuite-0.9.11.tar.gz | 3 ++ 7 files changed, 185 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 159.patch create mode 100644 python-crfsuite-0.9.10.tar.gz create mode 100644 python-python-crfsuite.changes create mode 100644 python-python-crfsuite.spec create mode 100644 python_crfsuite-0.9.11.tar.gz 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/159.patch b/159.patch new file mode 100644 index 0000000..00e0434 --- /dev/null +++ b/159.patch @@ -0,0 +1,28 @@ +From df2857fff3c492692ca09f31699972970042bc07 Mon Sep 17 00:00:00 2001 +From: Michael Karcher +Date: Wed, 12 Jun 2024 22:42:45 +0200 +Subject: [PATCH] Define _POSIX_C_SOURCE for crfsuite source files + +gcc-14 has "-Werror=implicit-function-declaration" enabled by default. +crfsuite uses posix_memalign which only gets defined when _POSIX_C_SOURCE is +defined, so make sure the flag is set when compiling crfsuite. + +On the other hand, openSUSE Tumbleweed has _POSIX_C_SOURCE defined +in pyconfig.h, so you must not add "-D_POSIX_C_SOURCE" when compiling +the python binding source code. So add it only for the subdir crfsuite. +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index 8036363..f0dc370 100755 +--- a/setup.py ++++ b/setup.py +@@ -30,6 +30,7 @@ def build_extensions(self): + _compile = c._compile + + def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts): ++ cc_args = cc_args + ['-D_POSIX_C_SOURCE=200112L'] if src.startswith('crfsuite/') else cc_args + cc_args = cc_args + ['-std=c99'] if src.endswith('.c') else cc_args + return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts) + diff --git a/python-crfsuite-0.9.10.tar.gz b/python-crfsuite-0.9.10.tar.gz new file mode 100644 index 0000000..1f43ac2 --- /dev/null +++ b/python-crfsuite-0.9.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f38524631e2b533341f10f2c77689270dc6ecd5985495dccf7aa37b1045bc2e5 +size 478262 diff --git a/python-python-crfsuite.changes b/python-python-crfsuite.changes new file mode 100644 index 0000000..3490eb1 --- /dev/null +++ b/python-python-crfsuite.changes @@ -0,0 +1,63 @@ +------------------------------------------------------------------- +Wed Feb 12 15:21:50 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 0.9.11 + * Cleaned up install + * Unicode allowed + * Compiling on additional platforms +- Add Cython to BuildRequires +- Adjust upstream source name in spec file +- Drop 159.patch, merged upstream +- Exclude C++ source and header files in %files section + +------------------------------------------------------------------- +Wed Jun 12 21:37:57 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix build with GCC 14 + * https://github.com/scrapinghub/python-crfsuite/pull/159.patch + +------------------------------------------------------------------- +Tue Dec 26 20:26:15 UTC 2023 - Dirk Müller + +- update to 0.9.10: + * Add support for python 3.12 and drop python 2.7 support + +------------------------------------------------------------------- +Tue Feb 21 10:27:13 UTC 2023 - Daniel Garcia + +- Delete rebuild-extension.patch +- Update to 0.9.9 + * Support for CPython 3.11 +- 0.9.8 + * Support for 3.10 added + +------------------------------------------------------------------- +Mon Feb 21 02:48:48 UTC 2022 - Steve Kowalik + +- Add patch rebuild-extension.patch: + * Included sources now regenerated with a new version of Cython to + fix the build for Python 3.10. + +------------------------------------------------------------------- +Fri Mar 20 14:18:38 UTC 2020 - pgajdos@suse.com + +- version update to 0.9.7 + * Python 3.4 is no longer supported (it may work, but CI is disabled) + * Python 3.8 support + * fixed installation issues on OS X (thanks @kvinwang) + * make it easier for distributions to have a reproducible build + (thanks @bmwiedemann) + +------------------------------------------------------------------- +Sat Feb 9 15:45:10 UTC 2019 - John Vandenberg + +- Update to v0.9.6 + + Python 3.7 support + + new Tagger.open_inmemory method which allows to load tagger + data without having a file on-disk +- Add %license + +------------------------------------------------------------------- +Tue Nov 7 18:25:24 UTC 2017 - toddrme2178@gmail.com + +- initial version for v0.9.5 diff --git a/python-python-crfsuite.spec b/python-python-crfsuite.spec new file mode 100644 index 0000000..2e19f03 --- /dev/null +++ b/python-python-crfsuite.spec @@ -0,0 +1,64 @@ +# +# spec file for package python-python-crfsuite +# +# Copyright (c) 2025 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/ +# + + +%{?sle15_python_module_pythons} +Name: python-python-crfsuite +Version: 0.9.11 +Release: 0 +Summary: Python binding for CRFsuite +License: MIT +Group: Development/Languages/Python +URL: https://github.com/scrapinghub/python-crfsuite +Source: https://files.pythonhosted.org/packages/source/p/python_crfsuite/python_crfsuite-%{version}.tar.gz +BuildRequires: %{python_module Cython} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: c++_compiler +BuildRequires: fdupes +BuildRequires: python-rpm-macros +%python_subpackages + +%description +Python-crfsuite is a python binding to CRFsuite_. + +%prep +%autosetup -p1 -n python_crfsuite-%{version} + +%build +export CFLAGS="%{optflags}" +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +mv pycrfsuite bak +%pytest_arch +mv bak pycrfsuite + +%files %{python_files} +%license LICENSE.txt +%doc CHANGES.rst README.rst +%{python_sitearch}/pycrfsuite +%exclude %{python_sitearch}/pycrfsuite/*.cpp +%exclude %{python_sitearch}/pycrfsuite/*.hpp +%{python_sitearch}/python_crfsuite-%{version}*-info + +%changelog diff --git a/python_crfsuite-0.9.11.tar.gz b/python_crfsuite-0.9.11.tar.gz new file mode 100644 index 0000000..5825118 --- /dev/null +++ b/python_crfsuite-0.9.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6eff965ca70567396d822c9a35ea74b0f7edb27d9471524997bdabe7a6da5f5a +size 477721