07754c5
%bcond	gnome		1
63167a9
%bcond	gnome_flashback	1
63167a9
%bcond	mate		1
63167a9
%bcond	xfce		1
63167a9
63167a9
Name:          workrave
07754c5
Version:       1.10.51.1
63167a9
Release:       %autorelease
63167a9
Summary:       Program that assists in the recovery and prevention of RSI
71a3ec0
# Based on older packages by Dag Wieers <dag@wieers.com> and Steve Ratcliffe
07754c5
License:       GPL-3.0-or-later AND LGPL-2.0-or-later
63167a9
URL:           https://workrave.org/
85113ed
%global tag %(echo %{version} | sed -e 's/\\./_/g')
63167a9
Source0:       https://github.com/rcaelers/workrave/archive/v%{tag}/%{name}-v%{tag}.tar.gz
Lukas Zapletal 7fb5a48
63167a9
Obsoletes:     %{name}-gtk2 < 1.10.37-1
63167a9
Provides:      %{name}-gtk2 = %{?epoch:%{epoch}:}%{version}-%{release}
85113ed
aaed0c4
BuildRequires: make
Lukas Zapletal 37d26f0
BuildRequires: gcc-c++
Lukas Zapletal 37d26f0
BuildRequires: libX11-devel
c70222b
BuildRequires: libXScrnSaver-devel
85113ed
BuildRequires: pkgconfig(ice)
85113ed
BuildRequires: pkgconfig(sm)
85113ed
BuildRequires: pkgconfig(glib-2.0) >= 2.28.0
85113ed
BuildRequires: pkgconfig(gio-2.0) >= 2.26.0
85113ed
BuildRequires: pkgconfig(gtk+-3.0) >= 3.0.0
85113ed
BuildRequires: pkgconfig(sigc++-2.0) >= 2.2.4.2
85113ed
BuildRequires: pkgconfig(glibmm-2.4) >= 2.28.0
85113ed
BuildRequires: pkgconfig(gtkmm-3.0) >= 3.0.0
85113ed
BuildRequires: gobject-introspection-devel >= 0.6.7
Lukas Zapletal 7fb5a48
BuildRequires: boost-devel
Lukas Zapletal 37d26f0
BuildRequires: python3
Lukas Zapletal 37d26f0
BuildRequires: python3-devel
Lukas Zapletal 37d26f0
BuildRequires: python3-cheetah
Lukas Zapletal 7fb5a48
BuildRequires: python3-jinja2
85113ed
BuildRequires: pkgconfig(gstreamer-1.0)
85113ed
BuildRequires: pkgconfig(libpulse) >= 0.9.15
85113ed
BuildRequires: pkgconfig(libpulse-mainloop-glib) >= 0.9.15
85113ed
BuildRequires: gettext
85113ed
BuildRequires: intltool
85113ed
BuildRequires: autoconf, automake, libtool, autoconf-archive
85113ed
BuildRequires: desktop-file-utils
63167a9
%if %{with gnome_flashback}
d5f0460
BuildRequires: pkgconfig(libgnome-panel)
85113ed
%endif
07754c5
%if %{with gnome}
07754c5
BuildRequires: pkgconfig(gtk4)
85113ed
%endif
63167a9
%if %{with xfce}
7929b35
BuildRequires: pkgconfig(libxfce4panel-2.0) >= 4.12
85113ed
%endif
63167a9
%if %{with mate}
85113ed
BuildRequires: pkgconfig(libmatepanelapplet-4.0)
85113ed
%endif
55c4741
07754c5
Requires:      dbus-common
07754c5
Recommends:    (%{name}-cinnamon if cinnamon)
07754c5
Recommends:    (%{name}-gnome if gnome-shell)
07754c5
Recommends:    (%{name}-gnome-flashback if gnome-panel)
07754c5
Recommends:    (%{name}-mate if mate-panel)
07754c5
Recommends:    (%{name}-xfce if xfce4-panel)
63167a9
Recommends:    gstreamer1-plugins-base
63167a9
Recommends:    gstreamer1-plugins-good
63167a9
Obsoletes:     %{name}-devel < %{version}-%{release}
71a3ec0
d2e5824
%global _description Workrave is a program that assists in the recovery and prevention of\
d2e5824
Repetitive Strain Injury (RSI). The program frequently alerts you to\
71a3ec0
take micro-pauses, rest breaks and restricts you to your daily limit.
71a3ec0
d2e5824
%description
d2e5824
%{_description}
d2e5824
07754c5
%package cinnamon
07754c5
Requires:      %{name} = %{version}-%{release}
07754c5
Summary:       Workrave applet for Cinnamon desktop
07754c5
07754c5
%description cinnamon
07754c5
%{_description}
07754c5
07754c5
This package provides an applet for the Cinnamon desktop.
07754c5
07754c5
%package gnome
07754c5
Requires:      %{name} = %{version}-%{release}
07754c5
Summary:       Workrave applet for GNOME desktop
07754c5
07754c5
%description gnome
07754c5
%{_description}
07754c5
07754c5
This package provides an applet for the GNOME desktop.
07754c5
85113ed
%package gnome-flashback
63167a9
Requires:      %{name} = %{version}-%{release}
63167a9
Summary:       Workrave applet for GNOME Flashback
85113ed
85113ed
%description gnome-flashback
d2e5824
%{_description}
85113ed
85113ed
This package provides an applet for the GNOME Flashback panel.
85113ed
85113ed
%package mate
63167a9
Requires:      %{name} = %{version}-%{release}
63167a9
Summary:       Workrave applet for MATE
85113ed
85113ed
%description mate
d2e5824
%{_description}
85113ed
85113ed
This package provides an applet for the MATE panel.
85113ed
85113ed
%package xfce
63167a9
Requires:      %{name} = %{version}-%{release}
63167a9
Summary:       Workrave applet for Xfce
85113ed
85113ed
%description xfce
d2e5824
%{_description}
85113ed
85113ed
This package provides an applet for the Xfce panel.
bc85e93
bc85e93
71a3ec0
%prep
63167a9
%autosetup -n workrave-%{tag} -p1
bc85e93
touch ChangeLog
85113ed
# https://bugzilla.redhat.com/show_bug.cgi?id=304121
85113ed
sed -i -e '/^DISTRIBUTION_HOME/s/\/$//' frontend/gtkmm/src/Makefile.*
71a3ec0
7929b35
Lukas Zapletal 37d26f0
# upstream is python2
Lukas Zapletal 7fb5a48
2to3 --write --nobackups libs/dbus/bin/dbusgen.py
ac962eb
%{__python3} %{_rpmconfigdir}/redhat/pathfix.py -pni %{__python3} libs/dbus/bin/dbusgen.py
Lukas Zapletal 37d26f0
sed -i 's/AC_CHECK_PROG(PYTHON, python, python)/AC_CHECK_PROG(PYTHON, python3, python3)/' configure.ac
Lukas Zapletal 37d26f0
71a3ec0
%build
71a3ec0
if [ ! -x configure ]; then
71a3ec0
  ### Needed for snapshot releases.
ff7a4a3
  NOCONFIGURE=1 ./autogen.sh
71a3ec0
fi
ff7a4a3
85113ed
# gnome3 is flashback panel applet, not gnome-shell
85113ed
%configure \
63167a9
%if %{with gnome_flashback}
85113ed
  --enable-gnome3 \
85113ed
%else
85113ed
  --disable-gnome3 \
85113ed
%endif
63167a9
%if %{with mate}
85113ed
  --enable-mate \
85113ed
%else
85113ed
  --disable-mate \
85113ed
%endif
63167a9
%if %{with xfce}
85113ed
  --enable-xfce \
85113ed
%else
85113ed
  --disable-xfce \
85113ed
%endif
07754c5
  --disable-indicator \
85113ed
  --disable-static --disable-xml
85113ed
63167a9
%make_build
71a3ec0
71a3ec0
%install
63167a9
%make_install
55c4741
85113ed
find %{buildroot} -name '*.la' -delete
85113ed
# workrave does not provide a public API
85113ed
rm -f %{buildroot}%{_datadir}/gir-1.0/*.gir
85113ed
rm -f %{buildroot}%{_libdir}/*.so
55c4741
71a3ec0
%find_lang %{name}
71a3ec0
63167a9
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
71a3ec0
85113ed
71a3ec0
%files -f %{name}.lang
4c38a08
%doc AUTHORS COPYING NEWS README.md
85113ed
%{_bindir}/workrave
71a3ec0
%{_datadir}/workrave/
13b53c1
%{_datadir}/sounds/workrave/
bc85e93
%{_datadir}/icons/hicolor/16x16/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/24x24/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/32x32/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/48x48/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/64x64/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/96x96/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/128x128/apps/workrave.png
bc85e93
%{_datadir}/icons/hicolor/scalable/workrave-sheep.svg
bc85e93
%{_datadir}/icons/hicolor/scalable/apps/workrave.svg
Lukas Zapletal 7fb5a48
%{_datadir}/metainfo/workrave.appdata.xml
66f62dd
%{_datadir}/applications/workrave.desktop
85113ed
%{_datadir}/dbus-1/services/org.workrave.Workrave.service
85113ed
%{_datadir}/glib-2.0/schemas/org.workrave.*.xml
85113ed
# support library for gtk3 applets
bc85e93
%{_libdir}/girepository-1.0/Workrave-1.0.typelib
bc85e93
%{_libdir}/libworkrave-private-1.0.so.*
07754c5
07754c5
%files cinnamon
85113ed
%dir %{_datadir}/cinnamon/
85113ed
%dir %{_datadir}/cinnamon/applets/
85113ed
%{_datadir}/cinnamon/applets/workrave@workrave.org/
07754c5
07754c5
%if %{with gnome}
07754c5
%files gnome
07754c5
%{_libdir}/girepository-1.0/Workrave-2.0.typelib
07754c5
%{_libdir}/libworkrave-gtk4-private-1.0.so.*
07754c5
%dir %{_datadir}/gnome-shell/
07754c5
%dir %{_datadir}/gnome-shell/extensions/
07754c5
%{_datadir}/gnome-shell/extensions/workrave@workrave.org/
07754c5
%endif
85113ed
63167a9
%if %{with gnome_flashback}
85113ed
%files gnome-flashback
d5f0460
%{_libdir}/gnome-panel/modules/libworkrave-applet.so
85113ed
%endif
85113ed
63167a9
%if %{with xfce}
85113ed
%files xfce
Lukas Zapletal 7fb5a48
%{_libdir}/xfce4/panel/plugins/libworkrave-plugin.so
ed74b12
%{_datadir}/xfce4/panel/plugins/workrave-xfce-applet.desktop
85113ed
%endif
85113ed
63167a9
%if %{with mate}
85113ed
%files mate
85113ed
%{_libdir}/mate-applets/workrave-applet
85113ed
%{_datadir}/dbus-1/services/org.mate.panel.applet.WorkraveAppletFactory.service
85113ed
%{_datadir}/mate-panel/applets/org.workrave.WorkraveApplet.mate-panel-applet
85113ed
%{_datadir}/mate-panel/ui/workrave-menu.xml
85113ed
%endif
71a3ec0
71a3ec0
%changelog
d994a23
%autochangelog