2017-08-25 09:22:31 +03:00
|
|
|
# Copyright 1999-2017 Gentoo Foundation
|
2012-02-06 16:39:49 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
2016-11-22 00:52:08 +03:00
|
|
|
EAPI=6
|
2012-02-06 16:39:49 +04:00
|
|
|
inherit eutils
|
|
|
|
|
|
|
|
DESCRIPTION="Unofficial tool for controlling the Razer Copperhead mouse"
|
|
|
|
HOMEPAGE="http://razertool.sourceforge.net/"
|
|
|
|
SRC_URI="mirror://sourceforge/${PN}/${P/-/_}.orig.tar.gz"
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
IUSE="gtk"
|
|
|
|
|
|
|
|
RDEPEND="virtual/libusb:0
|
|
|
|
gtk? (
|
2016-11-22 00:52:08 +03:00
|
|
|
dev-libs/atk
|
|
|
|
dev-libs/glib:2
|
2012-02-06 16:39:49 +04:00
|
|
|
>=gnome-base/librsvg-2.0
|
|
|
|
>=x11-libs/cairo-1.0.0
|
2016-11-22 00:52:08 +03:00
|
|
|
x11-libs/gdk-pixbuf
|
|
|
|
>=x11-libs/gtk+-2.8.0:2
|
|
|
|
)"
|
2012-02-06 16:39:49 +04:00
|
|
|
DEPEND="${RDEPEND}
|
2012-05-04 08:09:11 +04:00
|
|
|
virtual/pkgconfig"
|
2012-02-06 16:39:49 +04:00
|
|
|
|
2016-11-22 00:52:08 +03:00
|
|
|
DOCS=( AUTHORS ChangeLog NEWS README )
|
|
|
|
|
2012-02-06 16:39:49 +04:00
|
|
|
src_prepare() {
|
2016-11-22 00:52:08 +03:00
|
|
|
default
|
|
|
|
|
2012-02-06 16:39:49 +04:00
|
|
|
sed -i razertool.rules.example \
|
|
|
|
-e 's:ACTION=="add", ::;s:BUS=:SUBSYSTEMS=:;s:SYSFS{:ATTRS{:g' \
|
|
|
|
|| die "sed razertool.rules.example action failed"
|
|
|
|
|
|
|
|
# plugdev group may not exist (created by hal), default to usb
|
|
|
|
sed -i razertool.rules.example \
|
|
|
|
-e 's:plugdev:usb:' \
|
|
|
|
|| die "sed razertool.rules.example plugdev failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_configure() {
|
|
|
|
econf $(use_enable gtk)
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
2016-11-22 00:52:08 +03:00
|
|
|
default
|
2012-02-06 16:39:49 +04:00
|
|
|
|
|
|
|
insinto /lib/udev/rules.d
|
2016-11-22 00:52:08 +03:00
|
|
|
newins razertool.rules.example 90-razertool.rules
|
2012-02-06 16:39:49 +04:00
|
|
|
|
|
|
|
# Icon and desktop entry
|
2017-08-25 09:22:31 +03:00
|
|
|
dosym ../razertool/pixmaps/razertool-icon.png /usr/share/pixmaps/razertool-icon.png
|
2012-02-06 16:39:49 +04:00
|
|
|
make_desktop_entry "razertool-gtk" "RazerTool" ${PN}-icon "GTK;Settings;HardwareSettings"
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
elog "Razer Copperhead mice need firmware version 6.20 or higher"
|
|
|
|
elog "to work properly. Running ${PN} on mice with older firmwares"
|
|
|
|
elog "might lead to random USB-disconnects."
|
|
|
|
elog "To run as non-root, add yourself to the usb group:"
|
|
|
|
elog " gpasswd -a <user> usb"
|
|
|
|
elog "or adapt permissions/owner/group in:"
|
|
|
|
elog " /etc/udev/rules.d/90-razertool.rules"
|
|
|
|
elog "Then unplug and plug in the mouse."
|
|
|
|
}
|