diff --git a/Makefile b/Makefile index 6f0e9d7..980dcab 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ archive: clean cp AUTHORS COPYING INSTALL README $(VERSIONED_NAME) cp tuned.py tuned.spec tuned.service tuned.tmpfiles Makefile tuned-adm.py \ - tuned.bash dbus.conf recommend.conf tuned-main.conf $(VERSIONED_NAME) + tuned.bash dbus.conf recommend.conf tuned-main.conf 00_tuned bootcmdline \ + $(VERSIONED_NAME) cp -a doc experiments libexec man profiles systemtap tuned $(VERSIONED_NAME) tar cjf $(VERSIONED_NAME).tar.bz2 $(VERSIONED_NAME) @@ -37,60 +38,47 @@ install: cp -a tuned $(DESTDIR)$(PYTHON_SITELIB) # binaries - mkdir -p $(DESTDIR)/usr/sbin - install -m 0755 tuned.py $(DESTDIR)/usr/sbin/tuned - install -m 0755 tuned-adm.py $(DESTDIR)/usr/sbin/tuned-adm - for file in systemtap/*; do \ - install -m 0755 $$file $(DESTDIR)/usr/sbin/; \ - done + install -Dpm 0755 tuned.py $(DESTDIR)/usr/sbin/tuned + install -Dpm 0755 tuned-adm.py $(DESTDIR)/usr/sbin/tuned-adm + $(foreach file, $(wildcard systemtap/*), \ + install -Dpm 0755 $(file) $(DESTDIR)/usr/sbin/$(notdir $(file));) # tools - mkdir -p $(DESTDIR)/usr/bin - install -m 0755 experiments/powertop2tuned.py $(DESTDIR)/usr/bin/powertop2tuned + install -Dpm 0755 experiments/powertop2tuned.py $(DESTDIR)/usr/bin/powertop2tuned # configuration files - mkdir -p $(DESTDIR)/etc/tuned - install -m 0644 tuned-main.conf $(DESTDIR)/etc/tuned/tuned-main.conf + install -Dpm 0644 tuned-main.conf $(DESTDIR)/etc/tuned/tuned-main.conf # None profile in the moment, autodetection will be used echo -n > $(DESTDIR)/etc/tuned/active_profile - install -m 0644 bootcmdline $(DESTDIR)/etc/tuned/bootcmdline + install -Dpm 0644 bootcmdline $(DESTDIR)/etc/tuned/bootcmdline # profiles & system config mkdir -p $(DESTDIR)$(TUNED_PROFILESDIR) cp -a profiles/* $(DESTDIR)$(TUNED_PROFILESDIR)/ - install -m 0644 recommend.conf $(DESTDIR)$(TUNED_PROFILESDIR)/recommend.conf + install -pm 0644 recommend.conf $(DESTDIR)$(TUNED_PROFILESDIR)/recommend.conf # Install bash completion - mkdir -p $(DESTDIR)$(BASH_COMPLETIONS) - install -m 0644 tuned.bash $(DESTDIR)$(BASH_COMPLETIONS)/tuned + install -Dpm 0644 tuned.bash $(DESTDIR)$(BASH_COMPLETIONS)/tuned/tuned.bash # log dir mkdir -p $(DESTDIR)/var/log/tuned # runtime directory mkdir -p $(DESTDIR)/run/tuned - mkdir -p $(DESTDIR)$(TMPFILESDIR) - install -m 0644 tuned.tmpfiles $(DESTDIR)$(TMPFILESDIR)/tuned.conf + install -Dpm 0644 tuned.tmpfiles $(DESTDIR)$(TMPFILESDIR)/tuned.conf # systemd units - mkdir -p $(DESTDIR)$(UNITDIR) - install -m 0644 tuned.service $(DESTDIR)$(UNITDIR)/tuned.service + install -Dpm 0644 tuned.service $(DESTDIR)$(UNITDIR)/tuned.service # dbus configuration - mkdir -p $(DESTDIR)/etc/dbus-1/system.d - install -m 0644 dbus.conf $(DESTDIR)/etc/dbus-1/system.d/com.redhat.tuned.conf + install -Dpm 0644 dbus.conf $(DESTDIR)/etc/dbus-1/system.d/com.redhat.tuned.conf # grub template - mkdir -p $(DESTDIR)/etc/grub.d - install -m 0755 00_tuned $(DESTDIR)/etc/grub.d/00_tuned + install -Dpm 0755 00_tuned $(DESTDIR)/etc/grub.d/00_tuned # manual pages - for man_section in 5 7 8; do \ - mkdir -p $(DESTDIR)/usr/share/man/man$$man_section; \ - for file in man/*.$$man_section; do \ - install -m 0644 $$file $(DESTDIR)/usr/share/man/man$$man_section; \ - done; \ - done + $(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));)) # documentation mkdir -p $(DESTDIR)/usr/share/doc/$(NAME) @@ -98,10 +86,8 @@ install: cp AUTHORS COPYING README $(DESTDIR)/usr/share/doc/$(NAME) # Install libexec scripts - install -m 0755 -Dd $(DESTDIR)/usr/libexec/tuned - for file in libexec/*; do \ - install -m 0755 $$file $(DESTDIR)/usr/libexec/tuned; \ - done + $(foreach file, $(wildcard libexec/*), \ + install -Dpm 0755 $(file) $(DESTDIR)/usr/libexec/tuned/$(notdir $(file));) clean: find -name "*.pyc" | xargs rm -f @@ -111,4 +97,3 @@ test: python -m unittest discover tests .PHONY: clean archive srpm tag test - diff --git a/tuned/plugins/plugin_net.py b/tuned/plugins/plugin_net.py index ad418c7..421e029 100644 --- a/tuned/plugins/plugin_net.py +++ b/tuned/plugins/plugin_net.py @@ -2,7 +2,7 @@ import base from decorators import * import tuned.logs from tuned.utils.nettool import ethcard -from tuned utils.commands import commands +from tuned.utils.commands import commands import os import re