Skip to content

Commit

Permalink
spec: Various fixes, run tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Day <me@samcday.com>
  • Loading branch information
samcday committed Feb 6, 2025
1 parent d7dca0b commit ce47f0a
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions phrog.spec
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
%bcond_without check
%global cargo_install_lib 0
%global phosh_ver 0.44

Name: phrog
Version: 0.44.1
Release: %autorelease
Summary: Greetd-compatible greeter for mobile phones
Summary: Mobile-friendly greeter for greetd
License: GPL-3.0-only
URL: /~https://github.com/samcday/phrog
Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires: cargo-rpm-macros >= 24
BuildRequires: pkgconfig(libphosh-%{phosh_ver})

Requires: greetd >= 0.6
Requires: libphosh >= %{phosh_ver}
ExcludeArch: %{ix86}

# for dbus-launch
Requires: dbus-x11
BuildRequires: cargo-rpm-macros >= 24
# for dbus-run-session in %check
BuildRequires: dbus-daemon
# for xvfb-run in %check
BuildRequires: xorg-x11-server-Xvfb

Provides: greetd-greeter = 0.6
Provides: greetd-%{name} = %{version}
Requires: squeekboard
Requires: gnome-session
Requires: greetd
Requires: phoc

%description
%{summary}.
Phrog uses Phosh and greetd to provide a graphical login manager.

%prep
%autosetup -p1
%cargo_prep
# tests need a writable XDG_RUNTIME_DIR
mkdir -p /tmp/runtime-dir
chmod 0700 /tmp/runtime-dir

%generate_buildrequires
%cargo_generate_buildrequires
Expand All @@ -50,7 +54,14 @@ Provides: greetd-%{name} = %{version}

%if %{with check}
%check
export G_MESSAGES_DEBUG=all
export XDG_RUNTIME_DIR=/tmp/runtime-dir
cat > test.sh <<HERE
#!/bin/bash
%cargo_test
HERE
chmod +x test.sh
dbus-run-session xvfb-run -a -s -noreset phoc -S -E ./test.sh
%endif

%files
Expand Down

0 comments on commit ce47f0a

Please sign in to comment.