sys-power/intel-undervolt: sync live ebuild
authorGeorgy Yakovlev <gyakovlev@gentoo.org>
Fri, 30 Aug 2019 20:25:23 +0000 (13:25 -0700)
committerGeorgy Yakovlev <gyakovlev@gentoo.org>
Fri, 30 Aug 2019 20:25:59 +0000 (13:25 -0700)
Package-Manager: Portage-2.3.73, Repoman-2.3.17
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
sys-power/intel-undervolt/intel-undervolt-9999.ebuild

index 74c44d3fe535b18d4357ef6f30a4c06e3798eecf..3073fbb4c1bf571e9c241ac97cada8ff34762cb2 100644 (file)
@@ -18,45 +18,44 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE=""
+IUSE="elogind"
 
-DEPEND=""
-RDEPEND=""
-BDEPEND=""
+DEPEND="elogind? ( sys-auth/elogind )"
+
+RDEPEND="${DEPEND}"
+
+BDEPEND="virtual/pkgconfig"
 
 CONFIG_CHECK="~INTEL_RAPL ~X86_MSR"
 
-src_prepare() {
-       # respect CC, CFLAGS and avoid calling pkg-config
-       sed -i \
-               -e 's/^CC=/CC?=/' \
-               -e 's/^CFLAGS=/CFLAGS?=/' \
-               -e '/^UNITDIR=/d' \
-               Makefile || die
+src_configure() {
+       local myconf=(
+               # it's a non-standard build system
+               $(usex elogind --enable-elogind '')
+               --enable-openrc
+               --enable-systemd
+               --unitdir="$(systemd_get_systemunitdir)"
+       )
 
-       default
+       econf "${myconf[@]}"
 }
 
 src_compile() {
 
        tc-export CC
 
-       myemakeargs=(
-               BINDIR="${EPREFIX}"/usr/bin
-               SYSCONFDIR="${EPREFIX}"/etc
-               UNITDIR="$(systemd_get_systemunitdir)"
+       local myemakeargs=(
+               CC="${CC}"
+               CFLAGS="${CFLAGS}"
        )
        emake "${myemakeargs[@]}"
 }
 
-src_install() {
-       myemakeargs+=(
-               DESTDIR="${D}"
-       )
-       emake "${myemakeargs[@]}" install
-
-       newinitd "${FILESDIR}"/initd "${PN}"
-       newconfd "${FILESDIR}"/confd "${PN}"
-
-       einstalldocs
+pkg_postinst() {
+for v in ${REPLACING_VERSIONS}; do
+       if [[ ${v} == 1.6 ]] ; then
+               elog "openrc service has been renamed to intel-undervolt-loop"
+               elog "please update your startup configuration"
+       fi
+done
 }