Skip to content

Commit b1d43bc

Browse files
author
Daniel K. O. (dkosmari)
committed
Added scripts for building Fedora 42 packages.
1 parent 00c6039 commit b1d43bc

File tree

6 files changed

+204
-9
lines changed

6 files changed

+204
-9
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Fedora 42 amd64 RPM package
2+
3+
on: [workflow_dispatch]
4+
5+
env:
6+
DISTRO: fedora-42
7+
8+
jobs:
9+
build-rpm:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Create docker image
19+
uses: docker/build-push-action@v6
20+
with:
21+
tags: image-${{ env.DISTRO }}
22+
context: ./packages/${{ env.DISTRO }}
23+
env:
24+
DOCKER_BUILD_SUMMARY: false
25+
DOCKER_BUILD_RECORD_UPLOAD: false
26+
27+
- name: Build RPM package
28+
uses: addnab/docker-run-action@v3
29+
with:
30+
image: image-${{ env.DISTRO }}
31+
options: --name container-${{ env.DISTRO }}
32+
run: |
33+
./build.sh
34+
35+
- name: Copy from container to host
36+
uses: tj-actions/docker-cp@v2
37+
with:
38+
container: container-${{ env.DISTRO }}
39+
source: /buildroot
40+
destination: packages/${{ env.DISTRO }}/output
41+
42+
- name: Upload
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: ${{ env.DISTRO }} packages
46+
path: packages/${{ env.DISTRO }}/output
47+
if-no-files-found: error

.github/workflows/package-mageia-9.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Mageia 9 amd64 RPM package
22

33
on: [workflow_dispatch]
44

5+
env:
6+
DISTRO: mageia-9
7+
58
jobs:
69
build-rpm:
710

@@ -12,33 +15,33 @@ jobs:
1215
- name: Checkout
1316
uses: actions/checkout@v4
1417

15-
- name: Build Docker image
18+
- name: Create docker image
1619
uses: docker/build-push-action@v6
1720
with:
18-
tags: image-mageia-9
19-
context: ./packages/mageia-9
21+
tags: image-${{ env.DISTRO }}
22+
context: ./packages/${{ env.DISTRO }}
2023
env:
2124
DOCKER_BUILD_SUMMARY: false
2225
DOCKER_BUILD_RECORD_UPLOAD: false
2326

2427
- name: Build RPM package
2528
uses: addnab/docker-run-action@v3
2629
with:
27-
image: image-mageia-9
28-
options: --name container-mageia-9
30+
image: image-${{ env.DISTRO }}
31+
options: --name container-${{ env.DISTRO }}
2932
run: |
3033
./build.sh
3134
3235
- name: Copy from container to host
3336
uses: tj-actions/docker-cp@v2
3437
with:
35-
container: container-mageia-9
38+
container: container-${{ env.DISTRO }}
3639
source: /buildroot
37-
destination: packages/mageia-9/output
40+
destination: packages/${{ env.DISTRO }}/output
3841

3942
- name: Upload
4043
uses: actions/upload-artifact@v4
4144
with:
4245
name: Mageia 9 packages
43-
path: packages/mageia-9/output
46+
path: packages/${{ env.DISTRO }}/output
4447
if-no-files-found: error

packages/fedora-42/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM fedora:42
2+
3+
# install build dependencies
4+
RUN dnf -qy group install rpm-development-tools
5+
RUN dnf -qy group install c-development
6+
RUN dnf -qy install fedora-rpm-macros
7+
RUN dnf -qy install doxygen
8+
RUN dnf -qy install libevdev-devel
9+
RUN dnf -qy install gtkmm3.0-devel
10+
11+
RUN rpmdev-setuptree
12+
WORKDIR /root/rpmbuild
13+
COPY . .
14+
15+
CMD ["/bin/bash"]
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
%define libname libevdevxx
2+
%define devname libevdevxx-devel
3+
%define staticname libevdevxx-static-devel
4+
%define toolsname evdevxx-tools
5+
6+
Name: libevdevxx
7+
Version: 0.5.2
8+
Release: 1%{?dist}
9+
Summary: A C++ wrapper for libevdev.
10+
Group: System/Libraries
11+
License: MIT
12+
URL: https://github.com/dkosmari/libevdevxx
13+
Source0: https://github.com/dkosmari/libevdevxx/releases/download/v%{version}/%{name}-%{version}.tar.gz
14+
15+
%description
16+
This is the library needed to run programs linked with %{name}.
17+
18+
BuildRequires: automake
19+
BuildRequires: libtool
20+
BuildRequires: pkgconfig(libevdev)
21+
BuildRequires: gcc-c++
22+
BuildRequires: doxygen
23+
24+
25+
#############
26+
## library ##
27+
#############
28+
29+
30+
###########
31+
## devel ##
32+
###########
33+
34+
%package -n %{devname}
35+
Summary: Development package for %{libname}.
36+
Group: Development/C++
37+
Provides: %{devname} = %{version}
38+
Requires: %{libname} = %{version}-%{release}
39+
40+
%description -n %{devname}
41+
This package provides libraries and headers files for %{name}
42+
development.
43+
44+
45+
##################
46+
## static-devel ##
47+
##################
48+
49+
%package -n %{staticname}
50+
Summary: Development package for %{libname}, with static linking.
51+
Group: Development/C++
52+
Provides: %{staticname} = %{version}
53+
54+
%description -n %{staticname}
55+
This package provides static libraries for %{name} development.
56+
57+
58+
###########
59+
## tools ##
60+
###########
61+
62+
%package -n %{toolsname}
63+
Summary: Tools from the %{name} package.
64+
Requires: %{libname} = %{version}-%{release}
65+
66+
%description -n %{toolsname}
67+
This package contains tools from %{name}:
68+
- evdevxx-query
69+
- evdevxx-read
70+
71+
72+
###########
73+
## build ##
74+
###########
75+
76+
%prep
77+
%autosetup
78+
79+
%build
80+
%configure --disable-examples --enable-docs --enable-tools
81+
%make_build
82+
83+
%install
84+
%make_install
85+
86+
87+
#####################
88+
## package library ##
89+
#####################
90+
91+
%files -n %{libname}
92+
%license COPYING
93+
%doc AUTHORS
94+
%{_libdir}/*.so.*
95+
96+
97+
###################
98+
## package devel ##
99+
###################
100+
101+
%files -n %{devname}
102+
%doc README.md
103+
%{_pkgdocdir}/html
104+
%{_includedir}/libevdevxx/*
105+
%{_libdir}/*.so
106+
%{_libdir}/pkgconfig/libevdevxx.pc
107+
108+
109+
##########################
110+
## package static-devel ##
111+
##########################
112+
113+
%files -n %{staticname}
114+
%doc README.md
115+
%{_pkgdocdir}/html
116+
%{_includedir}/libevdevxx/*
117+
%{_libdir}/*.a
118+
%{_libdir}/pkgconfig/libevdevxx.pc
119+
120+
121+
###################
122+
## package tools ##
123+
###################
124+
125+
%files -n %{toolsname}
126+
%{_bindir}/evdevxx-*

packages/fedora-42/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash -x
2+
rpmdev-spectool --directory SOURCES --get-files SPECS/libevdevxx.spec || exit 1
3+
rpmbuild -ba SPECS/libevdevxx.spec || exit 2
4+
exit 0

packages/mageia-9/SPECS/libevdevxx.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,5 @@ This package contains tools from %{name}:
129129
## package tools ##
130130
###################
131131

132-
%files -n evdevxx-tools
132+
%files -n %{toolsname}
133133
%{_bindir}/evdevxx-*

0 commit comments

Comments
 (0)