-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove `ref-names` * Initial Fedora packaging * Add pure CMake tests * Split the rpm package * Add rpmlint exceptions * Disable epel-10 packaging for now
- Loading branch information
Showing
16 changed files
with
228 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
addFilter("E: devel-dependency python3-devel") | ||
addFilter("dangling-relative-symlink .*/FindCython\.cmake") | ||
addFilter("dangling-relative-symlink .*/UseCython\.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
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 | ||
# 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: | ||
|
||
find_package(Cython MODULE REQUIRED VERSION 3.0) | ||
include(UseCython) | ||
} | ||
|
||
%description %_description | ||
|
||
CMake module files. | ||
|
||
%package -n python3-cython-cmake | ||
Summary: %{summary} | ||
Requires: cython-cmake = %{version}-%{release} | ||
%description -n python3-cython-cmake %_description | ||
|
||
Python package. | ||
|
||
|
||
%prep | ||
%autosetup -n cython_cmake-%{version} | ||
|
||
|
||
%generate_buildrequires | ||
%pyproject_buildrequires -x test | ||
|
||
|
||
%build | ||
%pyproject_wheel | ||
|
||
|
||
%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 | ||
%{_datadir}/cmake/Modules/*.cmake | ||
%license LICENSE | ||
%doc README.md | ||
|
||
%files -n python3-cython-cmake -f %{pyproject_files} | ||
%{_bindir}/cython-cmake | ||
|
||
|
||
%changelog | ||
%autochangelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
summary: Test CMake only modules | ||
discover+: | ||
how: fmf | ||
filter: "tag: cmake" | ||
prepare: | ||
- name: Install additional test packages | ||
how: install | ||
package: | ||
- gcc | ||
- g++ | ||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
discover: | ||
how: fmf | ||
path: . | ||
|
||
adjust+: | ||
# Cannot use initiator: fedora-ci reliably yet | ||
when: initiator is not defined or initiator != packit | ||
discover+: | ||
how: fmf | ||
dist-git-source: true | ||
dist-git-extract: cython_cmake-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
prepare: | ||
- how: shell | ||
script: cp ./*.rpmlintrc $TMT_PLAN_DATA/ | ||
discover: | ||
how: fmf | ||
filter: "tag: rpmlint" | ||
url: https://github.com/packit/tmt-plans | ||
ref: main | ||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
summary: Basic smoke tests | ||
discover+: | ||
filter: "tag: smoke" | ||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -156,3 +156,8 @@ Thumbs.db | |
# Common editor files | ||
*~ | ||
*.swp | ||
|
||
# Fedora packaging | ||
*.rpm | ||
*.tar.gz | ||
!.distro/*.spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
files_to_sync: | ||
- src: .distro/ | ||
dest: ./ | ||
delete: true | ||
filters: | ||
- "protect .git*" | ||
- "protect sources" | ||
- "protect changelog" | ||
- "- plans/rpmlint.fmf" | ||
- .packit.yaml | ||
|
||
upstream_package_name: cython-cmake | ||
specfile_path: .distro/cython-cmake.spec | ||
downstream_package_name: cython-cmake | ||
upstream_tag_template: v{version} | ||
|
||
targets: &targets | ||
- fedora-all-x86_64 | ||
- fedora-all-aarch64 | ||
# TODO: Package for epel-10 once scikit-build-core is packaged there | ||
# - epel-10-x86_64 | ||
# - epel-10-aarch64 | ||
|
||
jobs: | ||
- &copr_build | ||
job: copr_build | ||
trigger: pull_request | ||
- &tests | ||
job: tests | ||
trigger: pull_request | ||
fmf_path: .distro | ||
- <<: *copr_build | ||
trigger: release | ||
owner: "@scikit-build" | ||
project: release | ||
- <<: *tests | ||
trigger: release | ||
- <<: *copr_build | ||
trigger: commit | ||
branch: main | ||
owner: "@scikit-build" | ||
project: nightly | ||
- <<: *tests | ||
trigger: commit | ||
branch: main | ||
- job: propose_downstream | ||
trigger: release | ||
dist_git_branches: | ||
- fedora-rawhide | ||
- job: koji_build | ||
trigger: commit | ||
dist_git_branches: | ||
- fedora-all | ||
- job: bodhi_update | ||
trigger: commit | ||
dist_git_branches: | ||
- fedora-branched |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
path: / | ||
test: ./tests/test_pure_cmake.sh | ||
framework: beakerlib | ||
tag: [ cmake ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
summary: Multiple packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
summary: Simplest project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/: | ||
inherit: false | ||
|
||
tag: [ smoke ] | ||
tier: 0 | ||
path: / | ||
|
||
/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | ||
# shellcheck disable=all | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" | ||
rlRun "root=\$(pwd)" 0 "Save the tmt root path" | ||
rlRun "pushd $tmp" | ||
rlRun "set -o pipefail" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "cmake -S $root$TMT_TEST_NAME -B ./build" 0 "Configure project" | ||
rlRun "cmake --build ./build" 0 "Build project" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $tmp" 0 "Remove tmp directory" | ||
rlPhaseEnd | ||
rlJournalEnd |