diff --git a/Makefile b/Makefile index 00fd0c83..fe9383f1 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ NAME = tuned BUILD = release # which config to use in mock-build target MOCK_CONFIG = rhel-7-x86_64 +# Allow users to build tuned without gui +INSTALL_GUI ?= 1 # scratch-build for triggering Jenkins SCRATCH_BUILD_TARGET = rhel-7.5-candidate VERSION = $(shell awk '/^Version:/ {print $$2}' tuned.spec) @@ -74,8 +76,10 @@ 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 \ 92-tuned.install bootcmdline modules.conf com.redhat.tuned.policy \ - tuned-gui.py tuned-gui.glade tuned-ppd.py \ - tuned-gui.desktop functions compile_plugin_docs.py $(VERSIONED_NAME) + tuned-ppd.py functions compile_plugin_docs.py $(VERSIONED_NAME) + ifeq ($(INSTALL_GUI),1) + cp -a tuned-gui.py tuned-gui.glade tuned-gui.desktop $(VERSIONED_NAME) + endif cp -a doc experiments libexec man profiles systemtap tuned contrib icons \ tests $(VERSIONED_NAME) @@ -153,15 +157,19 @@ install: install-dirs # binaries $(call install_python_script,tuned.py,$(DESTDIR)$(SBINDIR)/tuned) $(call install_python_script,tuned-adm.py,$(DESTDIR)$(SBINDIR)/tuned-adm) + ifeq ($(INSTALL_GUI),1) $(call install_python_script,tuned-gui.py,$(DESTDIR)$(SBINDIR)/tuned-gui) + endif $(foreach file, diskdevstat netdevstat scomes, \ install -Dpm 0755 systemtap/$(file) $(DESTDIR)$(SBINDIR)/$(notdir $(file));) $(call install_python_script, \ systemtap/varnetload, $(DESTDIR)$(SBINDIR)/varnetload) + ifeq ($(INSTALL_GUI),1) # glade install -Dpm 0644 tuned-gui.glade $(DESTDIR)$(DATADIR)/tuned/ui/tuned-gui.glade + endif # tools $(call install_python_script, \ @@ -239,12 +247,14 @@ install: install-dirs $(call install_python_script, \ $(file), $(DESTDIR)$(LIBEXECDIR)/tuned/$(notdir $(file)))) + ifeq ($(INSTALL_GUI),1) # 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 + endif install-ppd: $(call install_python_script,tuned-ppd.py,$(DESTDIR)$(SBINDIR)/tuned-ppd) diff --git a/tuned.spec b/tuned.spec index 87c379e6..3a21d0a0 100644 --- a/tuned.spec +++ b/tuned.spec @@ -1,4 +1,5 @@ %bcond_with snapshot +%bcond_without gui %if 0%{?rhel} && 0%{?rhel} < 10 %global user_profiles_dir %{_sysconfdir}/tuned @@ -139,6 +140,7 @@ network and ATA harddisk devices are implemented. %global docdir %{_docdir}/%{name} %endif +%if %{with gui} %package gtk Summary: GTK GUI for tuned Requires: %{name} = %{version}-%{release} @@ -152,6 +154,7 @@ Requires: pygobject3-base %description gtk GTK GUI that can control tuned and provides simple profile editor. +%endif %package utils Requires: %{name} = %{version}-%{release} @@ -299,7 +302,7 @@ to TuneD from power-profiles-daemon (PPD). make html %{make_python_arg} %install -make install DESTDIR="%{buildroot}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}" \ +make install INSTALL_GUI="%{?gui}" DESTDIR="%{buildroot}" BINDIR="%{_bindir}" SBINDIR="%{_sbindir}" \ DOCDIR="%{docdir}" %{make_python_arg} \ TUNED_USER_PROFILES_DIR="%{user_profiles_dir}" \ TUNED_SYSTEM_PROFILES_DIR="%{system_profiles_dir}" @@ -324,8 +327,10 @@ mkdir -p %{buildroot}%{_var}/lib/tuned mkdir -p %{buildroot}%{_sysconfdir}/modprobe.d touch %{buildroot}%{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf +%if %{with gui} # validate desktop file desktop-file-validate %{buildroot}%{_datadir}/applications/tuned-gui.desktop +%endif # On RHEL-7 EPEL is needed, because there is no python-mock package and # python-2.7 doesn't have mock built-in @@ -526,6 +531,7 @@ fi %ghost %{_sysconfdir}/modprobe.d/kvm.rt.tuned.conf %{_prefix}/lib/kernel/install.d/92-tuned.install +%if %{with gui} %files gtk %{_sbindir}/tuned-gui %if %{with python3} @@ -536,6 +542,7 @@ fi %{_datadir}/tuned/ui %{_datadir}/icons/hicolor/scalable/apps/tuned.svg %{_datadir}/applications/tuned-gui.desktop +%endif %files utils %doc COPYING