-
Notifications
You must be signed in to change notification settings - Fork 6
/
pomodoroTasks2.spec
87 lines (68 loc) · 2.68 KB
/
pomodoroTasks2.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Name: pomodoroTasks2
Version: 0.5
Release: 1%{?dist}
Summary: Graphical trayicon to pomodoro with taskwarrior/timewarrior
Group: User Interface/X
BuildArch: noarch
License: GPLv3
URL: https://github.com/liloman/pomodoroTasks2
#must be without *-1.tar.gz to build in copr ¿?
Source0: %{url}/archive/%{name}-%{version}.tar.gz
Requires: timewarrior
Requires: task
Requires: python-pip
Requires: dbus-python
Requires: python-gobject
%description
Pomodoro technique allows you to concentrate on the current task and take short breaks meanwhile works. If you join it with a task manager alike taskwarrior you can have a complete workflow, accounting the time spend on any task meanwhile you take the proper rests for your brain, body (eyes in special), and life. :)
All your work is timetracked with timewarrior so you can view what have you been working anytime easily.
%prep
%setup -q
%build
exit 0
%install
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
cp -a *.md CHANGELOG extras/technique.pdf %{buildroot}%{_defaultdocdir}/%{name}
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -a pomodoro*.py do_timeout.py images gui test extras %{buildroot}%{_datadir}/%{name}
%files
%doc %{_defaultdocdir}/*
%{_datadir}/*
%exclude %{_datadir}/%{name}/*/*.pyc
%exclude %{_datadir}/%{name}/*/*.pyo
%post
/usr/bin/pip install tasklib -q || :
#create taskwarrior/timewarrior databases if empties
#executed as $USER
for user in /home/*; do
su - ${user##*/} -c 'task <<< yes' &> /dev/null || :
su - ${user##*/} -c 'timew <<< yes' &> /dev/null || :
done
if [[ -d /usr/share/bash-completion/completions/ ]]; then
cp %{_datadir}/%{name}/extras/pomodoro-client.bash_autocompletion /usr/share/bash-completion/completions/pomodoro-client.py
fi
#Create systemd service to stop current task on sleep
cp %{_datadir}/%{name}/extras/sleep@.service /etc/systemd/system/
#install user hooks
for user in /home/*; do
su - ${user##*/} -c '%{_datadir}/%{name}/extras/prepare_hooks.sh install' &> /dev/null || :
systemctl enable sleep@${user##*/}
done
systemctl daemon-reload
#link pomodoro binaries to _bindir (/usr/bin/)
ln -sf %{_datadir}/%{name}/pomodoro-*.py %{_bindir}
#link add-reminder.sh to _bindir
ln -sf %{_datadir}/%{name}/extras/add-reminder.sh %{_bindir}
%postun
#remove python tasklib
/usr/bin/pip uninstall tasklib -qy || :
#remove symlinks
rm -f /usr/bin/pomodoro-*.py /usr/bin/add-reminder.sh || :
#remove bash autocompletion
rm -f /usr/share/bash-completion/completions/pomodoro-client.py || :
#remove user hooks
for user in /home/*; do
su - ${user##*/} -c '%{_datadir}/%{name}/extras/prepare_hooks.sh uninstall' &> /dev/null || :
systemctl stop sleep@${user##*/}
systemctl disable sleep@${user##*/}
done