apmd-3.2.2_p14.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils multilib toolchain-funcs
  5. MY_PV=${PV%_p*}
  6. MY_P=${PN}_${MY_PV}
  7. PATCHV=${PV#*_p}
  8. DESCRIPTION="Advanced Power Management Daemon"
  9. HOMEPAGE="http://packages.qa.debian.org/a/apmd.html"
  10. SRC_URI="mirror://debian/pool/main/a/apmd/${MY_P}.orig.tar.gz
  11. mirror://debian/pool/main/a/apmd/${MY_P}-${PATCHV}.diff.gz"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="amd64 arm ppc ppc64 x86"
  15. IUSE="nls X"
  16. RDEPEND=">=sys-apps/debianutils-1.16
  17. >=sys-power/powermgmt-base-1.31
  18. X? ( x11-libs/libX11
  19. x11-libs/libXaw
  20. x11-libs/libXmu
  21. x11-libs/libSM
  22. x11-libs/libICE
  23. x11-libs/libXt
  24. x11-libs/libXext )"
  25. DEPEND="${RDEPEND}
  26. sys-devel/libtool
  27. virtual/os-headers"
  28. S=${WORKDIR}/${PN}-${MY_PV}.orig
  29. src_prepare() {
  30. epatch "${WORKDIR}"/${MY_P}-${PATCHV}.diff
  31. if ! use X; then
  32. sed -i \
  33. -e 's:\(EXES=.*\)xapm:\1:' \
  34. -e 's:\(.*\)\$(LT_INSTALL).*xapm.*$:\1echo:' \
  35. Makefile || die
  36. fi
  37. # use system headers and skip on_ac_power
  38. rm -f on_ac_power*
  39. sed -i \
  40. -e '/on_ac_power/d' \
  41. -e 's:-I/usr/src/linux/include -I/usr/X11R6/include::' \
  42. -e 's:-L/usr/X11R6/lib::' \
  43. Makefile || die
  44. }
  45. src_compile() {
  46. emake CC=$(tc-getCC) CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
  47. }
  48. src_install() {
  49. dodir /usr/sbin
  50. emake DESTDIR="${D}" PREFIX=/usr LIBDIR=/usr/$(get_libdir) install
  51. keepdir /etc/apm/{event.d,suspend.d,resume.d,other.d,scripts.d}
  52. exeinto /etc/apm
  53. doexe debian/apmd_proxy
  54. dodoc AUTHORS {,apmsleep.}README debian/{changelog,README.Debian}
  55. doman *.{1,8}
  56. # note: apmd_proxy.conf is currently disabled and not used, thus
  57. # not installed - liquidx (01 Mar 2004)
  58. newconfd "${FILESDIR}"/apmd.confd apmd
  59. newinitd "${FILESDIR}"/apmd.rc6 apmd
  60. use nls || rm -rf "${D}"/usr/share/man/fr
  61. }