%bcond gnome %[0%{?fedora} || 0%{?rhel} <= 9] %bcond gnome45 %[0%{?fedora} || 0%{?rhel} <= 9] # Disabled due to missing dependencies. %bcond cinnamon %[0%{?fedora} || 0%{?rhel} <= 9] %bcond gnome_flashback %[0%{?fedora} || 0%{?rhel} <= 9] %bcond mate %[0%{?fedora} || 0%{?rhel} <= 9] %bcond xfce %[0%{?fedora} || 0%{?rhel} <= 9] %global app_id org.workrave.Workrave %global commit e22e52bc3d68672112454885dac9317e56273021 %global date 20260830 %{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})} Name: workrave Version: 1.12^%{date}git%{shortcommit} Release: %autorelease Summary: Program that assists in the recovery and prevention of RSI License: GPL-3.0-or-later AND LGPL-2.1-or-later URL: https://workrave.org/ Source: https://github.com/rcaelers/workrave/archive/%{commit}/%{name}-%{commit}.tar.gz Patch1: 710.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gettext BuildRequires: gcc-c++ BuildRequires: libappstream-glib BuildRequires: clang BuildRequires: clang-devel BuildRequires: cargo BuildRequires: rpcsvc-proto-devel # Base dependencies BuildRequires: boost-devel BuildRequires: python3-devel BuildRequires: python3-jinja2 # Gtk+3 interface BuildRequires: pkgconfig(glib-2.0) >= 2.56.0 BuildRequires: pkgconfig(gio-2.0) >= 2.56.0 BuildRequires: pkgconfig(gtk+-3.0) >= 3.22.0 BuildRequires: pkgconfig(glibmm-2.4) >= 2.28.0 BuildRequires: pkgconfig(gtkmm-3.0) >= 3.22.0 # Sound support BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(libpulse) >= 0.9.15 BuildRequires: pkgconfig(libpulse-mainloop-glib) >= 0.9.15 # Wayland support BuildRequires: pkgconfig(wayland-client) BuildRequires: pkgconfig(wayland-scanner) BuildRequires: wayland-protocols-devel # X11 support BuildRequires: libX11-devel BuildRequires: libXScrnSaver-devel BuildRequires: libXtst-devel # Desktop applets BuildRequires: pkgconfig(ayatana-appindicator3-0.1) BuildRequires: pkgconfig(dbusmenu-glib-0.4) BuildRequires: pkgconfig(dbusmenu-gtk3-0.4) BuildRequires: pkgconfig(gobject-introspection-1.0) %if %{with gnome_flashback} BuildRequires: pkgconfig(libgnome-panel) %endif %if %{with gnome} BuildRequires: pkgconfig(gtk4) %endif %if %{with xfce} BuildRequires: pkgconfig(libxfce4panel-2.0) >= 4.12 %endif %if %{with mate} BuildRequires: pkgconfig(libmatepanelapplet-4.0) >= 1.20.0 %endif # Logging BuildRequires: cmake(fmt) BuildRequires: cmake(spdlog) BuildRequires: sqlite-devel Requires: dbus-common Requires: hicolor-icon-theme Recommends: (%{name}-cinnamon if cinnamon) Recommends: (%{name}-gnome if gnome-shell) Recommends: (%{name}-gnome-flashback if gnome-panel) Recommends: (%{name}-mate if mate-panel) Recommends: (%{name}-xfce if xfce4-panel) Recommends: gstreamer1-plugins-base Recommends: gstreamer1-plugins-good Obsoletes: %{name}-devel < %{version}-%{release} # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} %global _description Workrave is a program that assists in the recovery and prevention of\ Repetitive Strain Injury (RSI). The program frequently alerts you to\ take micro-pauses, rest breaks and restricts you to your daily limit. %description %{_description} %package cinnamon Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Workrave applet for Cinnamon desktop %description cinnamon %{_description} This package provides an applet for the Cinnamon desktop. %package gnome Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Workrave applet for GNOME desktop %description gnome %{_description} This package provides an applet for the GNOME desktop. %package gnome-flashback Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Workrave applet for GNOME Flashback %description gnome-flashback %{_description} This package provides an applet for the GNOME Flashback panel. %package mate Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Workrave applet for MATE %description mate %{_description} This package provides an applet for the MATE panel. %package xfce Requires: %{name}%{?_isa} = %{version}-%{release} Summary: Workrave applet for Xfce %description xfce %{_description} This package provides an applet for the Xfce panel. %prep %autosetup -n %{name}-%{commit} -p1 %build %cmake \ -DWITH_GNOME_CLASSIC_PANEL:BOOL=%{?with_gnome_flashback:ON}%{!?with_gnome_flashback:OFF} \ -DWITH_GNOME45:BOOL=%{?with_gnome45:ON}%{!?with_gnome45:OFF} \ -DWITH_MATE:BOOL=%{?with_mate:ON}%{!?with_mate:OFF} \ -DWITH_XFCE4:BOOL=%{?with_xfce:ON}%{!?with_xfce:OFF} \ -DWITH_DBUS:BOOL=ON \ -DWITH_GSTREAMER:BOOL=ON \ -DWITH_PULSE:BOOL=ON \ -DWITH_DBUSMENU:BOOL=ON \ -DWITH_INDICATOR:BOOL=ON \ -DWITH_APPINDICATOR:BOOL=ON \ -DWITH_WAYLAND:BOOL=ON \ %{nil} %cmake_build %install %cmake_install # workrave does not provide a public API rm -f %{buildroot}%{_datadir}/gir-1.0/*.gir rm -f %{buildroot}%{_libdir}/*.so # indicators need to be enabled to build GIR but are not needed otherwise rm -f %{buildroot}%{_libdir}/*indicators3/7/libworkrave.so* # move autostart file mkdir -p %{buildroot}/etc/xdg/autostart/ mv %{buildroot}/usr/etc/xdg/autostart/%{app_id}.desktop %{buildroot}/etc/xdg/autostart/%{app_id}.desktop %find_lang %{name} %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{app_id}.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{app_id}.metainfo.xml %files -f %{name}.lang %doc AUTHORS COPYING NEWS README.md %{_bindir}/%{name} %{_datadir}/applications/%{app_id}.desktop %{_sysconfdir}/xdg/autostart/%{app_id}.desktop %{_datadir}/dbus-1/services/%{app_id}.service %{_datadir}/glib-2.0/schemas/org.workrave.*.xml %{_datadir}/icons/hicolor/*/apps/%{name}.* %{_datadir}/sounds/%{name}/ %{_datadir}/%{name}/ %{_metainfodir}/%{app_id}.metainfo.xml # support library for gtk3 applets %{_libdir}/girepository-1.0/Workrave-1.0.typelib %{_libdir}/libworkrave-private-1.0.so.* %files cinnamon %dir %{_datadir}/cinnamon/ %dir %{_datadir}/cinnamon/applets/ %{_datadir}/cinnamon/applets/workrave@workrave.org/ %if %{with gnome} %files gnome %{_libdir}/girepository-1.0/Workrave-2.0.typelib %{_libdir}/libworkrave-gtk4-private-1.0.so.* %dir %{_datadir}/gnome-shell/ %dir %{_datadir}/gnome-shell/extensions/ %{_datadir}/gnome-shell/extensions/workrave@workrave.org/ %endif %if %{with gnome_flashback} %files gnome-flashback %{_libdir}/gnome-panel/modules/libworkrave-applet.so %endif %if %{with xfce} %files xfce %{_libdir}/xfce4/panel/plugins/libworkrave-plugin.so %{_datadir}/xfce4/panel/plugins/workrave-xfce-applet.desktop %endif %if %{with mate} %files mate %{_libdir}/mate-applets/workrave-applet %{_datadir}/dbus-1/services/org.mate.panel.applet.WorkraveAppletFactory.service %{_datadir}/mate-panel/applets/org.workrave.WorkraveApplet.mate-panel-applet %{_datadir}/mate-panel/ui/workrave-menu.xml %endif %changelog %autochangelog