aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/cloud9/cloud9_0.5.1.bb
blob: 8afc9e2cf8a55171793f0046ad7ae6d7d6dc6277 (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
DESCRIPTION = "Meet Cloud9, development-as-a-service for Javascripters and other developers"
HOMEPAGE = "http://c9.io"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://LICENSE;md5=4784c3bcff601fd8f9515f52a11e7018"

PR = "r3"

SRC_URI = "git://github.com/jadonk/cloud9.git;protocol=git \
           file://cloud9.service \
          "

SRCREV = "08bae1d1cc2ba9f7f883a25afd07f0339a82fa8b"
S = "${WORKDIR}/git"

# Most of cloud9 is in git submodules that still need to be fetched.
do_configure_prepend () {
 git submodule update --init --recursive
}

# There's nothing left to be compiled at this time.
# node-o3-xml is the only compiled code module in here.
# The repository has binaries for:
#  Linux ARM armv7
#  Linux x86 32/64-bit
#  Sun Solaris 32-bit
#  Mac x86 32/64-bit
#  Windows x86 32-bit
do_compile () {
:
}

do_install () {
 install -m 0755 -d ${D}/usr/share/cloud9 ${D}${bindir} ${D}/var/lib/cloud9
 rsync -r --exclude=".*" ${S}/* ${D}/usr/share/cloud9

 for i in cygwin darwin linux32 linux64 sunos ; do
   rm -f ${D}/usr/share/cloud9/support/node-builds-v4/*$i*
   rm -f ${D}/usr/share/cloud9/support/jsdav/support/node-o3-xml-v4/lib/o3-xml/*$i*
   rm -f ${D}//usr/share/cloud9/support/gnu-builds/*$i*
 done

 touch ${D}${bindir}/cloud9
 echo "#!/bin/sh" > ${D}${bindir}/cloud9
 echo "node /usr/share/cloud9/bin/cloud9.js -l 0.0.0.0 -w /var/lib/cloud9 -p 3000" >> ${D}${bindir}/cloud9
 chmod 0755 ${D}${bindir}/cloud9

 install -d ${D}${base_libdir}/systemd/system
 install -m 0644 ${WORKDIR}/*.service ${base_libdir}/systemd/system/
}


FILES_${PN}-dbg += "/usr/share/cloud9/support/jsdav/support/node-o3-xml-v4/lib/o3-xml/.debug"

FILES_${PN} += "${base_libdir}/systemd/system"
RDEPENDS_${PN} = "nodejs gzip"

pkg_postinst_${PN} () {
    # can't do this offline
    if [ "x$D" != "x" ]; then
        exit 1
    fi

    if [ -e ${base_bindir}/systemctl ] ; then
        systemctl enable cloud9.service
    fi
}