summaryrefslogtreecommitdiff
blob: 5eb19ec65ea6c7d34adbac40127e22ccb1d60ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-geosciences/gpsd/gpsd-2.34.ebuild,v 1.1 2007/01/14 22:15:46 nerdboy Exp $

inherit eutils autotools distutils

DESCRIPTION="GPS daemon and library to support USB/serial GPS devices and various GPS/mapping clients."
HOMEPAGE="http://gpsd.berlios.de/"
SRC_URI="http://download.berlios.de/gpsd/${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~arm ~amd64 ~ppc ~ppc64 ~sparc ~x86"

IUSE="dbus italk itrax minimal ntp python static tntc usb X"

RDEPEND="X? ( || (
		( x11-libs/libXmu
		x11-libs/libXext
		x11-libs/libXp
		x11-libs/libX11
		x11-libs/libXt
		x11-libs/libSM
		x11-libs/libICE
		x11-libs/libXpm
		x11-libs/libXaw )
		|| (
		    x11-libs/lesstif
		    x11-libs/openmotif
		)
		( virtual/motif
			virtual/x11 )
		)
	)
	python? ( dev-lang/python )
	app-text/xmlto
	dbus? ( >=sys-apps/dbus-0.6 )
	ntp? ( net-misc/ntp )
	usb? ( virtual/dev-manager )"

DEPEND="${RDEPEND}
	X? ( || (
	    ( x11-proto/xproto x11-proto/xextproto )
		virtual/x11
	    )
	)"

RESTRICT="test"

WANT_AUTOMAKE="latest"
WANT_AUTOCONF=2.5

src_unpack() {
	unpack ${A}
	cd ${S}
	eautoreconf
}

src_compile() {
	use python && distutils_python_version

	local my_conf="--enable-shared"

	if ! use static; then
	    my_conf="${my_conf} --with-pic --disable-static"
	else
	    my_conf="${my_conf} --enable-static"
	fi

	if ! use ntp; then
	    my_conf="${my_conf} --disable-ntpshm"
	fi

	if use minimal; then
	    local max_clients="5"
	    local max_devices="1"
	    my_conf="${my_conf} --enable-squelch --disable-pps"
	    my_conf="${my_conf} --enable-max-clients=${max_clients} --enable-max-devices=${max_devices}"
	fi

	econf ${my_conf} $(use_enable dbus) $(use_enable tntc tnt) \
	    $(use_with X x) $(use_enable italk) $(use_enable itrax) \
	    $(use_enable python) || die "econf failed"

	emake LDFLAGS="${LDFLAGS} -lm" || die "emake failed"
}

src_install() {
	cd ${S}
	make DESTDIR=${D} install

	if use usb ; then
	    insinto /etc/hotplug/usb
	    doins gpsd.usermap
	    exeinto /etc/hotplug/usb
	    doexe gpsd.hotplug
	    keepdir /var/run/usb # needed for REMOVER
	else
	    newconfd ${FILESDIR}/gpsd.conf gpsd
	    newinitd ${FILESDIR}/gpsd.init gpsd
	fi
	if use X ; then
	    insinto /etc/X11/app-defaults
	    newins xgps.ad Xgps
	    newins xgpsspeed.ad Xgpsspeed
	fi
	dobin logextract
	diropts "-m0644"
	if use python ; then
	    exeinto /usr/$(get_libdir)/python${PYVER}/site-packages
	    doexe gps.py gpsfake.py gpspacket.so
	fi
	dodoc AUTHORS COPYING INSTALL README TODO
}

pkg_postinst() {
	einfo ""
	einfo "This version of gpsd no longer requires updates many devices and"
	einfo "should no longer require any specific arguments.  The gpsd daemon"
	einfo "should now start first.  You should probably have >=udev-096-r1"
	einfo "for hotplug and general usb device detection to work correctly."
	einfo ""
	einfo "Different GPS devices require the corresponding kernel options"
	einfo "to be enabled, such as USB_SERIAL_GARMIN, or a USB serial driver"
	einfo "for an adapter such as those that come with Deluo GPS units (eg,"
	einfo "USB_SERIAL_PL2303). Straight serial devices should always work,"
	einfo "even without udev/hotplug support."
	einfo ""
	einfo "Read the INSTALL doc for more information on supported hardware,"
	einfo "and make sure udev has the right group permissions set on the tty"
	einfo "devices if using USB (it should Do The Right Thing (TM))..."
	einfo ""
}