Skip to content

Commit a98c7c9

Browse files
authored
Fedora packaging (#56)
* Remove `ref-names` * Initial Fedora packaging * Add pure CMake tests * Split the rpm package * Add rpmlint exceptions * Disable epel-10 packaging for now
1 parent 894d3c5 commit a98c7c9

File tree

16 files changed

+228
-1
lines changed

16 files changed

+228
-1
lines changed

.distro/.fmf/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.distro/cython-cmake.rpmlintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
addFilter("E: devel-dependency python3-devel")
2+
addFilter("dangling-relative-symlink .*/FindCython\.cmake")
3+
addFilter("dangling-relative-symlink .*/UseCython\.cmake")

.distro/cython-cmake.spec

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Name: cython-cmake
2+
Version: 0.0.0
3+
Release: %autorelease
4+
Summary: CMake helpers for building Cython modules
5+
6+
License: Apache-2.0
7+
URL: https://github.com/scikit-build/cython-cmake
8+
Source: %{pypi_source cython_cmake}
9+
BuildArch: noarch
10+
11+
BuildRequires: python3-devel
12+
# Testing dependences
13+
BuildRequires: cmake
14+
BuildRequires: gcc
15+
BuildRequires: g++
16+
Requires: cmake
17+
Requires: python3-devel
18+
Requires: python3dist(cython)
19+
20+
%global _description %{expand:
21+
This provides helpers for using Cython. Use:
22+
23+
find_package(Cython MODULE REQUIRED VERSION 3.0)
24+
include(UseCython)
25+
}
26+
27+
%description %_description
28+
29+
CMake module files.
30+
31+
%package -n python3-cython-cmake
32+
Summary: %{summary}
33+
Requires: cython-cmake = %{version}-%{release}
34+
%description -n python3-cython-cmake %_description
35+
36+
Python package.
37+
38+
39+
%prep
40+
%autosetup -n cython_cmake-%{version}
41+
42+
43+
%generate_buildrequires
44+
%pyproject_buildrequires -x test
45+
46+
47+
%build
48+
%pyproject_wheel
49+
50+
51+
%install
52+
%pyproject_install
53+
%pyproject_save_files -l cython_cmake
54+
# Move the actual CMake modules to /usr/share/cmake
55+
mkdir -p %{buildroot}%{_datadir}/cmake/Modules
56+
mv %{buildroot}%{python3_sitelib}/cython_cmake/cmake/*.cmake %{buildroot}%{_datadir}/cmake/Modules/
57+
ln -rs %{buildroot}%{_datadir}/cmake/Modules/*.cmake %{buildroot}%{python3_sitelib}/cython_cmake/cmake/
58+
59+
60+
%check
61+
%pyproject_check_import
62+
%pytest
63+
64+
65+
%files
66+
%{_datadir}/cmake/Modules/*.cmake
67+
%license LICENSE
68+
%doc README.md
69+
70+
%files -n python3-cython-cmake -f %{pyproject_files}
71+
%{_bindir}/cython-cmake
72+
73+
74+
%changelog
75+
%autochangelog

.distro/plans/cmake.fmf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
summary: Test CMake only modules
2+
discover+:
3+
how: fmf
4+
filter: "tag: cmake"
5+
prepare:
6+
- name: Install additional test packages
7+
how: install
8+
package:
9+
- gcc
10+
- g++
11+
execute:
12+
how: tmt

.distro/plans/main.fmf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
discover:
2+
how: fmf
3+
path: .
4+
5+
adjust+:
6+
# Cannot use initiator: fedora-ci reliably yet
7+
when: initiator is not defined or initiator != packit
8+
discover+:
9+
how: fmf
10+
dist-git-source: true
11+
dist-git-extract: cython_cmake-*/

.distro/plans/rpmlint.fmf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prepare:
2+
- how: shell
3+
script: cp ./*.rpmlintrc $TMT_PLAN_DATA/
4+
discover:
5+
how: fmf
6+
filter: "tag: rpmlint"
7+
url: https://github.com/packit/tmt-plans
8+
ref: main
9+
execute:
10+
how: tmt

.distro/plans/smoke.fmf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
summary: Basic smoke tests
2+
discover+:
3+
filter: "tag: smoke"
4+
execute:
5+
how: tmt

.fmf/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.git_archival.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node: $Format:%H$
22
node-date: $Format:%cI$
33
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4-
ref-names: $Format:%D$

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,8 @@ Thumbs.db
156156
# Common editor files
157157
*~
158158
*.swp
159+
160+
# Fedora packaging
161+
*.rpm
162+
*.tar.gz
163+
!.distro/*.spec

0 commit comments

Comments
 (0)