usb_modeswitch-2.2.6.ebuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils linux-info toolchain-funcs udev systemd
  5. MY_PN=${PN/_/-}
  6. MY_P=${MY_PN}-${PV/_p*}
  7. #DATA_VER=${PV/*_p}
  8. DATA_VER="20151101"
  9. DESCRIPTION="A tool for controlling 'flip flop' (multiple devices) USB gear like UMTS sticks"
  10. HOMEPAGE="http://www.draisberghof.de/usb_modeswitch/ http://www.draisberghof.de/usb_modeswitch/device_reference.txt"
  11. SRC_URI="http://www.draisberghof.de/${PN}/${MY_P}.tar.bz2
  12. http://www.draisberghof.de/${PN}/${MY_PN}-data-${DATA_VER}.tar.bz2"
  13. LICENSE="GPL-2"
  14. SLOT="0"
  15. KEYWORDS="amd64 arm x86"
  16. IUSE="jimtcl"
  17. COMMON_DEPEND="
  18. virtual/udev
  19. virtual/libusb:1
  20. "
  21. RDEPEND="${COMMON_DEPEND}
  22. jimtcl? ( dev-lang/jimtcl )
  23. !jimtcl? ( dev-lang/tcl:0 )" # usb_modeswitch script is tcl
  24. DEPEND="${COMMON_DEPEND}
  25. virtual/pkgconfig
  26. "
  27. S=${WORKDIR}/${MY_P}
  28. CONFIG_CHECK="~USB_SERIAL"
  29. src_prepare() {
  30. sed -i -e '/install.*BIN/s:-s::' Makefile || die
  31. }
  32. src_compile() {
  33. emake CC="$(tc-getCC)"
  34. }
  35. src_install() {
  36. emake \
  37. DESTDIR="${D}" \
  38. SYSDIR="${D}/$(systemd_get_unitdir)" \
  39. UDEVDIR="${D}/$(get_udevdir)" \
  40. $(usex jimtcl install-shared install)
  41. # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
  42. # which is why we need to force the .service file to be installed:
  43. systemd_dounit ${PN}@.service
  44. dodoc ChangeLog README
  45. pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
  46. emake \
  47. DESTDIR="${D}" \
  48. RULESDIR="${D}/$(get_udevdir)/rules.d" \
  49. files-install db-install
  50. docinto data
  51. dodoc ChangeLog README
  52. popd >/dev/null
  53. }