usb_modeswitch-2.4.0-r1.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2017 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="20160803"
  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. epatch "${FILESDIR}/usb_modeswitch.sh-tmpdir.patch"
  32. }
  33. src_compile() {
  34. emake CC="$(tc-getCC)"
  35. }
  36. src_install() {
  37. emake \
  38. DESTDIR="${D}" \
  39. SYSDIR="${D}/$(systemd_get_unitdir)" \
  40. UDEVDIR="${D}/$(get_udevdir)" \
  41. $(usex jimtcl install-shared install)
  42. # Even if we set SYSDIR above, the Makefile is causing automagic detection of `systemctl` binary,
  43. # which is why we need to force the .service file to be installed:
  44. systemd_dounit ${PN}@.service
  45. dodoc ChangeLog README
  46. pushd ../${MY_PN}-data-${DATA_VER} >/dev/null
  47. emake \
  48. DESTDIR="${D}" \
  49. RULESDIR="${D}/$(get_udevdir)/rules.d" \
  50. files-install db-install
  51. docinto data
  52. dodoc ChangeLog README
  53. popd >/dev/null
  54. }