makedev-3.23.1.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="2"
  4. inherit eutils toolchain-funcs
  5. MY_PN="MAKEDEV"
  6. MY_VER=${PV%.*}
  7. MY_REL=${PV#${MY_VER}.}
  8. MY_P="${MY_PN}-${MY_VER}"
  9. DESCRIPTION="program used for creating device files in /dev"
  10. HOMEPAGE="https://people.redhat.com/nalin/MAKEDEV/"
  11. SRC_URI="https://people.redhat.com/nalin/MAKEDEV/${MY_P}-${MY_REL}.tar.gz"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
  15. IUSE="build selinux"
  16. RDEPEND="!<sys-apps/baselayout-2.0.0_rc"
  17. DEPEND=""
  18. S=${WORKDIR}/${MY_P}
  19. src_prepare() {
  20. epatch "${FILESDIR}"/${P}-headers.patch #339674
  21. }
  22. src_compile() {
  23. use selinux && export SELINUX=1
  24. emake CC="$(tc-getCC)" OPTFLAGS="${CFLAGS}" || die
  25. }
  26. src_install() {
  27. # set devdir to makedevdir so we dont have to worry about /dev
  28. emake install DESTDIR="${D}" makedevdir=/sbin devdir=/sbin || die
  29. dodoc *.txt
  30. keepdir /dev
  31. }
  32. pkg_postinst() {
  33. if use build ; then
  34. # set up a base set of nodes to make recovery easier #368597
  35. "${ROOT}"/sbin/MAKEDEV -c "${ROOT}"/etc/makedev.d \
  36. -d "${ROOT}"/dev console hda input ptmx std sd tty
  37. # trim useless nodes
  38. rm -f "${ROOT}"/dev/fd[0-9]* # floppy
  39. rm -f "${ROOT}"/dev/sd[a-d][a-z]* "${ROOT}"/dev/sd[e-z]* # excess sata/scsi
  40. rm -f "${ROOT}"/dev/tty[a-zA-Z]* # excess tty
  41. fi
  42. }