commit:     c3b798a722bad6066258e0633d9b060e6c2d4995
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  5 00:44:01 2021 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sat Jun  5 00:44:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3b798a7

sys-apps/ppc64-diag: initial import

Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 sys-apps/ppc64-diag/Manifest                       |  1 +
 .../ppc64-diag/files/fix-systemd-unit-path.patch   | 38 +++++++++++
 sys-apps/ppc64-diag/files/opal_errd.initd          | 15 +++++
 sys-apps/ppc64-diag/files/rtas_errd.initd          | 15 +++++
 sys-apps/ppc64-diag/metadata.xml                   | 17 +++++
 sys-apps/ppc64-diag/ppc64-diag-2.7.7.ebuild        | 73 ++++++++++++++++++++++
 6 files changed, 159 insertions(+)

diff --git a/sys-apps/ppc64-diag/Manifest b/sys-apps/ppc64-diag/Manifest
new file mode 100644
index 00000000000..3938ff25173
--- /dev/null
+++ b/sys-apps/ppc64-diag/Manifest
@@ -0,0 +1 @@
+DIST ppc64-diag-2.7.7.tar.gz 423357 BLAKE2B 
b32def540811f383e401d352d17f2edce6a998a91a7b27bcab981e42469f44aaa505104ed2d2ced8a85485c0886525ff5128b36cdbad3a8eed90e8002877498c
 SHA512 
42d94214345ab8deb7bd9ee8b145052fc2f733ba13d1567dbe6592fe9306670e3cd0ab6122e515464f7050753a992061c056e009673c7f8f6e554e9eaf75c550

diff --git a/sys-apps/ppc64-diag/files/fix-systemd-unit-path.patch 
b/sys-apps/ppc64-diag/files/fix-systemd-unit-path.patch
new file mode 100644
index 00000000000..e11feca7a49
--- /dev/null
+++ b/sys-apps/ppc64-diag/files/fix-systemd-unit-path.patch
@@ -0,0 +1,38 @@
+From 60a26c23d2d385e62a006d68074ca25479e10639 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <[email protected]>
+Date: Wed, 15 Jan 2020 20:27:31 -0800
+Subject: [PATCH] fix systemd unit path
+
+---
+ scripts/Makefile.am | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/Makefile.am b/scripts/Makefile.am
+index 29dcb78..36efcfb 100644
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -16,8 +16,8 @@ install-exec-hook-scripts:
+       install -D --mode=644 $(CONFIG_FILE) $(DESTDIR)/etc/ppc64-diag
+       install -d --mode=755 $(DESTDIR)/usr/libexec/ppc64-diag/
+       install -D --mode=755 $(INIT_FILES) $(DESTDIR)/usr/libexec/ppc64-diag/
+-      install -d --mode=755 $(DESTDIR)/usr/lib/systemd/system/
+-      install -D --mode=644 $(SERVICE_SCRIPT) 
$(DESTDIR)/usr/lib/systemd/system/
++      install -d --mode=755 $(DESTDIR)/lib/systemd/system/
++      install -D --mode=644 $(SERVICE_SCRIPT) $(DESTDIR)/lib/systemd/system/
+ 
+ uninstall-hook-scripts:
+       rm -f $(DESTDIR)/etc/ppc64-diag/ppc64_diag_setup
+@@ -28,8 +28,8 @@ uninstall-hook-scripts:
+       rm -f $(DESTDIR)/etc/ppc64-diag/ppc64-diag.config
+       rm -f $(DESTDIR)/usr/libexec/ppc64-diag/rtas_errd
+       rm -f $(DESTDIR)/usr/libexec/ppc64-diag/opal_errd
+-      rm -f $(DESTDIR)/usr/lib/systemd/system/rtas_errd.service
+-      rm -f $(DESTDIR)/usr/lib/systemd/system/opal_errd.service
++      rm -f $(DESTDIR)/lib/systemd/system/rtas_errd.service
++      rm -f $(DESTDIR)/lib/systemd/system/opal_errd.service
+ 
+ INSTALL_EXEC_HOOKS += install-exec-hook-scripts
+ UNINSTALL_HOOKS += uninstall-hook-scripts
+-- 
+2.25.0
+

diff --git a/sys-apps/ppc64-diag/files/opal_errd.initd 
b/sys-apps/ppc64-diag/files/opal_errd.initd
new file mode 100644
index 00000000000..ee420f1f9ac
--- /dev/null
+++ b/sys-apps/ppc64-diag/files/opal_errd.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="opal_errd daemon"
+description="Daemon to read/parse OPAL platform error(s)/event(s)"
+command=/usr/sbin/opal_errd
+command_args="-w ${opal_errd_args}"
+command_background=true
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+       need localmount
+       use logger
+}

diff --git a/sys-apps/ppc64-diag/files/rtas_errd.initd 
b/sys-apps/ppc64-diag/files/rtas_errd.initd
new file mode 100644
index 00000000000..213f91cf002
--- /dev/null
+++ b/sys-apps/ppc64-diag/files/rtas_errd.initd
@@ -0,0 +1,15 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name="rtas_errd daemon"
+description="Daemon to read/parse RTAS platform error(s)/event(s)"
+command=/usr/sbin/rtas_errd
+command_args="${rtas_errd_args}"
+command_background=true
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+       need localmount
+       use logger
+}

diff --git a/sys-apps/ppc64-diag/metadata.xml b/sys-apps/ppc64-diag/metadata.xml
new file mode 100644
index 00000000000..2b33921f7f9
--- /dev/null
+++ b/sys-apps/ppc64-diag/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Gentoo Linux PowerPC Development</name>
+       </maintainer>
+       <use>
+               <flag name="rtas">Add support for the Run Time Abstraction 
Services (RTAS)</flag>
+       </use>
+       <longdescription lang="en">
+               Various diagnostic tools for PowerLinux.
+               These tools     capture the diagnostic events from Power 
Systems platform firmware, SES
+               enclosures and logs serviceable event. It also provides 
automated responses
+               to urgent events such as environmental conditions and 
predictive failures.
+       </longdescription>
+</pkgmetadata>

diff --git a/sys-apps/ppc64-diag/ppc64-diag-2.7.7.ebuild 
b/sys-apps/ppc64-diag/ppc64-diag-2.7.7.ebuild
new file mode 100644
index 00000000000..0f8e314c091
--- /dev/null
+++ b/sys-apps/ppc64-diag/ppc64-diag-2.7.7.ebuild
@@ -0,0 +1,73 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Diagnostic tools for PowerLinux"
+HOMEPAGE="https://github.com/power-ras/ppc64-diag";
+SRC_URI="https://github.com/power-ras/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~ppc64"
+IUSE="rtas"
+
+DEPEND="virtual/libudev:=
+       rtas? (
+               sys-libs/ncurses:0=
+               sys-libs/librtas
+               sys-libs/libservicelog
+               sys-libs/libvpd
+       )
+"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="
+       sys-devel/bison
+       sys-devel/flex
+       virtual/pkgconfig
+"
+
+PATCHES=( 
+       "${FILESDIR}"/fix-systemd-unit-path.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       econf $(use_with rtas librtas)
+       # handle ncurses[tinfo]
+       sed -e "s:-lncurses:$($(tc-getPKG_CONFIG) --libs ncurses):g" \
+               -i Makefile || die
+}
+
+src_install() {
+       default
+       newinitd "${FILESDIR}/opal_errd.initd" opal_errd
+
+       if use rtas; then
+               newinitd "${FILESDIR}/rtas_errd.initd" rtas_errd
+               keepdir /var/log/ppc64-diag/diag_disk
+       else
+               # makefile installs it unconditionally
+               rm -rf "${ED}/lib/systemd/system/rtas_errd.service" || die
+               rm -rf "${ED}/usr/lib/systemd/system/rtas_errd.service" || die
+       fi
+
+       keepdir /var/log/opal-elog
+       keepdir /var/log/dump
+}
+
+src_test() {
+       # it assumes MKTEMP created dir in /tmp, add /var to the string.
+       # /varplatform.0x01 becomes platform.0x01, just as test expects
+       # so we sed a sed expression, don't judge me
+       sed -i 's%\/tmp/%\/var\/tmp\/%' 
opal_errd/tests/test-extract_opal_dump-000 || die
+       emake check
+}

Reply via email to