# SPDX-FileCopyrightText: Copyright 2026 Daniel Hast # # SPDX-License-Identifier: Apache-2.0 OR MIT %bcond check 0 %global proxy_dbus_name sh.brew.BrewProxy Name: brew-proxy Version: 0.1.1 Release: 1 Summary: DBus proxy to allow Homebrew commands to be run by other users License: %{shrink: ((MIT OR Apache-2.0) AND Unicode-3.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND MIT } URL: https://codeberg.org/HastD/%{name} Source: %{url}/archive/v%{version}.tar.gz BuildRequires: cargo-rpm-macros BuildRequires: systemd-rpm-macros %{?systemd_requires} %description A DBus-activated service that allows authorized users to run Homebrew commands as a dedicated `linuxbrew` user via the `brew-proxy` command. Access is managed by Polkit, and authentication is required for commands that are not read-only unless the user is in a group that grants unauthenticated access to those commands. %prep %autosetup -n %{name} %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build -- --workspace %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install # main executables install -Dp -m 755 -t %{buildroot}%{_bindir} target/rpm/brew-proxy install -Dp -m 755 -t %{buildroot}%{_libexecdir}/brew-proxy target/rpm/brew-proxy-daemon # brew-proxy setup files install -Dp -m 755 -t %{buildroot}%{_libexecdir}/brew-proxy usr/libexec/brew-proxy/*.sh # systemd units install -Dp -m 644 -t %{buildroot}%{_unitdir} usr/lib/systemd/system/* # systemd-sysusers install -Dp -m 644 -t %{buildroot}%{_sysusersdir} usr/lib/sysusers.d/brew-proxy.conf # DBus configuration install -Dp -m 644 -t %{buildroot}%{_datadir}/dbus-1/system-services usr/share/dbus-1/system-services/%{proxy_dbus_name}.service install -Dp -m 644 -t %{buildroot}%{_datadir}/dbus-1/system.d usr/share/dbus-1/system.d/%{proxy_dbus_name}.conf # Polkit configuration install -Dp -m 644 -t %{buildroot}%{_datadir}/polkit-1/actions usr/share/polkit-1/actions/%{proxy_dbus_name}.policy install -Dp -m 644 -t %{buildroot}%{_datadir}/polkit-1/rules.d usr/share/polkit-1/rules.d/%{proxy_dbus_name}.rules %if %{with check} %check %cargo_test -- --workspace %endif %post %systemd_post brew-proxy-daemon.service %systemd_post brew-proxy-setup.service %preun %systemd_preun brew-proxy-daemon.service %systemd_preun brew-proxy-setup.service %postun %systemd_postun_with_restart brew-proxy-daemon.service %systemd_postun_with_reload brew-proxy-setup.service %files %doc README.md %license LICENSES/*.txt %license LICENSE.dependencies %{_bindir}/brew-proxy %{_libexecdir}/brew-proxy %{_unitdir}/brew-proxy-daemon.service %{_unitdir}/brew-proxy-setup.service %{_sysusersdir}/brew-proxy.conf %{_datadir}/dbus-1/system-services/%{proxy_dbus_name}.service %{_datadir}/dbus-1/system.d/%{proxy_dbus_name}.conf %{_datadir}/polkit-1/actions/%{proxy_dbus_name}.policy %{_datadir}/polkit-1/rules.d/%{proxy_dbus_name}.rules %changelog * Tue Apr 07 2026 Daniel Hast - Initial RPM release