Skip to content

Commit

Permalink
Added tuned icon and desktop file for GUI
Browse files Browse the repository at this point in the history
Icon provided by Mariia Leonova <[email protected]>.

Signed-off-by: Jaroslav Škarvada <[email protected]>
  • Loading branch information
yarda committed Mar 22, 2016
1 parent 3dd36e2 commit 8c07abc
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 9 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Other contributors:
- Jarod Wilson
- Jan Hutař
- Arnaldo Carvalho de Melo <[email protected]> - perf code for plugin_scheduler

Icon:
- Mariia Leonova <[email protected]>
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> and it is
licensed under Creative Commons Attribution-ShareAlike 3.0 license
(http://creativecommons.org/licenses/by-sa/3.0/legalcode).
125 changes: 125 additions & 0 deletions icons/tuned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tuned-gui.desktop
Original file line number Diff line number Diff line change
@@ -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
24 changes: 22 additions & 2 deletions tuned.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8c07abc

Please sign in to comment.