summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-extended/cloud-init/cloud-init_0.7.6.bb
blob: c6b3529b3d3177131dbdde390c7330abd563b2bd (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
DESCRIPTION = "Init scripts for use on cloud images"
HOMEPAGE = "https://launchpad.net/cloud-init"
SECTION = "devel/python"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d32239bcb673463ab874e80d47fae504"

PR = "r0"

SRC_URI = "https://launchpad.net/cloud-init/trunk/${PV}/+download/${BPN}-${PV}.tar.gz \
           file://cloud-init-source-local-lsb-functions.patch \
           file://distros-add-windriver-skeleton-distro-file.patch \
           file://cloud.cfg"

SRC_URI[md5sum] = "cd392e943dd0165e90a6d56afd0e4ad3"
SRC_URI[sha256sum] = "9e8fd22eb7f6e40ae6a5f66173ddc3cc18f65ee406c460a728092b37db2f3ed7"

S = "${WORKDIR}/${BPN}-${PV}"

DISTUTILS_INSTALL_ARGS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '--init-system=sysvinit_deb', '', d)}"
DISTUTILS_INSTALL_ARGS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--init-system=systemd', '', d)}"

MANAGE_HOSTS ?= "False"
HOSTNAME ?= ""

do_install_prepend() {
    sed -e 's:/lib/${BPN}:${base_libdir}/${BPN}:' -i ${S}/setup.py
}

do_install_append() {
    install -m 0755 ${WORKDIR}/cloud.cfg ${D}${sysconfdir}/cloud/cloud.cfg

    sed -e "s:%MANAGE_HOSTS%:${MANAGE_HOSTS}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg
    sed -e "s:%HOSTNAME%:${HOSTNAME}:g" -i ${D}${sysconfdir}/cloud/cloud.cfg

    ln -s ${libdir}/${BPN}/uncloud-init ${D}${sysconfdir}/cloud/uncloud-init
    ln -s ${libdir}/${BPN}/write-ssh-key-fingerprints ${D}${sysconfdir}/cloud/write-ssh-key-fingerprints
}

inherit setuptools update-rc.d

PACKAGES += "${PN}-systemd"

FILES_${PN} += "${sysconfdir}/* \
                ${datadir}/*"

FILES_${PN}-systemd += "${systemd_unitdir}/*"

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${BPN} = "cloud-init"

RDEPENDS_${PN} = "sysklogd \
                  python \
                 "