qcontrol-0.4.2-r1.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. inherit eutils toolchain-funcs
  4. DESCRIPTION="Allows to send commands to some microcontrollers, for example to change leds or sound a buzzer"
  5. HOMEPAGE="http://qnap.nas-central.org/index.php/PIC_Control_Software"
  6. SRC_URI="mirror://debian/pool/main/q/qcontrol/${P/-/_}.orig.tar.gz
  7. mirror://debian/pool/main/q/qcontrol/${P/-/_}-6.diff.gz"
  8. LICENSE="GPL-3"
  9. SLOT="0"
  10. KEYWORDS="arm"
  11. IUSE=""
  12. DEPEND=">=dev-lang/lua-5.1"
  13. RDEPEND="${DEPEND}"
  14. src_unpack () {
  15. unpack ${A}
  16. cd "${WORKDIR}"
  17. epatch *.diff
  18. cd "${S}"
  19. epatch debian/patches/*.patch
  20. epatch "${FILESDIR}"/${PV}-Makefile.patch
  21. }
  22. src_compile() {
  23. emake CC="$(tc-getCC)" qcontrol || die "emake failed"
  24. }
  25. src_install() {
  26. dosbin qcontrol
  27. doman "${S}"/debian/qcontrol.1
  28. insinto /etc/qcontrol
  29. doins "${S}"/debian/configs/*.lua
  30. newconfd "${FILESDIR}"/conf.d qcontrol
  31. newinitd "${FILESDIR}"/init.d qcontrol
  32. }
  33. pkg_postinst() {
  34. device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
  35. head -n1 | sed "s/^[^:]*: //")
  36. case $device in
  37. "QNAP TS-109/TS-209")
  38. dosym /etc/qcontrol/ts209.lua /etc/qcontrol.conf ;;
  39. "QNAP TS-119/TS-219")
  40. dosym /etc/qcontrol/ts219.lua /etc/qcontrol.conf ;;
  41. "QNAP TS-409")
  42. dosym /etc/qcontrol/ts409.lua /etc/qcontrol.conf ;;
  43. "QNAP TS-41x")
  44. dosym /etc/qcontrol/ts41x.lua /etc/qcontrol.conf ;;
  45. *)
  46. ewarn "Your device is unsupported" ;;
  47. esac
  48. }