acpid-2.0.23.ebuild 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit linux-info systemd
  5. DESCRIPTION="Daemon for Advanced Configuration and Power Interface"
  6. HOMEPAGE="https://sourceforge.net/projects/acpid2"
  7. SRC_URI="mirror://sourceforge/${PN}2/${P}.tar.xz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ia64 x86"
  11. IUSE="selinux"
  12. RDEPEND="selinux? ( sec-policy/selinux-apm )"
  13. DEPEND=">=sys-kernel/linux-headers-3"
  14. pkg_pretend() {
  15. local CONFIG_CHECK="~INPUT_EVDEV"
  16. local WARNING_INPUT_EVDEV="CONFIG_INPUT_EVDEV is required for ACPI button event support."
  17. [[ ${MERGE_TYPE} != buildonly ]] && check_extra_config
  18. }
  19. pkg_setup() { :; }
  20. src_configure() {
  21. econf --docdir=/usr/share/doc/${PF}
  22. }
  23. src_install() {
  24. emake DESTDIR="${D}" install
  25. newdoc kacpimon/README README.kacpimon
  26. dodoc -r samples
  27. rm -f "${D}"/usr/share/doc/${PF}/COPYING || die
  28. exeinto /etc/acpi
  29. newexe "${FILESDIR}"/${PN}-1.0.6-default.sh default.sh
  30. exeinto /etc/acpi/actions
  31. newexe samples/powerbtn/powerbtn.sh powerbtn.sh
  32. insinto /etc/acpi/events
  33. newins "${FILESDIR}"/${PN}-1.0.4-default default
  34. newinitd "${FILESDIR}"/${PN}-2.0.16-init.d ${PN}
  35. newconfd "${FILESDIR}"/${PN}-2.0.16-conf.d ${PN}
  36. systemd_dounit "${FILESDIR}"/systemd/${PN}.{service,socket}
  37. }
  38. pkg_postinst() {
  39. if [[ -z ${REPLACING_VERSIONS} ]]; then
  40. elog
  41. elog "You may wish to read the Gentoo Linux Power Management Guide,"
  42. elog "which can be found online at:"
  43. elog "https://www.gentoo.org/doc/en/power-management-guide.xml"
  44. elog
  45. fi
  46. # files/systemd/acpid.socket -> ListenStream=/run/acpid.socket
  47. mkdir -p "${ROOT%/}"/run
  48. if ! grep -qs "^tmpfs.*/run " "${ROOT%/}"/proc/mounts ; then
  49. echo
  50. ewarn "You should reboot the system now to get /run mounted with tmpfs!"
  51. fi
  52. }