udev-init-scripts-29.ebuild 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. if [ "${PV}" = "9999" ]; then
  5. EGIT_REPO_URI="git://anongit.gentoo.org/proj/udev-gentoo-scripts.git"
  6. inherit git-r3
  7. else
  8. SRC_URI="https://dev.gentoo.org/~williamh/dist/${P}.tar.gz"
  9. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
  10. fi
  11. inherit eutils
  12. DESCRIPTION="udev startup scripts for openrc"
  13. HOMEPAGE="https://www.gentoo.org"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. IUSE=""
  17. RESTRICT="test"
  18. DEPEND=""
  19. RDEPEND=">=virtual/udev-217
  20. !<sys-apps/openrc-0.14"
  21. src_prepare() {
  22. epatch_user
  23. }
  24. pkg_postinst() {
  25. # Add udev and udev-trigger to the sysinit runlevel automatically.
  26. for f in udev udev-trigger; do
  27. if [[ -x ${ROOT%/}/etc/init.d/${f} &&
  28. -d ${ROOT%/}/etc/runlevels/sysinit &&
  29. ! -L "${ROOT%/}/etc/runlevels/sysinit/${f}" ]]; then
  30. ln -snf /etc/init.d/${f} "${ROOT%/}"/etc/runlevels/sysinit/${f}
  31. ewarn "Adding ${f} to the sysinit runlevel"
  32. fi
  33. done
  34. if ! has_version "sys-fs/eudev[rule-generator]" && \
  35. [[ -x $(type -P rc-update) ]] && rc-update show | grep udev-postmount | grep -qs 'boot\|default\|sysinit'; then
  36. ewarn "The udev-postmount service has been removed because the reasons for"
  37. ewarn "its existance have been removed upstream."
  38. ewarn "Please remove it from your runlevels."
  39. fi
  40. }