Skip to content

Commit

Permalink
fix: rename Sunshine/OpenTabletDriver udev rules to avoid collissions (
Browse files Browse the repository at this point in the history
…#140)

This renames the files 70-opentabletdriver.rules and and
85-sunshine.rules to add "-ublue" before ".rules" and increment the
numbered prefix by one.

The "-ublue" ensures we'll never have a name collision which prevents
their respective official RPMs from installing.

The increment attempts to assure that the official rules will take
priority should the official RPM be installed.
  • Loading branch information
bsherman authored Oct 24, 2023
1 parent 4d0e776 commit 5a61528
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
19 changes: 13 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM registry.fedoraproject.org/fedora:latest AS builder

RUN dnf install --disablerepo='*' --enablerepo='fedora,updates' --setopt install_weak_deps=0 --nodocs --assumeyes rpm-build systemd-rpm-macros wget
RUN dnf install --disablerepo='*' --enablerepo='fedora,updates' --setopt install_weak_deps=0 --nodocs --assumeyes rpm-build systemd-rpm-macros wget jq git

ADD https://codeberg.org/fabiscafe/game-devices-udev/archive/main.tar.gz /tmp/ublue-os/rpmbuild/SOURCES/game-devices-udev.tar.gz

Expand All @@ -11,14 +11,21 @@ ADD files/etc/udev/rules.d /tmp/ublue-os/udev-rules/etc/udev/rules.d
RUN mkdir -p /tmp/OpenTabletDriver/ && \
mkdir -p /usr/etc/udev/rules.d/ && \
curl -s https://api.github.com/repos/OpenTabletDriver/OpenTabletDriver/releases/latest \
| grep "browser_download_url.*opentabletdriver-.*-x64.tar.gz" \
| cut -d : -f 2,3 \
| tr -d \" \
| jq -r '.assets | sort_by(.created_at) | .[] | select (.name|test("opentabletdriver.*tar.gz$")) | .browser_download_url' \
| wget -qi - -O /tmp/OpenTabletDriver/opentabletdriver.tar.gz && \
tar -xvzf /tmp/OpenTabletDriver/opentabletdriver.tar.gz -C /tmp/OpenTabletDriver && \
mv /tmp/OpenTabletDriver/opentabletdriver/etc/udev/rules.d/70-opentabletdriver.rules /tmp/ublue-os/udev-rules/etc/udev/rules.d/70-opentabletdriver.rules && \
tar --strip-components=1 -xvzf /tmp/OpenTabletDriver/opentabletdriver.tar.gz -C /tmp/OpenTabletDriver && \
mv /tmp/OpenTabletDriver/etc/udev/rules.d/70-opentabletdriver.rules /tmp/ublue-os/udev-rules/etc/udev/rules.d/71-opentabletdriver-ublue.rules && \
rm -rf /tmp/OpenTabletDriver

# Install Sunshin udev rules from their github repo
RUN mkdir -p /tmp/Sunshine/ && \
mkdir -p /usr/etc/udev/rules.d/ && \
pushd /tmp/Sunshine && \
git clone --depth 1 https://github.com/LizardByte/Sunshine . && \
mv /tmp/Sunshine/src_assets/linux/misc/85-sunshine.rules /tmp/ublue-os/udev-rules/etc/udev/rules.d/86-sunshine-ublue.rules && \
popd && \
rm -rf /tmp/Sunshine

ADD files/etc/rpm-ostreed.conf /tmp/ublue-os/update-services/etc/rpm-ostreed.conf
ADD files/usr/etc/systemd /tmp/ublue-os/update-services/usr/etc/systemd
ADD files/usr/lib/systemd /tmp/ublue-os/update-services/usr/lib/systemd
Expand Down
1 change: 0 additions & 1 deletion files/etc/udev/rules.d/85-sunshine.rules

This file was deleted.

5 changes: 4 additions & 1 deletion rpmspec/ublue-os-udev-rules.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: ublue-os-udev-rules
Packager: ublue-os
Vendor: ublue-os
Version: 0.6
Version: 0.7
Release: 1%{?dist}
Summary: Additional udev files for device support

Expand Down Expand Up @@ -45,6 +45,9 @@ cp %{buildroot}%{_datadir}/%{VENDOR}/{%{sub_name}/etc/udev/rules.d,game-devices-


%changelog
* Mon Oct 23 2023 Benjamin Sherman <[email protected]> - 0.7
- Rename Sunshine and OpenTabletDriver rules files to prevent filename collisions

* Fri Oct 20 2023 ArtikusHG <[email protected]> - 0.6
- Add Sunshine udev rules

Expand Down

0 comments on commit 5a61528

Please sign in to comment.