diff --git a/user/python-linux-procfs/template.py b/user/python-linux-procfs/template.py new file mode 100644 index 0000000000..62c07a1c88 --- /dev/null +++ b/user/python-linux-procfs/template.py @@ -0,0 +1,20 @@ +pkgname = "python-linux-procfs" +pkgver = "0.7.3" +pkgrel = 0 +build_style = "python_pep517" +hostmakedepends = [ + "python-build", + "python-installer", + "python-setuptools", +] +depends = [ + "python-six", +] +pkgdesc = "Python bindings for the linux procfs filesystem" +maintainer = "tulilirockz " +license = "GPL-2.0-only" +url = "https://git.kernel.org/pub/scm/libs/python/python-linux-procfs/python-linux-procfs.git" +source = f"{url}/snapshot/python-linux-procfs-{pkgver}.tar.gz" +sha256 = "a8750f07f6b1a4c1cda6c50a33af9dc92a1a9c6cf538fd269c0db8d4c93d8ede" +# check: test is invalid using pytest +options = ["!check"] diff --git a/user/tuned/files/tuned b/user/tuned/files/tuned new file mode 100644 index 0000000000..9aa9cfe3a8 --- /dev/null +++ b/user/tuned/files/tuned @@ -0,0 +1,3 @@ +type = process +command = /usr/bin/tuned +depends-on = local.target diff --git a/user/tuned/files/tuned-ppd b/user/tuned/files/tuned-ppd new file mode 100644 index 0000000000..9569cd2092 --- /dev/null +++ b/user/tuned/files/tuned-ppd @@ -0,0 +1,3 @@ +type = process +command = /usr/bin/tuned-ppd +depends-on = local.target diff --git a/user/tuned/patches/bsdsed.patch b/user/tuned/patches/bsdsed.patch new file mode 100644 index 0000000000..f1d6e8a5b8 --- /dev/null +++ b/user/tuned/patches/bsdsed.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2024-09-17 17:42:29.176715156 -0300 ++++ b/Makefile 2024-09-17 17:47:13.423932661 -0300 +@@ -53,7 +53,7 @@ + BASH_COMPLETIONS = $(DATADIR)/bash-completion/completions + + copy_executable = install -Dm 0755 $(1) $(2) +-rewrite_shebang = sed -i -r -e $(SHEBANG_REWRITE_REGEX) $(1) ++rewrite_shebang = sed -i "" -r -e $(SHEBANG_REWRITE_REGEX) $(1) + restore_timestamp = touch -r $(1) $(2) + install_python_script = $(call copy_executable,$(1),$(2)) \ + && $(call rewrite_shebang,$(2)) && $(call restore_timestamp,$(1),$(2)); diff --git a/user/tuned/patches/install.patch b/user/tuned/patches/install.patch new file mode 100644 index 0000000000..f726be37d0 --- /dev/null +++ b/user/tuned/patches/install.patch @@ -0,0 +1,11 @@ +--- a/Makefile 2024-09-17 14:32:25.679368793 -0300 ++++ b/Makefile 2024-09-17 14:33:07.494989958 -0300 +@@ -165,7 +165,7 @@ + echo -n > $(DESTDIR)$(SYSCONFDIR)/tuned/profile_mode + echo -n > $(DESTDIR)$(SYSCONFDIR)/tuned/post_loaded_profile + install -Dpm 0644 bootcmdline $(DESTDIR)$(SYSCONFDIR)/tuned/bootcmdline +- install -Dpm 0644 modules.conf $(DESTDIR)$(SYSCONFDIR)/modprobe.d/tuned.conf ++ install -Dpm 0644 modules.conf $(DESTDIR)/usr/lib/modprobe.d/tuned.conf + + # profiles & system config + cp -a profiles/* $(DESTDIR)$(TUNED_PROFILES_DIR)/ diff --git a/user/tuned/patches/no-gui.patch b/user/tuned/patches/no-gui.patch new file mode 100644 index 0000000000..90fa045a8d --- /dev/null +++ b/user/tuned/patches/no-gui.patch @@ -0,0 +1,31 @@ +--- a/Makefile 2024-08-07 17:09:40.000000000 -0300 ++++ b/Makefile 2024-09-19 14:26:22.790244522 -0300 +@@ -146,15 +146,12 @@ + # binaries + $(call install_python_script,tuned.py,$(DESTDIR)/usr/sbin/tuned) + $(call install_python_script,tuned-adm.py,$(DESTDIR)/usr/sbin/tuned-adm) +- $(call install_python_script,tuned-gui.py,$(DESTDIR)/usr/sbin/tuned-gui) + + $(foreach file, diskdevstat netdevstat scomes, \ + install -Dpm 0755 systemtap/$(file) $(DESTDIR)/usr/sbin/$(notdir $(file));) + $(call install_python_script, \ + systemtap/varnetload, $(DESTDIR)/usr/sbin/varnetload) + +- # glade +- install -Dpm 0644 tuned-gui.glade $(DESTDIR)$(DATADIR)/tuned/ui/tuned-gui.glade + + # tools + $(call install_python_script, \ +@@ -221,12 +218,7 @@ + $(call install_python_script, \ + $(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 + + install-ppd: install + $(call install_python_script,tuned-ppd.py,$(DESTDIR)/usr/sbin/tuned-ppd) diff --git a/user/tuned/patches/no-systemtap.patch b/user/tuned/patches/no-systemtap.patch new file mode 100644 index 0000000000..948d69f953 --- /dev/null +++ b/user/tuned/patches/no-systemtap.patch @@ -0,0 +1,10 @@ +--- a/Makefile 2024-09-17 18:02:01.204836491 -0300 ++++ b/Makefile 2024-09-17 18:02:15.591686531 -0300 +@@ -148,8 +148,6 @@ + $(call install_python_script,tuned-adm.py,$(DESTDIR)/usr/sbin/tuned-adm) + $(call install_python_script,tuned-gui.py,$(DESTDIR)/usr/sbin/tuned-gui) + +- $(foreach file, diskdevstat netdevstat scomes, \ +- install -Dpm 0755 systemtap/$(file) $(DESTDIR)/usr/sbin/$(notdir $(file));) + $(call install_python_script, \ + systemtap/varnetload, $(DESTDIR)/usr/sbin/varnetload) diff --git a/user/tuned/patches/systemd.patch b/user/tuned/patches/systemd.patch new file mode 100644 index 0000000000..62d69fd9c6 --- /dev/null +++ b/user/tuned/patches/systemd.patch @@ -0,0 +1,20 @@ +--- a/Makefile 2024-08-07 17:09:40.000000000 -0300 ++++ a/Makefile 2024-09-19 14:25:08.566481285 -0300 +@@ -192,8 +192,6 @@ + # runtime directory + install -Dpm 0644 tuned.tmpfiles $(DESTDIR)$(TMPFILESDIR)/tuned.conf + +- # systemd units +- install -Dpm 0644 tuned.service $(DESTDIR)$(UNITDIR)/tuned.service + + # dbus configuration + install -Dpm 0644 dbus.conf $(DESTDIR)$(DATADIR)/dbus-1/system.d/com.redhat.tuned.conf +@@ -230,7 +228,6 @@ + + install-ppd: install + $(call install_python_script,tuned-ppd.py,$(DESTDIR)/usr/sbin/tuned-ppd) +- install -Dpm 0644 tuned/ppd/tuned-ppd.service $(DESTDIR)$(UNITDIR)/tuned-ppd.service + install -Dpm 0644 tuned/ppd/tuned-ppd.dbus.service $(DESTDIR)$(DATADIR)/dbus-1/system-services/net.hadess.PowerProfiles.service + install -Dpm 0644 tuned/ppd/dbus.conf $(DESTDIR)$(DATADIR)/dbus-1/system.d/net.hadess.PowerProfiles.conf + install -Dpm 0644 tuned/ppd/tuned-ppd.policy $(DESTDIR)$(DATADIR)/polkit-1/actions/net.hadess.PowerProfiles.policy + diff --git a/user/tuned/template.py b/user/tuned/template.py new file mode 100644 index 0000000000..021ff19b93 --- /dev/null +++ b/user/tuned/template.py @@ -0,0 +1,30 @@ +pkgname = "tuned" +pkgver = "2.24.0" +pkgrel = 0 +build_style = "makefile" +make_install_target = "install-ppd" +hostmakedepends = ["pkgconf", "python"] +depends = ["python-dbus", "python-linux-procfs", "virt-what"] +pkgdesc = "Daemon for monitoring and adaptive tuning of system devices" +maintainer = "tulilirockz " +license = "GPL-2.0-only" +url = "https://github.com/redhat-performance/tuned" +source = f"{url}/archive/refs/tags/v{pkgver}.tar.gz" +sha256 = "0f4a72c89772deb8a4e572df70ee3967ba33c1351096a6e87d67674f72830e0e" +# check: tests are broken due to no device binding to cbuild container +options = ["!check"] + + +def pre_install(self): + self.install_dir("usr/bin") + self.install_link("usr/sbin", "bin") + + +def post_install(self): + self.uninstall("usr/sbin") + self.install_service(self.files_path / "tuned") + self.install_service(self.files_path / "tuned-ppd") + # GUI depends on systemctl / service CLIs to interact with tuned + # these depends on systemtap + for uninstalled in ["tuned-gui", "diskdevstat", "netdevstat", "scomes"]: + self.uninstall(f"usr/share/man/man8/{uninstalled}.8") diff --git a/user/virt-what/template.py b/user/virt-what/template.py new file mode 100644 index 0000000000..a9ff8d222e --- /dev/null +++ b/user/virt-what/template.py @@ -0,0 +1,13 @@ +pkgname = "virt-what" +pkgver = "1.27" +pkgrel = 0 +build_style = "gnu_configure" +hostmakedepends = ["automake"] +pkgdesc = "Script for getting host virtual-machine context" +maintainer = "tulilirockz " +license = "GPL-2.0-only" +url = "https://people.redhat.com/~rjones/virt-what" +source = f"{url}/files/virt-what-{pkgver}.tar.gz" +sha256 = "d4d9bd9d4ae59095597443fac663495315c7eb4330b872aa5f062df38ac69bf1" +# check: tests depend on kvm kernel module (and other modules) +options = ["!check"]