summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2020-05-27 02:45:30 +0300
committerAlexey Shvetsov <alexxy@gentoo.org>2020-05-27 02:45:47 +0300
commit042f96e8f848bc61f3a428ebe528304109e360dc (patch)
tree5e86c6fdf9eec78315633411a7d5f8c36514c588 /app-metrics/fusioninventory-agent
parentdev-go/go-md2man: restrict tests due to the use of the network (diff)
downloadgentoo-042f96e8f848bc61f3a428ebe528304109e360dc.tar.gz
gentoo-042f96e8f848bc61f3a428ebe528304109e360dc.tar.bz2
gentoo-042f96e8f848bc61f3a428ebe528304109e360dc.zip
app-metrics/fusioninventory-agent: add startup files
Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
Diffstat (limited to 'app-metrics/fusioninventory-agent')
-rw-r--r--app-metrics/fusioninventory-agent/files/fusioninventory-agent-2.5.2-dirs.patch23
-rw-r--r--app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd2
-rw-r--r--app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd21
-rw-r--r--app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild11
4 files changed, 53 insertions, 4 deletions
diff --git a/app-metrics/fusioninventory-agent/files/fusioninventory-agent-2.5.2-dirs.patch b/app-metrics/fusioninventory-agent/files/fusioninventory-agent-2.5.2-dirs.patch
new file mode 100644
index 000000000000..d4c0f4eadb0f
--- /dev/null
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent-2.5.2-dirs.patch
@@ -0,0 +1,23 @@
+--- a/Makefile.PL 2020-05-27 02:16:42.106531746 +0300
++++ b/Makefile.PL 2020-05-27 02:17:30.568531767 +0300
+@@ -170,18 +170,15 @@
+ INSTALLSCRIPT => '$(PREFIX)/bin',
+ INSTALLSITESCRIPT => '$(PREFIX)/bin',
+ INSTALLVENDORSCRIPT => '$(PREFIX)/bin',
+- INSTALLLIB => '$(DATADIR)/lib',
+- INSTALLSITELIB => '$(DATADIR)/lib',
+- INSTALLVENDORLIB => '$(DATADIR)/lib',
+ INSTALLMAN1DIR => '$(PREFIX)/share/man/man1',
+ INSTALLSITEMAN1DIR => '$(PREFIX)/share/man/man1',
+ INSTALLVENDORMAN1DIR => '$(PREFIX)/share/man/man1',
+ INSTALLMAN3DIR => '$(PREFIX)/share/man/man3',
+ INSTALLSITEMAN3DIR => '$(PREFIX)/share/man/man3',
+ INSTALLVENDORMAN3DIR => '$(PREFIX)/share/man/man3',
+- SYSCONFDIR => '$(PREFIX)/etc/fusioninventory',
++ SYSCONFDIR => '/etc/fusioninventory',
+ DATADIR => '$(PREFIX)/share/fusioninventory',
+- LOCALSTATEDIR => '$(PREFIX)/var/fusioninventory',
++ LOCALSTATEDIR => '/var/lib/fusioninventory',
+ );
+
+ # allow variables defined on command line to override defaults
diff --git a/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd
new file mode 100644
index 000000000000..8a68458e346c
--- /dev/null
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd
@@ -0,0 +1,2 @@
+# additional args for fusioninventory-agent
+FUSIONINVENTORY_OPTIONS=""
diff --git a/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd
new file mode 100644
index 000000000000..58bd3bbf2b45
--- /dev/null
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd
@@ -0,0 +1,21 @@
+#!/sbin/openrc-run
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile=${RC_PREFIX%/}/run/${SVCNAME}.pid
+
+name="fusioninventory-agent daemon"
+description="FusionInventroy agent"
+command=/usr/bin/fusioninventory-agent
+command_args="--daemon --pidfile ${pidfile} ${FUSIONINVENTORY_OPTIONS}"
+extra_started_commands="reload"
+
+depend() {
+ need net
+}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild b/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild
index b5a7d0a0a611..3350194f9c03 100644
--- a/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild
+++ b/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit perl-module
+inherit perl-module systemd
DESCRIPTION="The FusionInventory agent is a generic management agent"
HOMEPAGE="http://fusioninventory.org/"
@@ -31,9 +31,12 @@ RDEPEND="${DEPEND}"
BDEPEND="
dev-perl/Module-Install
"
+PATCHES=( "${FILESDIR}/${P}-dirs.patch" )
-src_prepare() {
- sed -e 's:\$(PREFIX)/etc:/etc:g' \
- -i Makefile.PL || die "sed failed"
+src_install() {
default
+ systemd_dounit contrib/unix/fusioninventory-agent.service
+ doinitd "${FILESDIR}/${PN}.initd"
+ doconfd "${FILESDIR}/${PN}.confd"
+ keepdir /var/lib/fusioninventory
}