Skip to content

Commit

Permalink
Split the rpm package
Browse files Browse the repository at this point in the history
  • Loading branch information
LecrisUT committed Oct 2, 2024
1 parent 6a1e371 commit f0b7a87
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
File renamed without changes.
24 changes: 16 additions & 8 deletions .distro/python-cython-cmake.spec → .distro/cython-cmake.spec
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Main package is arched in order to run tests on all arches
%global debug_package %{nil}

Name: python-cython-cmake
Name: cython-cmake
Version: 0.0.0
Release: %autorelease
Summary: CMake helpers for building Cython modules

License: Apache-2.0
URL: https://github.com/scikit-build/cython-cmake
Source: %{pypi_source cython_cmake}
BuildArch: noarch

BuildRequires: python3-devel
BuildRequires: tomcli
# Testing dependences
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: g++
Requires: cmake
Requires: python3-devel
Requires: python3dist(cython)

%global _description %{expand:
This provides helpers for using Cython. Use
Expand All @@ -27,9 +29,7 @@ include(UseCython)

%package -n python3-cython-cmake
Summary: %{summary}
Requires: cmake
Requires: python3-devel
BuildArch: noarch
Requires: cython-cmake = %{version}-%{release}
%description -n python3-cython-cmake %_description


Expand All @@ -48,16 +48,24 @@ BuildArch: noarch
%install
%pyproject_install
%pyproject_save_files -l cython_cmake
# Move the actual CMake modules to /usr/share/cmake
mkdir -p %{buildroot}%{_datadir}/cmake/Modules
mv %{buildroot}%{python3_sitelib}/cython_cmake/cmake/*.cmake %{buildroot}%{_datadir}/cmake/Modules/
ln -rs %{buildroot}%{_datadir}/cmake/Modules/*.cmake %{buildroot}%{python3_sitelib}/cython_cmake/cmake/


%check
%pyproject_check_import
%pytest


%files -n python3-cython-cmake -f %{pyproject_files}
%files
%{_datadir}/cmake/Modules/*.cmake
%license LICENSE
%doc README.md

%files -n python3-cython-cmake -f %{pyproject_files}


%changelog
%autochangelog
4 changes: 2 additions & 2 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ files_to_sync:
- .packit.yaml

upstream_package_name: cython-cmake
specfile_path: .distro/python-cython-cmake.spec
downstream_package_name: python-cython-cmake
specfile_path: .distro/cython-cmake.spec
downstream_package_name: cython-cmake
upstream_tag_template: v{version}

targets: &targets
Expand Down
11 changes: 10 additions & 1 deletion tests/smoke.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ tag: [ smoke ]
tier: 0
path: /

/version:
/python-version:
test: |
python3 -c "import cython_cmake; print(cython_cmake.__version__)"

/cmake-modules:
# Cannot test for FindCython because it uses `add_executable`
test: |
cat <<-EOF > test_modules.cmake
include(UseCython RESULT_VARIABLE UseCython_PATH)
message("UseCython_PATH=\${UseCython_PATH}")
EOF
cmake -P test_modules.cmake

0 comments on commit f0b7a87

Please sign in to comment.