netplug-1.2.9.2-r1.ebuild 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
  6. HOMEPAGE="http://www.red-bean.com/~bos/"
  7. SRC_URI="http://www.red-bean.com/~bos/netplug/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 arm ~mips ppc sparc x86"
  11. IUSE="debug doc"
  12. DEPEND="doc? ( app-text/ghostscript-gpl
  13. media-gfx/graphviz )"
  14. RDEPEND=""
  15. src_prepare() {
  16. # Remove debug flags from CFLAGS
  17. if ! use debug; then
  18. sed -i -e "s/ -ggdb3//" Makefile || die
  19. fi
  20. # Remove -O3 and -Werror from CFLAGS
  21. sed -i -e "s/ -O3//" -e "s/ -Werror//" Makefile || die
  22. # Remove nested functions, #116140
  23. epatch "${FILESDIR}/${PN}-1.2.9-remove-nest.patch"
  24. # Ignore wireless events
  25. epatch "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch"
  26. }
  27. src_compile() {
  28. tc-export CC
  29. emake CC="${CC}"
  30. if use doc; then
  31. emake -C docs/
  32. fi
  33. }
  34. src_install() {
  35. into /
  36. dosbin netplugd
  37. doman man/man8/netplugd.8
  38. dodir /etc/netplug.d
  39. exeinto /etc/netplug.d
  40. newexe "${FILESDIR}/netplug-2" netplug
  41. dodir /etc/netplug
  42. echo "eth*" > "${D}"/etc/netplug/netplugd.conf || die
  43. dodoc ChangeLog NEWS README TODO
  44. if use doc; then
  45. dodoc docs/state-machine.ps
  46. fi
  47. }