--- /usr/portage/sys-fabric/opensm/opensm-3.3.23-r1.ebuild 2021-03-01 20:09:18.000000000 +0300 +++ opensm-3.3.23-r1.ebuild 2021-03-08 01:26:49.645777981 +0300 @@ -3,14 +3,14 @@ EAPI="7" -inherit autotools eutils +inherit autotools eutils systemd HOMEPAGE="https://github.com/linux-rdma/opensm/" DESCRIPTION="OpenSM - InfiniBand Subnet Manager and Administration for OpenIB" SRC_URI="https://github.com/linux-rdma/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~x86 ~amd64-linux" -IUSE="tools" +IUSE="tools systemd" SLOT="0" LICENSE="|| ( GPL-2 BSD-2 )" @@ -19,9 +19,11 @@ tools? ( net-misc/iputils net-misc/openssh - )" + ) + systemd? ( >=sys-apps/systemd-234 )" -PATCHES=( "${FILESDIR}/${PN}-3.3.17-sldd.patch" ) +PATCHES=( "${FILESDIR}/${PN}-3.3.17-sldd.patch" + "${FILESDIR}/${P}-norpm.patch" ) src_prepare() { default @@ -39,6 +41,9 @@ default newconfd "${FILESDIR}/opensm.conf.d" opensm newinitd "${FILESDIR}/opensm.init.d.2" opensm + systemd_newunit "${FILESDIR}/opensm.service" opensm.service + dosbin "${FILESDIR}/opensm.launch" + fperms 755 /usr/sbin/opensm.launch insinto /etc/logrotate.d newins "${S}/scripts/opensm.logrotate" opensm # we dont need this int script @@ -48,11 +53,19 @@ dosbin scripts/sldd.sh newconfd "${FILESDIR}/sldd.conf.d" sldd newinitd "${FILESDIR}/sldd.init.d" sldd + systemd_newunit "${FILESDIR}/sldd.service" sldd.service fi + + + # keepdir /var/empty/dev } pkg_postinst() { einfo "To automatically configure the infiniband subnet manager on boot," einfo "edit /etc/opensm.conf and add opensm to your start-up scripts:" - einfo "\`rc-update add opensm default\`" + if use systemd; then + einfo "\`systemctl enable opensm.service\`" + else + einfo "\`rc-update add opensm default\`" + fi }