base.bbclass: Use 'unzip' for *.jar files as well.
[vuplus_openembedded] / packages / gpsd / gpsd.inc
1 DESCRIPTION = "A TCP/IP Daemon simplifying the communication with GPS devices"
2 SECTION = "console/network"
3 PRIORITY = "optional"
4 LICENSE = "GPL"
5 DEPENDS = "dbus-glib ncurses python"
6 RDEPENDS_${PN} = "gpsd-conf gpsd-gpsctl"
7
8 EXTRA_OECONF = "--x-includes=${STAGING_INCDIR}/X11 \
9                 --x-libraries=${STAGING_LIBDIR} \
10                 --enable-dbus \
11                 --enable-python"
12
13 SRC_URI = "http://download.berlios.de/gpsd/gpsd-${PV}.tar.gz \
14            file://gpsd-default \
15            file://gps-hardware \
16            file://gpsd"
17
18 SRC_URI_append_om-gta01 = " \
19            file://restart_gllin.sh \
20 "
21                            
22 inherit autotools update-rc.d
23
24 INITSCRIPT_NAME = "gpsd"
25 INITSCRIPT_PARAMS = "defaults 35"
26
27 export LDFLAGS = "-L${STAGING_LIBDIR} -lm"
28
29 do_compile_prepend() {
30     export BUILD_SYS="${BUILD_SYS}"
31     export HOST_SYS="${HOST_SYS}"
32         find ${S} -name "*.so" -exec rm -f {} \;
33 }
34
35 do_install_prepend() {
36     export BUILD_SYS="${BUILD_SYS}"
37     export HOST_SYS="${HOST_SYS}"
38 }
39
40 do_stage() {
41         oe_libinstall -so libgps ${STAGING_LIBDIR}
42         install -m 0644 ${S}/gps.h ${STAGING_INCDIR}
43         install -m 0644 ${S}/gpsd.h ${STAGING_INCDIR}
44 }
45
46 do_install_append() {
47         install -d ${D}/${sysconfdir}/init.d
48         install -d ${D}/dev
49         install -m 0755 ${WORKDIR}/gpsd ${D}/${sysconfdir}/init.d/
50         install -m 0755 ${WORKDIR}/gps-hardware ${D}/${sysconfdir}/init.d/gps-hardware.default
51         install -d ${D}/${sysconfdir}/default
52         install -m 0644 ${WORKDIR}/gpsd-default ${D}/${sysconfdir}/default/gpsd.default
53 }
54
55 do_install_append_om-gta01() {
56         install -d ${D}/${sysconfdir}/apm/resume.d
57         install -m 755 ${WORKDIR}/restart_gllin.sh ${D}/${sysconfdir}/apm/resume.d
58 }
59
60 pkg_postinst_${PN}-conf() {
61         update-alternatives --install ${sysconfdir}/default/gpsd gpsd-defaults ${sysconfdir}/default/gpsd.default 10
62         update-alternatives --install ${sysconfdir}/init.d/gps-hardware gps-hardware ${sysconfdir}/init.d/gps-hardware.default 10
63 }
64
65 pkg_postrm_${PN}-conf() {       
66         update-alternatives --remove gpsd-defaults ${sysconfdir}/default/gpsd.default
67         update-alternatives --remove gps-hardware ${sysconfdir}/init.d/gps-hardware.default             
68 }
69
70 SRC_URI_OVERRIDES_PACKAGE_ARCH = "0"
71
72 PACKAGES =+ "libgps python-pygps gpsd-conf gpsd-gpsctl gps-utils"
73
74 PACKAGE_ARCH_gpsd-conf = "${MACHINE_ARCH}"
75
76 FILES_libgps = "${libdir}/*.so.*"
77 FILES_gpsd-conf = "${sysconfdir}"
78 FILES_gpsd-gpsctl = "${bindir}/gpsctl"
79 FILES_gps-utils = "${bindir}/*"
80 # might split them up even more fine granular
81 RDEPENDS_gps-utils = "python-pygps"
82
83 DESCRIPTION_python-pygps = "Python bindings to gpsd"
84 FILES_python-pygps = "${libdir}/*/site-packages/*"
85 RDEPENDS_python-pygps = "python-core python-curses gpsd"
86