File takeabreak.spec of Package takeabreak
#
# spec file for package takeabreak
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: takeabreak
Version: 0.5.3
Release: 0
Summary: Set breaks from working at the computer
License: GPL-2.0
Group: Productivity/Office/Other
Url: https://launchpad.net/takeabreak
Source: http://ppa.launchpad.net/vlijm/%{name}/ubuntu/pool/main/t/%{name}/%{name}_%{version}.orig.tar.gz
# PATCH-FIX-OPENSUSE takeabreak-fix-desktop.patch sor.alexei@meowr.ru
Patch0: %{name}-fix-desktop.patch
# PATCH-FEATURE-OPENSUSE takeabreak-locker-dbus.patch sor.alexei@meowr.ru -- Use D-Bus methods for screenlocking.
Patch1: %{name}-locker-dbus.patch
BuildRequires: gobject-introspection-devel
BuildRequires: hicolor-icon-theme
BuildRequires: update-desktop-files
Requires: libnotify-tools
Requires: python3
Requires: python3-gobject
Requires: wmctrl
Requires: xprintidle
Requires: xrandr
BuildArch: noarch
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
Requires: python3-gobject-Gdk
%endif
%description
The application divides time in two sections: up-time and
break-time. After the up-time has passed, the computer switches to
another state (either screen upside-down, dimmed, screensaver, etc).
%prep
%setup -q
%patch0 -p1
%patch1 -p1
find . -type f | while read f; do
sed -i 's|/opt/%{name}|%{_datadir}/%{name}|g' "$f"
done
cat << EOF > %{name}.sh
#!/bin/sh
cd "%{_datadir}/%{name}/%{name}/"
exec ./%{name} "\$%{nil}@"
EOF
%build
# Nothing to build.
%install
mkdir -p %{buildroot}%{_datadir}/%{name}/{docs,icon}/
install -Dm 0755 %{name}.sh %{buildroot}%{_bindir}/%{name}
install -Dm 0755 code/%{name} %{buildroot}%{_libexecdir}/%{name}/%{name}
install -Dm 0755 code/%{name}_run %{buildroot}%{_libexecdir}/%{name}/%{name}_run
install -Dm 0755 code/message_window %{buildroot}%{_libexecdir}/%{name}/message_window
install -Dm 0644 miscellaneous/extras-%{name}.desktop \
%{buildroot}%{_datadir}/applications/%{name}.desktop
install -Dm 0644 icon/break_64.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
install -Dm 0644 manpages/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -Dm 0644 docs/about %{buildroot}%{_docdir}/%{name}/README
ln -s %{_libexecdir}/%{name}/ %{buildroot}%{_datadir}/%{name}/%{name}
ln -s %{_datadir}/icons/hicolor/64x64/apps/%{name}.png %{buildroot}%{_datadir}/%{name}/icon/break_64.png
ln -s %{_docdir}/%{name}/README %{buildroot}%{_datadir}/%{name}/docs/about
%suse_update_desktop_file %{name}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root)
%doc %{_docdir}/%{name}/
%{_bindir}/%{name}
%{_libexecdir}/%{name}/
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_mandir}/man1/%{name}.1%{?ext_man}
%changelog