netplug-1.2.9.2-r2.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  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 ppc64 sparc x86"
  11. IUSE="debug doc"
  12. DEPEND="doc? ( app-text/ghostscript-gpl
  13. media-gfx/graphviz )"
  14. RDEPEND=""
  15. PATCHES=(
  16. # Remove nested functions, #116140
  17. "${FILESDIR}/${PN}-1.2.9-remove-nest.patch"
  18. # Ignore wireless events
  19. "${FILESDIR}/${PN}-1.2.9-ignore-wireless.patch"
  20. # Fix DOWNANDOUT problem #599400
  21. "${FILESDIR}/${P}-downandout.patch"
  22. )
  23. src_prepare() {
  24. # Remove debug flags from CFLAGS
  25. if ! use debug; then
  26. sed -i -e "s/ -ggdb3//" Makefile || die
  27. fi
  28. # Remove -O3 and -Werror from CFLAGS
  29. sed -i -e "s/ -O3//" -e "s/ -Werror//" Makefile || die
  30. default
  31. }
  32. src_compile() {
  33. tc-export CC
  34. emake CC="${CC}"
  35. if use doc; then
  36. emake -C docs/
  37. fi
  38. }
  39. src_install() {
  40. into /
  41. dosbin netplugd
  42. doman man/man8/netplugd.8
  43. dodir /etc/netplug.d
  44. exeinto /etc/netplug.d
  45. newexe "${FILESDIR}/netplug-2" netplug
  46. dodir /etc/netplug
  47. echo "eth*" > "${D}"/etc/netplug/netplugd.conf || die
  48. dodoc ChangeLog NEWS README TODO
  49. if use doc; then
  50. dodoc docs/state-machine.ps
  51. fi
  52. }