1 |
commit: 042f96e8f848bc61f3a428ebe528304109e360dc |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 26 23:45:30 2020 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 26 23:45:47 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=042f96e8 |
7 |
|
8 |
app-metrics/fusioninventory-agent: add startup files |
9 |
|
10 |
Package-Manager: Portage-2.3.100, Repoman-2.3.22 |
11 |
Signed-off-by: Alexey Shvetsov <alexxy <AT> gentoo.org> |
12 |
|
13 |
.../files/fusioninventory-agent-2.5.2-dirs.patch | 23 ++++++++++++++++++++++ |
14 |
.../files/fusioninventory-agent.confd | 2 ++ |
15 |
.../files/fusioninventory-agent.initd | 21 ++++++++++++++++++++ |
16 |
.../fusioninventory-agent-2.5.2.ebuild | 11 +++++++---- |
17 |
4 files changed, 53 insertions(+), 4 deletions(-) |
18 |
|
19 |
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 |
20 |
new file mode 100644 |
21 |
index 00000000000..d4c0f4eadb0 |
22 |
--- /dev/null |
23 |
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent-2.5.2-dirs.patch |
24 |
@@ -0,0 +1,23 @@ |
25 |
+--- a/Makefile.PL 2020-05-27 02:16:42.106531746 +0300 |
26 |
++++ b/Makefile.PL 2020-05-27 02:17:30.568531767 +0300 |
27 |
+@@ -170,18 +170,15 @@ |
28 |
+ INSTALLSCRIPT => '$(PREFIX)/bin', |
29 |
+ INSTALLSITESCRIPT => '$(PREFIX)/bin', |
30 |
+ INSTALLVENDORSCRIPT => '$(PREFIX)/bin', |
31 |
+- INSTALLLIB => '$(DATADIR)/lib', |
32 |
+- INSTALLSITELIB => '$(DATADIR)/lib', |
33 |
+- INSTALLVENDORLIB => '$(DATADIR)/lib', |
34 |
+ INSTALLMAN1DIR => '$(PREFIX)/share/man/man1', |
35 |
+ INSTALLSITEMAN1DIR => '$(PREFIX)/share/man/man1', |
36 |
+ INSTALLVENDORMAN1DIR => '$(PREFIX)/share/man/man1', |
37 |
+ INSTALLMAN3DIR => '$(PREFIX)/share/man/man3', |
38 |
+ INSTALLSITEMAN3DIR => '$(PREFIX)/share/man/man3', |
39 |
+ INSTALLVENDORMAN3DIR => '$(PREFIX)/share/man/man3', |
40 |
+- SYSCONFDIR => '$(PREFIX)/etc/fusioninventory', |
41 |
++ SYSCONFDIR => '/etc/fusioninventory', |
42 |
+ DATADIR => '$(PREFIX)/share/fusioninventory', |
43 |
+- LOCALSTATEDIR => '$(PREFIX)/var/fusioninventory', |
44 |
++ LOCALSTATEDIR => '/var/lib/fusioninventory', |
45 |
+ ); |
46 |
+ |
47 |
+ # allow variables defined on command line to override defaults |
48 |
|
49 |
diff --git a/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd |
50 |
new file mode 100644 |
51 |
index 00000000000..8a68458e346 |
52 |
--- /dev/null |
53 |
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.confd |
54 |
@@ -0,0 +1,2 @@ |
55 |
+# additional args for fusioninventory-agent |
56 |
+FUSIONINVENTORY_OPTIONS="" |
57 |
|
58 |
diff --git a/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd |
59 |
new file mode 100644 |
60 |
index 00000000000..58bd3bbf2b4 |
61 |
--- /dev/null |
62 |
+++ b/app-metrics/fusioninventory-agent/files/fusioninventory-agent.initd |
63 |
@@ -0,0 +1,21 @@ |
64 |
+#!/sbin/openrc-run |
65 |
+# Copyright 2020 Gentoo Authors |
66 |
+# Distributed under the terms of the GNU General Public License v2 |
67 |
+ |
68 |
+pidfile=${RC_PREFIX%/}/run/${SVCNAME}.pid |
69 |
+ |
70 |
+name="fusioninventory-agent daemon" |
71 |
+description="FusionInventroy agent" |
72 |
+command=/usr/bin/fusioninventory-agent |
73 |
+command_args="--daemon --pidfile ${pidfile} ${FUSIONINVENTORY_OPTIONS}" |
74 |
+extra_started_commands="reload" |
75 |
+ |
76 |
+depend() { |
77 |
+ need net |
78 |
+} |
79 |
+ |
80 |
+reload() { |
81 |
+ ebegin "Reloading ${SVCNAME}" |
82 |
+ start-stop-daemon --signal HUP --pidfile "${pidfile}" |
83 |
+ eend $? |
84 |
+} |
85 |
|
86 |
diff --git a/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild b/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild |
87 |
index b5a7d0a0a61..3350194f9c0 100644 |
88 |
--- a/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild |
89 |
+++ b/app-metrics/fusioninventory-agent/fusioninventory-agent-2.5.2.ebuild |
90 |
@@ -3,7 +3,7 @@ |
91 |
|
92 |
EAPI=7 |
93 |
|
94 |
-inherit perl-module |
95 |
+inherit perl-module systemd |
96 |
|
97 |
DESCRIPTION="The FusionInventory agent is a generic management agent" |
98 |
HOMEPAGE="http://fusioninventory.org/" |
99 |
@@ -31,9 +31,12 @@ RDEPEND="${DEPEND}" |
100 |
BDEPEND=" |
101 |
dev-perl/Module-Install |
102 |
" |
103 |
+PATCHES=( "${FILESDIR}/${P}-dirs.patch" ) |
104 |
|
105 |
-src_prepare() { |
106 |
- sed -e 's:\$(PREFIX)/etc:/etc:g' \ |
107 |
- -i Makefile.PL || die "sed failed" |
108 |
+src_install() { |
109 |
default |
110 |
+ systemd_dounit contrib/unix/fusioninventory-agent.service |
111 |
+ doinitd "${FILESDIR}/${PN}.initd" |
112 |
+ doconfd "${FILESDIR}/${PN}.confd" |
113 |
+ keepdir /var/lib/fusioninventory |
114 |
} |