ifplugd-0.28-r9.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils
  5. DESCRIPTION="Brings up/down ethernet ports automatically with cable detection"
  6. HOMEPAGE="http://0pointer.de/lennart/projects/ifplugd/"
  7. SRC_URI="http://0pointer.de/lennart/projects/ifplugd/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~arm amd64 hppa ppc x86"
  11. IUSE="doc selinux"
  12. DEPEND="virtual/pkgconfig
  13. doc? ( www-client/lynx )
  14. >=dev-libs/libdaemon-0.5"
  15. RDEPEND=">=dev-libs/libdaemon-0.5
  16. >=sys-apps/baselayout-1.12
  17. selinux? ( sec-policy/selinux-ifplugd )"
  18. src_prepare() {
  19. epatch "${FILESDIR}/${P}-nlapi.diff"
  20. epatch "${FILESDIR}/${P}-interface.patch"
  21. epatch "${FILESDIR}/${P}-strictalias.patch"
  22. epatch "${FILESDIR}/${P}-noip.patch"
  23. }
  24. src_configure() {
  25. econf \
  26. $(use_enable doc lynx) \
  27. --with-initdir=/etc/init.d \
  28. --disable-xmltoman \
  29. --disable-subversion
  30. }
  31. src_install() {
  32. default
  33. # Remove init.d configuration as we no longer use it
  34. rm -rf "${D}/etc/ifplugd" "${D}/etc/init.d/${PN}"
  35. exeinto "/etc/${PN}"
  36. newexe "${FILESDIR}/${PN}.action" "${PN}.action"
  37. cd "${S}/doc"
  38. dodoc README SUPPORTED_DRIVERS
  39. use doc && dohtml *.html *.css
  40. }
  41. pkg_postinst() {
  42. # Warn about old init script
  43. einfo "baselayout now starts ifplugd automatically on wired interfaces"
  44. einfo "If you do not want this behaviour then add !plug to your modules"
  45. einfo "in /etc/conf.d/net like so"
  46. einfo " modules=( \"!plug\" )"
  47. if [ -e "${ROOT}/etc/init.d/ifplugd" -o -e "${ROOT}/etc/conf.d/ifplugd" ] ; then
  48. echo
  49. ewarn "You should stop the ifplugd service now and remove its init"
  50. ewarn "script and config file"
  51. if [ "${ROOT}" = "/" ] ; then
  52. ewarn " /etc/init.d/ifplugd stop"
  53. ewarn " rc-update del ifplugd"
  54. ewarn " rm -f /etc/{conf,init}.d/ifplugd"
  55. fi
  56. fi
  57. }