Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: pretty up update-services standard path #39

Merged
merged 3 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ RUN dnf install --disablerepo='*' --enablerepo='fedora,updates' --setopt install
ADD https://gitlab.com/jntesteves/game-devices-udev/-/archive/main/game-devices-udev-main.tar.gz /tmp/ublue-os/rpmbuild/SOURCES/game-devices-udev.tar.gz

ADD files/etc/udev/rules.d /tmp/ublue-os-udev-rules/etc/udev/rules.d
ADD files/usr/lib/systemd /tmp/ublue-os-update-services/usr/lib/systemd
ADD files/etc/rpm-ostreed.conf /tmp/ublue-os-update-services/etc/rpm-ostreed.conf
ADD files/usr/lib/systemd /tmp/ublue-os/update-services/usr/lib/systemd
ADD files/etc/rpm-ostreed.conf /tmp/ublue-os/update-services/etc/rpm-ostreed.conf

RUN tar cf /tmp/ublue-os/rpmbuild/SOURCES/ublue-os-udev-rules.tar.gz -C /tmp ublue-os-udev-rules
RUN tar cf /tmp/ublue-os/rpmbuild/SOURCES/ublue-os-update-services.tar.gz -C /tmp ublue-os-update-services
RUN tar cf /tmp/ublue-os/rpmbuild/SOURCES/ublue-os-update-services.tar.gz -C /tmp ublue-os/update-services

ADD rpmspec/*.spec /tmp/ublue-os

Expand Down
28 changes: 17 additions & 11 deletions rpmspec/ublue-os-update-services.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: ublue-os-update-services
Packager: ublue-os
Vendor: ublue-os
Version: 0.3
Version: 0.4
Release: 1%{?dist}
Summary: Automatic updates for rpm-ostree and flatpak
License: MIT
Expand All @@ -12,6 +12,8 @@ Supplements: rpm-ostree flatpak

Source0: ublue-os-update-services.tar.gz

%global sub_name %{lua:t=string.gsub(rpm.expand("%{NAME}"), "^ublue%-os%-", ""); print(t)}

%description
Adds systemd units and configuration files for enabling automatic updates in rpm-ostree and flatpak

Expand All @@ -22,11 +24,12 @@ Adds systemd units and configuration files for enabling automatic updates in rpm

mkdir -p -m0755 %{buildroot}%{_datadir}/%{VENDOR}

tar xf %{SOURCE0} -C %{buildroot}%{_datadir}/%{VENDOR}
tar xf %{SOURCE0} -C %{buildroot}%{_datadir}/%{VENDOR} --strip-components=1

# rpm-ostreed.conf cannot be installed in /etc as it'd conflict with upstream
# rpm-ostree package
tar xf %{SOURCE0} -C %{buildroot} --strip-components=1 --exclude etc/rpm-ostreed.conf
tar xf %{SOURCE0} -C %{buildroot} --strip-components=2 --exclude etc/rpm-ostreed.conf


%post
%systemd_post flatpak-system-update.timer
Expand All @@ -39,14 +42,14 @@ tar xf %{SOURCE0} -C %{buildroot} --strip-components=1 --exclude etc/rpm-ostreed


%files
%dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{NAME}
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/system-preset/10-flatpak-system-update.preset
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/system/flatpak-system-update.service
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/system/flatpak-system-update.timer
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/user-preset/10-flatpak-user-update.preset
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/user/flatpak-user-update.service
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_exec_prefix}/lib/systemd/user/flatpak-user-update.timer
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{NAME}/%{_sysconfdir}/rpm-ostreed.conf
%dir %attr(0755,root,root) %{_datadir}/%{VENDOR}/%{sub_name}
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/system-preset/10-flatpak-system-update.preset
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/system/flatpak-system-update.service
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/system/flatpak-system-update.timer
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/user-preset/10-flatpak-user-update.preset
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/user/flatpak-user-update.service
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_exec_prefix}/lib/systemd/user/flatpak-user-update.timer
%attr(0644,root,root) %{_datadir}/%{VENDOR}/%{sub_name}/%{_sysconfdir}/rpm-ostreed.conf
%attr(0644,root,root) %{_exec_prefix}/lib/systemd/system-preset/10-flatpak-system-update.preset
%attr(0644,root,root) %{_exec_prefix}/lib/systemd/system/flatpak-system-update.service
%attr(0644,root,root) %{_exec_prefix}/lib/systemd/system/flatpak-system-update.timer
Expand All @@ -56,6 +59,9 @@ tar xf %{SOURCE0} -C %{buildroot} --strip-components=1 --exclude etc/rpm-ostreed


%changelog
* Fri May 12 2023 Benjamin Sherman <benjamin@holyarmy.org> - 0.4
- Refactor directory structure

* Fri Mar 03 2023 Joshua Stone <joshua.gage.stone@gmail.com> - 0.3
- Enable timers for flatpak update services

Expand Down