Files
python-capstone/python-capstone.spec
Keke Ming 0d07c540ba add python-capstone
Signed-off-by: Keke Ming <ming.jvle@gmail.com>
2026-02-24 14:55:50 +08:00

53 lines
1.5 KiB
RPMSpec
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# SPDX-FileCopyrightText: (C) 2026 Institute of Software, Chinese Academy of Sciences (ISCAS)
# SPDX-FileCopyrightText: (C) 2026 openRuyi Project Contributors
# SPDX-FileContributor: Jvle <keke.oerv@isrc.iscas.ac.cn>
#
# SPDX-License-Identifier: MulanPSL-2.0
%global srcname capstone
Name: python-%{srcname}
Version: 5.0.3
Release: %autorelease
Summary: Python bindings for the Capstone disassembly framework
License: BSD
URL: http://www.capstone-engine.org/
#!RemoteAsset
Source0: https://files.pythonhosted.org/packages/source/c/%{srcname}/%{srcname}-%{version}.tar.gz
Patch0: add-xprint-for-tests.patch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(wheel)
Requires: capstone%{?_isa}
BuildSystem: pyproject
BuildOption(install): -l %{srcname}
Provides: python3-%{srcname}
%python_provide python3-%{srcname}
%description
Python bindings for Capstone, a lightweight multi-platform,
multi-architecture disassembly framework.
%generate_buildrequires
%pyproject_buildrequires
%check
# 过滤掉 libcapstone因为它是一个 C 库而非 Python 模块,无法直接 import
%pyproject_check_import -e "capstone.lib.libcapstone"
export PYTHONPATH=%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}
cd tests
ls -la
%{__python3} test_all.py
%files -f %{pyproject_files}
%doc README.txt
%license LICENSE.TXT
%changelog
%{?autochangelog}