From 8c07abca2764efc252533055c90029db8a9c1c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 22 Mar 2016 17:11:42 +0100 Subject: [PATCH] Added tuned icon and desktop file for GUI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Icon provided by Mariia Leonova . Signed-off-by: Jaroslav Škarvada --- AUTHORS | 3 ++ Makefile | 23 ++++++--- README | 7 +++ icons/tuned.svg | 125 ++++++++++++++++++++++++++++++++++++++++++++++ tuned-gui.desktop | 11 ++++ tuned.spec | 24 ++++++++- 6 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 icons/tuned.svg create mode 100644 tuned-gui.desktop diff --git a/AUTHORS b/AUTHORS index 7ba66100..6a0059bd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,3 +15,6 @@ Other contributors: - Jarod Wilson - Jan Hutař - Arnaldo Carvalho de Melo - perf code for plugin_scheduler + +Icon: +- Mariia Leonova diff --git a/Makefile b/Makefile index 056e53e8..40c5936d 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,11 @@ UNITDIR = $(shell rpm --eval '%{_unitdir}' 2>/dev/null || echo /usr/lib/systemd/ TMPFILESDIR = $(shell rpm --eval '%{_tmpfilesdir}' 2>/dev/null || echo /usr/lib/tmpfiles.d) VERSIONED_NAME = $(NAME)-$(VERSION)$(GIT_PSUFFIX) -DOCDIR = /usr/share/doc/$(NAME) +DATADIR = /usr/share +DOCDIR = $(DATADIR)/doc/$(NAME) PYTHON_SITELIB = $(shell python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib();' || echo /usr/lib/python2.7/site-packages) TUNED_PROFILESDIR = /usr/lib/tuned -BASH_COMPLETIONS = /usr/share/bash-completion/completions +BASH_COMPLETIONS = $(DATADIR)/bash-completion/completions release-dir: mkdir -p $(VERSIONED_NAME) @@ -37,8 +38,9 @@ release-cp: release-dir cp -a tuned.py tuned.spec tuned.service tuned.tmpfiles Makefile tuned-adm.py \ tuned-adm.bash dbus.conf recommend.conf tuned-main.conf 00_tuned \ bootcmdline org.tuned.gui.policy tuned-gui.py tuned-gui.glade \ + tuned-gui.desktop $(VERSIONED_NAME) + cp -a doc experiments libexec man profiles systemtap tuned contrib icons \ $(VERSIONED_NAME) - cp -a doc experiments libexec man profiles systemtap tuned contrib $(VERSIONED_NAME) archive: clean release-cp tar cjf $(VERSIONED_NAME).tar.bz2 $(VERSIONED_NAME) @@ -105,7 +107,7 @@ install: install-dirs install -Dpm 0755 $(file) $(DESTDIR)/usr/sbin/$(notdir $(file));) # glade - install -Dpm 0755 tuned-gui.glade $(DESTDIR)/usr/share/tuned/ui/tuned-gui.glade + install -Dpm 0755 tuned-gui.glade $(DESTDIR)$(DATADIR)/tuned/ui/tuned-gui.glade # tools install -Dpm 0755 experiments/powertop2tuned.py $(DESTDIR)/usr/bin/powertop2tuned @@ -142,20 +144,27 @@ install: install-dirs install -Dpm 0755 00_tuned $(DESTDIR)/etc/grub.d/00_tuned # polkit configuration - install -Dpm 0644 org.tuned.gui.policy $(DESTDIR)/usr/share/polkit-1/actions/org.tuned.gui.policy + install -Dpm 0644 org.tuned.gui.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/org.tuned.gui.policy # manual pages $(foreach man_section, 5 7 8, $(foreach file, $(wildcard man/*.$(man_section)), \ - install -Dpm 0644 $(file) $(DESTDIR)/usr/share/man/man$(man_section)/$(notdir $(file));)) + install -Dpm 0644 $(file) $(DESTDIR)$(DATADIR)/man/man$(man_section)/$(notdir $(file));)) # documentation cp -a doc/* $(DESTDIR)$(DOCDIR) cp AUTHORS COPYING README $(DESTDIR)$(DOCDIR) - # Install libexec scripts + # libexec scripts $(foreach file, $(wildcard libexec/*), \ install -Dpm 0755 $(file) $(DESTDIR)/usr/libexec/tuned/$(notdir $(file));) + # icon + install -Dpm 0644 icons/tuned.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/tuned.svg + + # desktop file + install -dD $(DESTDIR)$(DATADIR)/applications + desktop-file-install --dir=$(DESTDIR)$(DATADIR)/applications tuned-gui.desktop + clean: find -name "*.pyc" | xargs rm -f rm -rf $(VERSIONED_NAME) rpm-build-dir diff --git a/README b/README index 8e3e446f..c80712e7 100644 --- a/README +++ b/README @@ -93,3 +93,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Full text of the license is enclosed in COPYING file. + + +The icon: + +The Tuned icon was created by Mariia Leonova and it is +licensed under Creative Commons Attribution-ShareAlike 3.0 license +(http://creativecommons.org/licenses/by-sa/3.0/legalcode). diff --git a/icons/tuned.svg b/icons/tuned.svg new file mode 100644 index 00000000..9286631c --- /dev/null +++ b/icons/tuned.svg @@ -0,0 +1,125 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/tuned-gui.desktop b/tuned-gui.desktop new file mode 100644 index 00000000..f64869d2 --- /dev/null +++ b/tuned-gui.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=tuned-gui +GenericName=tuned-gui +Comment=GTK GUI that can control Tuned daemon and provides simple profile editor +Exec=pkexec /usr/sbin/tuned-gui +Icon=tuned +Terminal=false +Type=Application +Categories=System; +Version=1.0 diff --git a/tuned.spec b/tuned.spec index 2d69d988..3c6c78e5 100644 --- a/tuned.spec +++ b/tuned.spec @@ -16,7 +16,7 @@ License: GPLv2+ Source: https://fedorahosted.org/releases/t/u/tuned/tuned-%{version}.tar.bz2 URL: https://fedorahosted.org/tuned/ BuildArch: noarch -BuildRequires: python, systemd +BuildRequires: python, systemd, desktop-file-utils Requires(post): systemd, virt-what Requires(preun): systemd Requires(postun): systemd @@ -45,7 +45,7 @@ Requires: %{name} = %{version}-%{release} Requires: powertop, pygobject3-base, polkit %description gtk -GTK GUI that can control tuned and provide simple profile editor. +GTK GUI that can control tuned and provides simple profile editor. %package utils Requires: %{name} = %{version}-%{release} @@ -144,6 +144,9 @@ rmdir %{buildroot}%{_sysconfdir}/grub.d mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d touch %{buildroot}%{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf +# validate desktop file +desktop-file-validate %{buildroot}%{_datadir}/applications/tuned-gui.desktop + %post %systemd_post tuned.service @@ -189,6 +192,21 @@ if [ -d %{_sysconfdir}/grub.d ]; then fi +%post gtk +/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : + + +%postun gtk +if [ $1 -eq 0 ] ; then + /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null + /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || : +fi + + +%posttrans gtk +/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || : + + %files %defattr(-,root,root,-) %exclude %{docdir}/README.utils @@ -239,6 +257,8 @@ fi %{python_sitelib}/tuned/gtk %{_datadir}/tuned/ui %{_datadir}/polkit-1/actions/org.tuned.gui.policy +%{_datadir}/icons/hicolor/scalable/apps/tuned.svg +%{_datadir}/applications/tuned-gui.desktop %files utils %doc COPYING