1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils linux-info systemd toolchain-funcs udev
9 DESCRIPTION="The spacenavd daemon provides free alternative to the 3dxserv daemon"
10 HOMEPAGE="http://spacenav.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/project/${MY_PN}/${MY_PN}%20daemon/${PN}%20${PV}/${P}.tar.gz"
14 KEYWORDS="~amd64 ~ppc64 ~x86"
17 RDEPEND="X? ( x11-apps/xdpyinfo )"
21 CONFIG_CHECK="~INPUT_EVDEV"
22 ERROR_CFG="Your kernel needs INPUT_EVDEV for the spacenavd to work properly"
27 epatch "${FILESDIR}"/${P}-destdir.patch
28 epatch "${FILESDIR}"/${P}-custom-flags.patch
29 epatch "${FILESDIR}"/${P}-no-x11.patch
34 --enable-opt --enable-ldopt \
39 emake CC="$(tc-getCC)"
45 newins "${S}/doc/example-spnavrc" spnavrc.sample
48 newinitd "${FILESDIR}/spnavd" spacenavd
49 systemd_dounit "${FILESDIR}/spacenavd.service"
51 # Install udev rule but leave activiation to the user
52 # since Xorg may be configured to grab the device already
53 udev_newrules "${FILESDIR}"/99-space-navigator.rules-r1 99-space-navigator.rules.ignored
56 dobin "${S}/spacenavd"
57 use X && dobin "${S}/spnavd_ctl"
61 elog "To start the Spacenav daemon system-wide by default"
62 elog "you should add it to the default runlevel :"
63 elog "\`rc-update add spacenavd default\` (for openRC)"
64 elog "\`systemctl enable spacenavd\` (for systemd)"
67 elog "To start generating Spacenav X events by default"
68 elog "you should add this command in your user startup"
69 elog "scripts such as .gnomerc or .xinitrc :"
70 elog "\`spnavd_ctl x11 start\`"
74 elog "If you want to auto-start the daemon when you plug in"
75 elog "a SpaceNavigator device, activate the related udev rule :"
76 elog "\`sudo ln -s $(get_udevdir)/rules.d/99-space-navigator.rules.ignored /etc/udev/rules.d\`"
77 ewarn "You must restart spnavd \`/etc/init.d/spacenavd restart\` to run"
78 ewarn "the new version of the daemon or \`systemctl restart spacenavd\`"
79 ewarn "if using systemd."