summaryrefslogtreecommitdiffstats
path: root/kapow.spec
blob: 5e15b65b6b9e1b1af72f33019dd1b2c1686f8614 (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Name:           kapow
Version:        1.4.4.2
Release:        3%{?dist}
Summary:        A punch clock program

License:        GPLv3+
URL:            http://gottcode.org/%{name}

Source0:        http://gottcode.org/%{name}/%{name}-%{version}.tar.gz

# Pull request: https://github.com/gottcode/kapow/pull/33
Source1:        %{name}.appdata.xml

BuildRequires:  qt5-qtbase-devel desktop-file-utils
Requires:       hicolor-icon-theme

%description
Kapow is a punch clock program designed to easily keep track of your hours,
whether you're working on one project or many. Simply clock in and out with the
Start/Stop button. If you make a mistake in your hours, you can go back and
edit any of the entries by double-clicking on the session in question. Kapow
also allows you to easily keep track of the hours since you last billed a
client, by providing a helpful "Billed" check box--the totals will reflect your
work after the last billed session. 

%prep
%setup -q

# Request qmake to not strip the binary
sed -i.backup '/QT += network/ a\
QMAKE_STRIP = echo' %{name}.pro

%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{__global_ldflags}"

qmake-qt5 %{name}.pro PREFIX=%{_prefix}
make %{?_smp_mflags}

%install
make install INSTALL_ROOT=%{buildroot} 

mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata/
cp -v %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/appdata/

%find_lang %{name} --with-qt

%check
desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop

%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :

%files -f %{name}.lang
%doc COPYING CREDITS ChangeLog README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop

%dir %{_datadir}/appdata/
%{_datadir}/appdata/%{name}.appdata.xml

%{_datadir}/icons/hicolor/*/apps/%{name}.*

%{_datadir}/pixmaps/%{name}.xpm

# Find lang doesn't find these two files, so I place them manually
%{_datadir}/%{name}/translations/qt_it.qm
%{_datadir}/%{name}/translations/qt_nl.qm
%dir %{_datadir}/%{name}/
%dir %{_datadir}/%{name}/translations

%changelog
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun May 25 2014 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.4.4.2-1
- Update to new upstream release

* Mon Nov 11 2013 Rex Dieter <rdieter@fedoraproject.org> 1.4.4.1-2
- rebuild (qt5 qreal/arm)

* Tue Oct 22 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.4.4.1-1
- Correct directory ownership
- Correct ld flags
- https://bugzilla.redhat.com/show_bug.cgi?id=979767#c8

* Mon Oct 21 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.4.4.1-1
- Update as per https://bugzilla.redhat.com/show_bug.cgi?id=979767#c6
- Remove comments 
- Own datadir/name directory
- Own icon directories
- Add an appdata file

* Sun Jun 30 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.4.4.1-1
- Initial build
- Cosmetic changes #979767