razercfg-0.23.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit cmake-utils multilib eutils udev python-single-r1
  6. DESCRIPTION="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)"
  7. HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html"
  8. SRC_URI="http://bues.ch/${PN}/${P}.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 x86"
  12. IUSE="+pm-utils qt4"
  13. RDEPEND="${DEPEND}
  14. pm-utils? ( sys-power/pm-utils )
  15. qt4? ( dev-python/PyQt4 )"
  16. DEPEND="${DEPEND}"
  17. src_prepare() {
  18. sed -i \
  19. -e '/ldconfig/{N;d}' \
  20. -e '/udevadm control/{N;d}' \
  21. -e "s:/etc/udev/rules.d/:$(get_udevdir)/rules.d/:" \
  22. -e 's:01-razer-udev.rules:40-razercfg.rules:' \
  23. -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
  24. -e 's:50-razer:80razer:' \
  25. librazer/CMakeLists.txt \
  26. || die "sed failed"
  27. }
  28. src_install() {
  29. cmake-utils_src_install
  30. newinitd "${FILESDIR}"/razerd.init.d-r1 razerd
  31. dodoc README razer.conf
  32. if ! use qt4; then
  33. rm "${D}"/usr/bin/qrazercfg
  34. else
  35. make_desktop_entry qrazercfg "Razer Mouse Settings" mouse "Qt;Settings"
  36. fi
  37. use pm-utils || rm "${D}"/usr/$(get_libdir)/pm-utils/sleep.d/80razer
  38. python_fix_shebang "${ED}"usr/bin
  39. }
  40. pkg_postinst() {
  41. udevadm control --reload-rules && udevadm trigger --subsystem-match=usb
  42. }