sysrqd-14.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils toolchain-funcs
  4. IUSE=""
  5. DESCRIPTION="daemon providing access to the kernel sysrq functions via network"
  6. HOMEPAGE="http://julien.danjou.info/projects/sysrqd"
  7. #SRC_URI="http://julien.danjou.info/${PN}/${P}.tar.gz"
  8. SRC_URI="https://dev.gentoo.org/~wschlich/src/${CATEGORY}/${PN}/${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~x86 ~amd64"
  12. DEPEND=""
  13. RDEPEND="${DEPEND}"
  14. src_unpack() {
  15. unpack ${A}
  16. cd "${S}"
  17. epatch "${FILESDIR}/${PN}-config.patch"
  18. }
  19. src_compile() {
  20. $(tc-getCC) ${CFLAGS} ${LDFLAGS} -o sysrqd sysrqd.c
  21. }
  22. src_install() {
  23. dosbin sysrqd
  24. newinitd "${FILESDIR}/sysrqd.init" sysrqd
  25. local bindip='127.0.0.1' secret
  26. declare -i secret
  27. let secret=${RANDOM}*${RANDOM}*${RANDOM}*${RANDOM}
  28. echo ${bindip} > sysrqd.bind
  29. echo ${secret} > sysrqd.secret
  30. diropts -m 0700 -o root -g root
  31. dodir /etc/sysrqd
  32. insinto /etc/sysrqd
  33. insopts -m 0600 -o root -g root
  34. doins sysrqd.bind
  35. doins sysrqd.secret
  36. dodoc README ChangeLog
  37. }
  38. pkg_postinst() {
  39. elog
  40. elog "Be sure to change the initial secret in /etc/sysrqd/sysrqd.secret !"
  41. elog "As a security precaution, sysrqd is configured to only listen on"
  42. elog "127.0.0.1 by default. Change the content of /etc/sysrqd/sysrqd.bind"
  43. elog "to an IPv4 address you want it to listen on or remove the file"
  44. elog "to make it listen on any IP address (0.0.0.0)."
  45. elog
  46. }