--- /usr/portage/sys-libs/openipmi/openipmi-2.0.18.ebuild 2013-10-30 20:01:33.000000000 +0400 +++ /usr/portage/local/sys-libs/openipmi/openipmi-2.0.18-r1.ebuild 2013-11-25 18:55:09.830788311 +0400 @@ -2,7 +2,10 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-libs/openipmi/openipmi-2.0.18.ebuild,v 1.3 2013/10/30 15:55:09 jer Exp $ -inherit eutils autotools python +EAPI=5 +PYTHON_COMPAT=( python{2_6,2_7} ) + +inherit eutils autotools python-single-r1 DESCRIPTION="Library interface to IPMI" HOMEPAGE="http://sourceforge.net/projects/openipmi/" @@ -22,7 +25,7 @@ crypt? ( dev-libs/openssl ) snmp? ( net-analyzer/net-snmp ) perl? ( dev-lang/perl ) - python? ( dev-lang/python ) + python? ( ${PYTHON_DEPS} ) tcl? ( dev-lang/tcl )" DEPEND="${RDEPEND} >=dev-lang/swig-1.3.21 @@ -30,6 +33,8 @@ # Gui is broken! # python? ( tcl? ( tk? ( dev-lang/tk dev-tcltk/tix ) ) )" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + # Upstream doesn't use --without properly use_yesno() { yesmsg="yes" @@ -41,9 +46,11 @@ fi } -src_unpack() { - unpack ${A} - cd "${S}" +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { # Bug #338499: The installed OpenIPMIpthread.pc depends on a non-existing # pthread.pc. We patch it to link -lpthread directly instead. epatch "${FILESDIR}/${PN}-2.0.16-pthreads.patch" @@ -53,12 +60,12 @@ sed -r -i \ -e '/INSTALL.*\.py[oc] /d' \ -e '/install-exec-local/s,OpenIPMI.pyc OpenIPMI.pyo,,g' \ - swig/python/Makefile.{am,in} + swig/python/Makefile.{am,in} || die # Bug #298250: parallel install fix. sed -r -i \ -e '/^install-data-local:/s,$, install-exec-am,g' \ - cmdlang/Makefile.{am,in} + cmdlang/Makefile.{am,in} || die # We touch the .in and .am above because if we use the below, the Perl stuff # is very fragile, and often fails to link. @@ -67,7 +74,7 @@ #eautoreconf } -src_compile() { +src_configure() { local myconf="" myconf="${myconf} `use_with snmp ucdsnmp yes`" myconf="${myconf} `use_with crypt openssl yes`" @@ -87,20 +94,12 @@ myconf="${myconf} --without-tkinter" myconf="${myconf} --with-glib --with-swig" # these binaries are for root! - econf ${myconf} --bindir=/usr/sbin || die "econf failed" - emake || die "emake $i failed" + econf ${myconf} --bindir=/usr/sbin } src_install() { - emake DESTDIR="${D}" install || die + default dodoc README* FAQ ChangeLog TODO doc/IPMI.pdf lanserv/README.emulator newdoc cmdlang/README README.cmdlang -} - -pkg_postinst() { - use python && python_mod_optimize $(python_get_sitedir)/OpenIPMI.py -} - -pkg_postrm() { - use python && python_mod_cleanup $(python_get_sitedir)/OpenIPMI.py + use python && python_optimize "${ED}"/$(python_get_sitedir) }