1#
2# This file and all modifications and additions to the pristine
3# package are under the same license as the package itself.
4#
5
6#define python macros for openSUSE < 112
7%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
8%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
9
10Name:           autokey
11Version:        0.94.1
12Release:        1
13License:        GPLv3
14Summary:        Desktop automation utility
15Url:            http://github.com/autokey/autokey
16Group:          System/X11/Utilities
17Source:         %{name}_%{version}.tar.gz
18BuildRequires:  python-base
19BuildRequires:  update-desktop-files
20BuildRoot:      %{_tmppath}/%{name}-%{version}-build
21%if 0%{?suse_version} > 1110
22# This works on newer version
23# on older version it dies misserably if used
24BuildArch:      noarch
25%endif
26
27%description
28AutoKey is a desktop automation utility for Linux and X11. It allows the
29automation of virtually any task by responding to typed abbreviations
30and hotkeys. It offers a full-featured GUI that makes it highly
31accessible for novices, as well as a scripting interface offering the
32full flexibility and power of the Python language.
33
34%package common
35License:        GPLv3
36Summary:        Desktop automation utility -- Common Files
37Group:          System/X11/Utilities
38Requires:       python-simplejson
39Requires:       python-pyinotify
40Requires:       python-xlib
41Requires:       wmctrl
42Recommends:       %{name}-gtk
43%py_requires
44
45%description common
46AutoKey is a desktop automation utility for Linux and X11. It allows the
47automation of virtually any task by responding to typed abbreviations
48and hotkeys. It offers a full-featured GUI that makes it highly
49accessible for novices, as well as a scripting interface offering the
50full flexibility and power of the Python language.
51
52%package gtk
53License:        GPLv3
54Summary:        Desktop automation utility -- GTK+ Interface
55Group:          System/X11/Utilities
56Requires:       %{name}-common = %{version}
57Requires:       python-gtk
58Requires:       python-gtksourceview
59Requires:       python-notify
60Requires:       zenity
61%py_requires
62
63%description gtk
64AutoKey is a desktop automation utility for Linux and X11. It allows the
65automation of virtually any task by responding to typed abbreviations
66and hotkeys. It offers a full-featured GUI that makes it highly
67accessible for novices, as well as a scripting interface offering the
68full flexibility and power of the Python language.
69
70%package qt
71License:        GPLv3
72Summary:        Desktop automation utility -- Qt Interface
73Group:          System/X11/Utilities
74Requires:       %{name}-common = %{version}
75Requires:       python-qt4
76Requires:       python-qscintilla2
77Requires:       python-notify
78%py_requires
79
80%description qt
81AutoKey is a desktop automation utility for Linux and X11. It allows the
82automation of virtually any task by responding to typed abbreviations
83and hotkeys. It offers a full-featured GUI that makes it highly
84accessible for novices, as well as a scripting interface offering the
85full flexibility and power of the Python language.
86
87%prep
88%setup -n %{name}_%{version}
89find src/lib -name "*.py" -exec sed -i '/^#!\/usr\/bin\/env python$/d' {} ";"
90
91%build
92%{__python} setup.py build
93
94%install
95%{__python} setup.py install --prefix=%{_prefix} --root=%{buildroot}
96%suse_update_desktop_file autokey-gtk DesktopSettings
97
98%files common
99%defattr(-,root,root)
100%doc ACKNOWLEDGMENTS README
101%dir %{python_sitelib}/autokey
102%{python_sitelib}/autokey/*.py*
103%exclude %{python_sitelib}/autokey/gtkapp.py*
104%{python_sitelib}/%{name}-%{version}-py%{py_ver}.egg-info
105%{_datadir}/icons/hicolor/scalable/apps/autokey-status*.svg
106%{_datadir}/icons/hicolor/scalable/apps/autokey.png
107%{_datadir}/icons/Humanity/scalable/apps/*.svg
108%{_datadir}/icons/ubuntu-mono-dark/scalable/apps/*.svg
109%{_datadir}/icons/ubuntu-mono-light/scalable/apps/*.svg
110%{_bindir}/autokey-run
111%{_mandir}/man1/autokey-run.1*
112
113%files gtk
114%defattr(-,root,root)
115%{_bindir}/autokey-gtk
116%{python_sitelib}/autokey/gtkapp.py*
117%{python_sitelib}/autokey/gtkui/
118%{_datadir}/applications/autokey-gtk.desktop
119%{_datadir}/icons/hicolor/scalable/apps/autokey.svg
120%{_mandir}/man1/autokey-gtk.1*
121
122%files qt
123%defattr(-,root,root)
124%{python_sitelib}/autokey/qtapp.py*
125%{python_sitelib}/autokey/qtui/
126%{_datadir}/applications/autokey-qt.desktop
127%{_datadir}/icons/hicolor/scalable/apps/autokey.png
128%{_mandir}/man1/autokey-qt.1*
129
130%post common
131/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
132
133%postun common
134if [ $1 -eq 0 ] ; then
135    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
136    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
137fi
138
139%posttrans common
140/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
141
142%changelog
143
144
145