1 |
commit: 95ec1db1409c91b3683d7af31b13b1b8648bb3e8 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 24 22:59:40 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 24 23:00:09 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95ec1db1 |
7 |
|
8 |
sys-apps/ipmitool: systemd unit for ipmievd |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
sys-apps/ipmitool/files/ipmievd.service | 10 + |
13 |
.../ipmitool/ipmitool-1.8.18_p20201004-r3.ebuild | 202 +++++++++++++++++++++ |
14 |
2 files changed, 212 insertions(+) |
15 |
|
16 |
diff --git a/sys-apps/ipmitool/files/ipmievd.service b/sys-apps/ipmitool/files/ipmievd.service |
17 |
new file mode 100644 |
18 |
index 00000000000..fdae14f231c |
19 |
--- /dev/null |
20 |
+++ b/sys-apps/ipmitool/files/ipmievd.service |
21 |
@@ -0,0 +1,10 @@ |
22 |
+[Unit] |
23 |
+Description=IPMI event daemon |
24 |
+ |
25 |
+[Service] |
26 |
+Type=forking |
27 |
+ExecStart=/usr/sbin/ipmievd open daemon |
28 |
+ |
29 |
+[Install] |
30 |
+WantedBy=multi-user.target |
31 |
+Alias=ipmi.service |
32 |
|
33 |
diff --git a/sys-apps/ipmitool/ipmitool-1.8.18_p20201004-r3.ebuild b/sys-apps/ipmitool/ipmitool-1.8.18_p20201004-r3.ebuild |
34 |
new file mode 100644 |
35 |
index 00000000000..528c0393a61 |
36 |
--- /dev/null |
37 |
+++ b/sys-apps/ipmitool/ipmitool-1.8.18_p20201004-r3.ebuild |
38 |
@@ -0,0 +1,202 @@ |
39 |
+# Copyright 1999-2020 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+EAPI=7 |
43 |
+inherit autotools eutils flag-o-matic systemd |
44 |
+ |
45 |
+DESCRIPTION="Utility for controlling IPMI enabled devices." |
46 |
+HOMEPAGE="http://ipmitool.sf.net/" |
47 |
+DEBIAN_PR="9.debian" |
48 |
+DEBIAN_PV="${PV/_p*}" |
49 |
+DEBIAN_P="${PN}_${DEBIAN_PV}" |
50 |
+DEBIAN_PF="${DEBIAN_P}-${DEBIAN_PR}" |
51 |
+COMMIT_ID=7fd7c0f2ba39e223868a8d83d81d4074f057d6fc |
52 |
+if [[ -n "${COMMIT_ID}" ]]; then |
53 |
+ S="${WORKDIR}/${PN}-${COMMIT_ID}" |
54 |
+ SRC_URI="https://github.com/ipmitool/ipmitool/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz" |
55 |
+else |
56 |
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
57 |
+fi |
58 |
+# https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers |
59 |
+# is not available with version numbers or dates! |
60 |
+SRC_URI+=" |
61 |
+ https://dev.gentoo.org/~robbat2/distfiles/ipmitool_1.8.18-9.debian-ported-gentoo.tar.xz |
62 |
+ https://dev.gentoo.org/~robbat2/distfiles/enterprise-numbers.2020-10-21.xz |
63 |
+ " |
64 |
+ #http://http.debian.net/debian/pool/main/i/${PN}/${DEBIAN_PF}.tar.xz |
65 |
+ # https://launchpad.net/ubuntu/+archive/primary/+files/${DEBIAN_PF}.tar.xz |
66 |
+#IUSE="freeipmi openipmi status" |
67 |
+IUSE="libressl openbmc openipmi static" |
68 |
+SLOT="0" |
69 |
+KEYWORDS="~amd64 ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86" |
70 |
+LICENSE="BSD" |
71 |
+ |
72 |
+RDEPEND=" |
73 |
+ !libressl? ( dev-libs/openssl:0= ) |
74 |
+ libressl? ( dev-libs/libressl:0= ) |
75 |
+ openbmc? ( sys-apps/systemd:0= ) |
76 |
+ sys-libs/readline:0=" |
77 |
+DEPEND="${RDEPEND} |
78 |
+ openipmi? ( sys-libs/openipmi ) |
79 |
+ virtual/os-headers" |
80 |
+ #freeipmi? ( sys-libs/freeipmi ) |
81 |
+# ipmitool CAN build against || ( sys-libs/openipmi sys-libs/freeipmi ) |
82 |
+# but it doesn't actually need either. |
83 |
+ |
84 |
+PATCHES=( |
85 |
+ #"${FILESDIR}"/${P}-openssl-1.1.patch |
86 |
+) |
87 |
+ |
88 |
+# I hope all of this will get MUCH cleaner if upstream will just make a new |
89 |
+# release! - robbat2 2020/10/21 |
90 |
+src_prepare() { |
91 |
+ default |
92 |
+ if [ -d "${S}"/debian ] ; then |
93 |
+ mv "${S}"/debian{,.package} |
94 |
+ ln -s "${WORKDIR}"/debian "${S}" |
95 |
+ eautoreconf |
96 |
+ # Upstream commit includes SOME of the debian changes, but not all of them |
97 |
+ sed -i \ |
98 |
+ -e '/^#/d' \ |
99 |
+ -e '/0120-openssl1.1.patch/d' \ |
100 |
+ debian/patches/series |
101 |
+ for p in $(cat debian/patches/series) ; do |
102 |
+ echo $p |
103 |
+ if ! nonfatal eapply -p1 debian/patches/$p ; then |
104 |
+ echo "failed $p" |
105 |
+ fail=1 |
106 |
+ fi |
107 |
+ done |
108 |
+ [[ $fail -eq 1 ]] && die "fail" |
109 |
+ fi |
110 |
+ pd="${WORKDIR}"/ipmitool_1.8.18-9.debian-ported-gentoo/ |
111 |
+ PATCHES=( |
112 |
+ #"${pd}"/0000.0120-openssl1.1.patch |
113 |
+ "${pd}"/0001.0100-fix_buf_overflow.patch |
114 |
+ "${pd}"/0002.0500-fix_CVE-2011-4339.patch |
115 |
+ "${pd}"/0003.0600-manpage_longlines.patch |
116 |
+ #"${pd}"/0004.0110-getpass-prototype.patch |
117 |
+ #"${pd}"/0005.0115-typo.patch |
118 |
+ "${pd}"/0006.0125-nvidia-iana.patch |
119 |
+ "${pd}"/0007.0615-manpage_typo.patch |
120 |
+ #"${pd}"/0008.0130-Correct_lanplus_segment_violation.patch |
121 |
+ "${pd}"/0009.0005-gcc10.patch |
122 |
+ #"${pd}"/0010.0010-utf8.patch |
123 |
+ ) |
124 |
+ for p in "${PATCHES[@]}" ; do |
125 |
+ eapply -p1 $p || die "failed $p" |
126 |
+ done |
127 |
+ |
128 |
+ # Gentoo chooses to install ipmitool in /usr/sbin |
129 |
+ # Where RedHat chooses /usr/bin |
130 |
+ sed -i -e \ |
131 |
+ 's,/usr/bin/ipmitool,/usr/sbin/ipmitool,g' \ |
132 |
+ "${S}"/contrib/* \ |
133 |
+ || die "sed bindir failed" |
134 |
+ |
135 |
+ # Consistent RUNSTATEDIR |
136 |
+ sed -i -e \ |
137 |
+ 's,/var/run,/run,g' \ |
138 |
+ "${S}/doc/ipmievd.8.in" \ |
139 |
+ "${S}"/contrib/* \ |
140 |
+ "${S}"/lib/helper.c \ |
141 |
+ "${S}"/src/ipmievd.c \ |
142 |
+ || die "sed /var/run failed" |
143 |
+ |
144 |
+ eautoreconf |
145 |
+ |
146 |
+ # If this file is not present, then ipmitool will try to download it during make install! |
147 |
+ cp -al \ |
148 |
+ "${WORKDIR}/enterprise-numbers.2020-10-21" \ |
149 |
+ "${S}"/enterprise-numbers \ |
150 |
+ || die "Could not place IANA enterprise-numbers" |
151 |
+} |
152 |
+ |
153 |
+src_configure() { |
154 |
+ # - LIPMI and BMC are the Solaris libs |
155 |
+ # - OpenIPMI is unconditionally enabled in the configure as there is compat |
156 |
+ # code that is used if the library itself is not available |
157 |
+ # FreeIPMI does build now, but is disabled until the other arches keyword it |
158 |
+ # `use_enable freeipmi intf-free` \ |
159 |
+ # --enable-ipmievd is now unconditional |
160 |
+ |
161 |
+ # for pidfiles, runstatedir not respected in all parts of code |
162 |
+ append-cppflags -D_PATH_VARRUN=/run/ |
163 |
+ |
164 |
+ # WGET & CURL are set to avoid network interaction, we manually inject the |
165 |
+ # IANA enterprise-numbers file instead. |
166 |
+ # |
167 |
+ # DEFAULT_INTF=open # default to OpenIPMI, do not take external input |
168 |
+ WGET=/bin/true \ |
169 |
+ CURL=/bin/true \ |
170 |
+ DEFAULT_INTF=open \ |
171 |
+ econf \ |
172 |
+ $(use_enable static) \ |
173 |
+ --enable-ipmishell \ |
174 |
+ --enable-intf-lan \ |
175 |
+ --enable-intf-usb \ |
176 |
+ $(use_enable openbmc intf-dbus) \ |
177 |
+ --enable-intf-lanplus \ |
178 |
+ --enable-intf-open \ |
179 |
+ --enable-intf-serial \ |
180 |
+ --disable-intf-bmc \ |
181 |
+ --disable-intf-dummy \ |
182 |
+ --disable-intf-free \ |
183 |
+ --disable-intf-imb \ |
184 |
+ --disable-intf-lipmi \ |
185 |
+ --disable-internal-md5 \ |
186 |
+ --with-kerneldir=/usr \ |
187 |
+ --bindir=/usr/sbin \ |
188 |
+ --runstatedir=/run \ |
189 |
+ CFLAGS="${CFLAGS}" |
190 |
+ |
191 |
+ # Fix linux/ipmi.h to compile properly. This is a hack since it doesn't |
192 |
+ # include the below file to define some things. |
193 |
+ echo "#include <asm/byteorder.h>" >>config.h |
194 |
+ |
195 |
+} |
196 |
+ |
197 |
+src_install() { |
198 |
+ emake DESTDIR="${D}" PACKAGE="${PF}" install |
199 |
+ rm -f "${D}"/usr/share/doc/${PF}/COPYING |
200 |
+ into /usr |
201 |
+ |
202 |
+ newinitd "${FILESDIR}"/${PN}-1.8.18-ipmievd.initd ipmievd |
203 |
+ newconfd "${FILESDIR}"/${PN}-1.8.18-ipmievd.confd ipmievd |
204 |
+ # From debian, less configurable than OpenRC |
205 |
+ systemd_dounit "${FILESDIR}"/ipmievd.service |
206 |
+ |
207 |
+ # Everything past this point is installing contrib/ |
208 |
+ dosbin contrib/bmclanconf |
209 |
+ |
210 |
+ exeinto /usr/libexec |
211 |
+ doexe contrib/log_bmc.sh |
212 |
+ newinitd "${FILESDIR}/log_bmc-1.8.18.initd" log_bmc |
213 |
+ |
214 |
+ # contrib/exchange-bmc-os-info.init.redhat |
215 |
+ # contrib/exchange-bmc-os-info.service.redhat |
216 |
+ # contrib/exchange-bmc-os-info.sysconf |
217 |
+ exeinto /usr/libexec |
218 |
+ newexe contrib/exchange-bmc-os-info.init.redhat exchange-bmc-os-info |
219 |
+ insinto /etc/sysconfig |
220 |
+ newins contrib/exchange-bmc-os-info.sysconf exchange-bmc-os-info |
221 |
+ systemd_newunit contrib/exchange-bmc-os-info.service.redhat exchange-bmc-os-info.service |
222 |
+ newinitd "${FILESDIR}/exchange-bmc-os-info-1.8.18.initd" exchange-bmc-os-info |
223 |
+ |
224 |
+ # contrib/bmc-snmp-proxy |
225 |
+ # contrib/bmc-snmp-proxy.service |
226 |
+ # contrib/bmc-snmp-proxy.sysconf |
227 |
+ exeinto /usr/libexec |
228 |
+ doexe contrib/bmc-snmp-proxy |
229 |
+ insinto /etc/sysconfig |
230 |
+ newins contrib/bmc-snmp-proxy.sysconf bmc-snmp-proxy |
231 |
+ systemd_dounit contrib/bmc-snmp-proxy.service |
232 |
+ # TODO: initd for bmc-snmp-proxy |
233 |
+ |
234 |
+ insinto /usr/share/${PN} |
235 |
+ doins contrib/oem_ibm_sel_map |
236 |
+ |
237 |
+ docinto contrib |
238 |
+ cd "${S}"/contrib |
239 |
+ dodoc collect_data.sh create_rrds.sh create_webpage_compact.sh create_webpage.sh README |
240 |
+} |