# Copyright 2012 Guillermo Ramos # Distributed under the terms of the GNU General Public License v2 # Based in part upon 'razercfg-0.17.ebuild' from Gentoo, which is: # Copyright 1999-2012 Gentoo Foundation require cmake [ api=2 out_of_source=false ] systemd-service SUMMARY="Utility for advanced configuration of Razer mice (DeathAdder, Krait, Lachesis)" HOMEPAGE="http://bues.ch/cms/hacking/razercfg.html" DOWNLOADS="http://bues.ch/${PN}/${PNV}.tar.bz2" LICENCES="GPL-2" MYOPTIONS=" baselayout pm-utils [[ description = [ Add hibernate/resume support ] ]] qt4 [[ description = [ Install graphical configuration tool (qrazercfg) ] ]] " DEPENDENCIES=" build+run: dev-lang/python pm-utils? ( sys-power/pm-utils ) qt4? ( dev-python/PyQt4 ) " src_prepare() { edo sed -i \ -e '/ldconfig/{N;d}' \ -e "s:/etc/udev/rules.d/:/usr/${LIBDIR}/udev/rules.d/:" \ -e "s:/etc/pm/sleep.d:/usr/${LIBDIR}/pm-utils/sleep.d/:" \ -e '/udevadm control/{N;d}' \ -e 's:01-razer-udev.rules:40-razercfg.rules:' \ -e 's:50-razer:80razer:' \ librazer/CMakeLists.txt } DEFAULT_SRC_INSTALL_EXTRA_DOCS=( razer.conf ) src_install() { edo sed -i \ -e "s:\${CMAKE_INSTALL_PREFIX}/lib:\${CMAKE_INSTALL_PREFIX}/${LIBDIR}:" \ librazer/cmake_install.cmake cmake_src_install install_systemd_files option baselayout && newinitd "${FILES}"/razerd.init.d razerd option pm-utils || edo rm -r "${IMAGE}"/usr/"${LIBDIR}"/pm-utils if option qt4; then insinto /usr/share/applications doins "${FILES}"/qrazercfg.desktop else edo rm "${IMAGE}"/usr/bin/qrazercfg fi } pkg_postinst() { esandbox allow_net --connect 'unix:/run/udev/control' nonfatal edo udevadm control --reload-rules && udevadm trigger --subsystem-match=usb } BUGS_TO="0xwille@gmail.com"