15
0
forked from pool/python-crcmod

Accepting request 1139637 from devel:languages:python

- Switch to autosetup and pyproject macros.
- Add patch use-setuptools.patch:
  * Switch to setuptools to build, rather than distutils.
- Stop using greedy globs in %files.

OBS-URL: https://build.opensuse.org/request/show/1139637
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-crcmod?expand=0&rev=7
This commit is contained in:
2024-01-18 20:53:41 +00:00
committed by Git OBS Bridge
3 changed files with 32 additions and 7 deletions

View File

@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Jan 18 08:02:47 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to autosetup and pyproject macros.
- Add patch use-setuptools.patch:
* Switch to setuptools to build, rather than distutils.
- Stop using greedy globs in %files.
-------------------------------------------------------------------
Wed Sep 28 12:52:24 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-crcmod
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,16 +16,18 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-crcmod
Version: 1.7
Release: 0
Summary: CRC Generator
License: MIT
Group: Development/Languages/Python
URL: https://crcmod.sourceforge.net/
Source: https://files.pythonhosted.org/packages/source/c/crcmod/crcmod-%{version}.tar.gz
Patch0: use-setuptools.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%python_subpackages
@@ -45,18 +47,22 @@ from the Python standard library. A ``Crc`` class instance can also generate
C/C++ source code that can be used in another application.
%prep
%setup -q -n crcmod-%{version}
%autosetup -p1 -n crcmod-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}/crcmod
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -c 'import crcmod'
%files %{python_files}
%license LICENSE
%doc README changelog
%{python_sitearch}/*
%{python_sitearch}/crcmod
%{python_sitearch}/crcmod-%{version}.dist-info
%changelog

11
use-setuptools.patch Normal file
View File

@@ -0,0 +1,11 @@
Index: crcmod-1.7/setup.py
===================================================================
--- crcmod-1.7.orig/setup.py
+++ crcmod-1.7/setup.py
@@ -1,5 +1,4 @@
-from distutils.core import setup
-from distutils.extension import Extension
+from setuptools import setup, Extension
import sys,os
if sys.version_info[0] == 2: