Skip to content

Commit eff4fe4

Browse files
committed
Add support for Fedora 36
1 parent 88a9ada commit eff4fe4

File tree

3 files changed

+136
-5
lines changed

3 files changed

+136
-5
lines changed

.github/workflows/release.yml

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,64 @@ jobs:
7878
name: debian-latest
7979
path: release
8080

81+
build-f36:
82+
name: Build Fedora 36 package
83+
runs-on: ubuntu-latest
84+
container:
85+
image: fedora:36
86+
options: --security-opt seccomp=unconfined
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v2
90+
91+
- name: Install build dependencies
92+
run: |
93+
dnf distro-sync -y
94+
dnf install -y make rpmdevtools rpm-sign 'dnf-command(builddep)'
95+
dnf builddep -y pkg/fedora/libwacom-surface.spec
96+
97+
- name: Build package
98+
run: |
99+
cd pkg/fedora
100+
101+
# Build the .rpm packages
102+
./makerpm
103+
104+
- name: Sign packages
105+
env:
106+
GPG_KEY_ID: 56C464BAAC421453
107+
GPG_KEY: ${{ secrets.SURFACE_GPG_KEY }}
108+
run: |
109+
cd pkg/fedora/out
110+
111+
# import GPG key
112+
echo "$GPG_KEY" | base64 -d | gpg --import --no-tty --batch --yes
113+
114+
# sign package
115+
cd noarch
116+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
117+
118+
cd ..
119+
120+
cd x86_64
121+
rpm --resign *.rpm --define "_gpg_name $GPG_KEY_ID"
122+
123+
- name: Prepare artifacts
124+
run: |
125+
cd pkg/fedora
126+
mkdir release
127+
128+
cp out/noarch/* release/
129+
cp out/x86_64/* release/
130+
131+
rm release/libwacom-surface-devel-*
132+
133+
- name: Upload artifacts
134+
uses: actions/upload-artifact@v1
135+
with:
136+
name: fedora-36-latest
137+
path: pkg/fedora/release
138+
81139
build-f35:
82140
name: Build Fedora 35 package
83141
runs-on: ubuntu-latest
@@ -194,14 +252,19 @@ jobs:
194252

195253
release:
196254
name: Publish release
197-
needs: [build-deb, build-f35, build-f34]
255+
needs: [build-deb, build-f36, build-f35, build-f34]
198256
runs-on: ubuntu-latest
199257
steps:
200258
- name: Download Debian artifacts
201259
uses: actions/download-artifact@v1
202260
with:
203261
name: debian-latest
204262

263+
- name: Download Fedora 36 artifacts
264+
uses: actions/download-artifact@v1
265+
with:
266+
name: fedora-36-latest
267+
205268
- name: Download Fedora 35 artifacts
206269
uses: actions/download-artifact@v1
207270
with:
@@ -272,6 +335,58 @@ jobs:
272335
git commit -m "Update Debian libwacom"
273336
git push --set-upstream origin "${update_branch}"
274337
338+
repo-f36:
339+
name: Update Fedora 36 package repository
340+
needs: [release]
341+
runs-on: ubuntu-latest
342+
container:
343+
image: fedora:36
344+
options: --security-opt seccomp=unconfined
345+
steps:
346+
- name: Install dependencies
347+
run: |
348+
dnf install -y git findutils
349+
350+
- name: Download artifacts
351+
uses: actions/download-artifact@v1
352+
with:
353+
name: fedora-36-latest
354+
355+
- name: Update repository
356+
env:
357+
SURFACEBOT_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }}
358+
BRANCH_STAGING: u/staging
359+
GIT_REF: ${{ github.ref }}
360+
run: |
361+
repo="https://surfacebot:${SURFACEBOT_TOKEN}@github.com/linux-surface/repo.git"
362+
363+
# clone package repository
364+
git clone -b "${BRANCH_STAGING}" "${repo}" repo
365+
366+
# copy packages
367+
cp fedora-36-latest/* repo/fedora/f36
368+
cd repo/fedora/f36
369+
370+
# parse git tag from ref
371+
GIT_TAG=$(echo $GIT_REF | sed 's|^refs/tags/||g')
372+
373+
# convert packages into references
374+
for pkg in $(find . -name '*.rpm'); do
375+
echo "libwacom-surface:$GIT_TAG/$(basename $pkg)" > $pkg.blob
376+
rm $pkg
377+
done
378+
379+
# set git identity
380+
git config --global user.email "[email protected]"
381+
git config --global user.name "surfacebot"
382+
383+
# commit and push
384+
update_branch="${BRANCH_STAGING}-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)"
385+
git checkout -b "${update_branch}"
386+
git add .
387+
git commit -m "Update Fedora 36 libwacom"
388+
git push --set-upstream origin "${update_branch}"
389+
275390
repo-f35:
276391
name: Update Fedora 35 package repository
277392
needs: [release]

pkg/fedora/libwacom-surface

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../patches/v1
1+
../../patches

pkg/fedora/libwacom-surface.spec

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
%global debug_package %{nil}
22

33
Name: libwacom-surface
4+
%if %{fedora} >= 36
5+
Version: 2.2.0
6+
Release: 1%{?dist}
7+
%else
48
Version: 1.12.1
59
Release: 4%{?dist}
10+
%endif
611
Summary: Tablet Information Client Library
712
Requires: %{name}-data
813
Provides: libwacom
@@ -11,7 +16,11 @@ Conflicts: libwacom
1116
License: MIT
1217
URL: https://github.com/linuxwacom/libwacom
1318

19+
%if %{fedora} >= 36
20+
Source0: https://github.com/linuxwacom/libwacom/releases/download/libwacom-%{version}/libwacom-%{version}.tar.xz
21+
%else
1422
Source0: https://github.com/linuxwacom/libwacom/releases/download/libwacom-%{version}/libwacom-%{version}.tar.bz2
23+
%endif
1524

1625
BuildRequires: meson gcc
1726
BuildRequires: glib2-devel libgudev1-devel
@@ -47,11 +56,15 @@ Tablet information client library data files.
4756

4857
%prep
4958
%autosetup -S git -n libwacom-%{version}
50-
ls -l ../
51-
ls -l ../../../
52-
for p in ../libwacom-surface/*.patch; do
59+
%if %{fedora} >= 36
60+
for p in ../libwacom-surface/v2/*.patch; do
5361
patch -p1 < "${p}"
5462
done
63+
%else
64+
for p in ../libwacom-surface/v1/*.patch; do
65+
patch -p1 < "${p}"
66+
done
67+
%endif
5568
git add . && git commit -q --author 'rpm-build <rpm-build>' -m 'libwacom-surface-%{version} base'
5669

5770
%build
@@ -97,6 +110,9 @@ install -d ${RPM_BUILD_ROOT}/%{_udevrulesdir}
97110
%{_datadir}/libwacom/layouts/*.svg
98111

99112
%changelog
113+
* Thu Apr 28 2022 Maximilian Luz <[email protected]> - 2.2.0-1
114+
- Add support for libwacom-2.x
115+
100116
* Mon Jan 17 2022 Peter Hutterer <[email protected]> - 1.12.1-1
101117
- libwacom 1.12.1
102118

0 commit comments

Comments
 (0)