-
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` Signed-off-by: Cristian Le <[email protected]> * Initial Fedora packaging Signed-off-by: Cristian Le <[email protected]> * Add pure CMake tests Signed-off-by: Cristian Le <[email protected]> * Split the rpm package Signed-off-by: Cristian Le <[email protected]> * Add rpmlint exceptions Signed-off-by: Cristian Le <[email protected]> * Disable epel-10 packaging for now Signed-off-by: Cristian Le <[email protected]> --------- Signed-off-by: Cristian Le <[email protected]>
- 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,2 @@ | ||
addFilter("E: devel-dependency python3-devel") | ||
addFilter("dangling-relative-symlink .*/UseF2Py\.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,74 @@ | ||
Name: f2py-cmake | ||
Version: 0.0.0 | ||
Release: %autorelease | ||
Summary: F2Py helpers for CMake | ||
|
||
License: Apache-2.0 | ||
URL: https://github.com/scikit-build/f2py-cmake | ||
Source: %{pypi_source f2py_cmake} | ||
BuildArch: noarch | ||
|
||
BuildRequires: python3-devel | ||
BuildRequires: python3-numpy-f2py | ||
# Testing dependences | ||
BuildRequires: cmake | ||
BuildRequires: gfortran | ||
Requires: cmake | ||
Requires: python3-devel | ||
Requires: python3-numpy-f2py | ||
|
||
%global _description %{expand: | ||
This provides helpers for using F2Py. Use: | ||
|
||
include(UseF2Py) | ||
} | ||
|
||
%description %_description | ||
|
||
CMake module files. | ||
|
||
%package -n python3-f2py-cmake | ||
Summary: %{summary} | ||
Requires: f2py-cmake = %{version}-%{release} | ||
%description -n python3-f2py-cmake %_description | ||
|
||
Python package. | ||
|
||
|
||
%prep | ||
%autosetup -n f2py_cmake-%{version} | ||
|
||
|
||
%generate_buildrequires | ||
%pyproject_buildrequires -x test | ||
|
||
|
||
%build | ||
%pyproject_wheel | ||
|
||
|
||
%install | ||
%pyproject_install | ||
%pyproject_save_files -l f2py_cmake | ||
# Move the actual CMake modules to /usr/share/cmake | ||
mkdir -p %{buildroot}%{_datadir}/cmake/Modules | ||
mv %{buildroot}%{python3_sitelib}/f2py_cmake/cmake/*.cmake %{buildroot}%{_datadir}/cmake/Modules/ | ||
ln -rs %{buildroot}%{_datadir}/cmake/Modules/*.cmake %{buildroot}%{python3_sitelib}/f2py_cmake/cmake/ | ||
|
||
|
||
%check | ||
%pyproject_check_import | ||
%pytest | ||
|
||
|
||
%files | ||
%{_datadir}/cmake/Modules/*.cmake | ||
%license LICENSE | ||
%doc README.md | ||
|
||
%files -n python3-f2py-cmake -f %{pyproject_files} | ||
%{_bindir}/f2py-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,11 @@ | ||
summary: Test CMake only modules | ||
discover+: | ||
how: fmf | ||
filter: "tag: cmake" | ||
prepare: | ||
- name: Install additional test packages | ||
how: install | ||
package: | ||
- gfortran | ||
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: f2py_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 |
Empty file.
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: f2py-cmake | ||
specfile_path: .distro/f2py-cmake.spec | ||
downstream_package_name: f2py-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: Minimal f77 example |
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 @@ | ||
/: | ||
inherit: false | ||
|
||
tag: [ smoke ] | ||
tier: 0 | ||
path: / | ||
|
||
/python-version: | ||
test: | | ||
python3 -c "import f2py_cmake; print(f2py_cmake.__version__)" | ||
|
||
/cmake-modules: | ||
test: | | ||
cat <<-EOF > test_modules.cmake | ||
find_package(Python REQUIRED COMPONENTS NumPy) | ||
include(UseF2Py RESULT_VARIABLE UseF2Py_PATH) | ||
message("UseF2Py_PATH=\${UseF2Py_PATH}") | ||
EOF | ||
cmake -P test_modules.cmake | ||
adjust: | ||
enabled: false | ||
because: | | ||
Cannot test inside script-mode because targets are not propagated |
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 |