blob: b86b0a1f18a00a03b90008c7b0f6c6c5b6e0b4c0 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001#
2# Copyright (C) 2014 - 2017 Wind River Systems, Inc.
3#
4SUMMARY = "CFEngine is an IT infrastructure automation framework"
5
6DESCRIPTION = "CFEngine is an IT infrastructure automation framework \
7that helps engineers, system administrators and other stakeholders \
8in an IT system to manage and understand IT infrastructure throughout \
9its lifecycle. CFEngine takes systems from Build to Deploy, Manage and Audit."
10
11HOMEPAGE = "http://cfengine.com"
12
13LICENSE = "GPLv3"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=f8b34828ab373d6b1bb4b0fc60a78494"
15
16DEPENDS = "attr tokyocabinet"
17
18SRC_URI = "https://cfengine-package-repos.s3.amazonaws.com/tarballs/${BP}.tar.gz \
19 file://change-hard-coded-lib-path.patch \
20 file://set-path-of-default-config-file.patch \
21"
22
23SRC_URI[md5sum] = "c16baf08189a1af6fcf2e2ff61102992"
24SRC_URI[sha256sum] = "d4fa9ac7276dba7b85d6757aab2f0929ab8d3b115cb0e7b0cf984760347429d7"
25
26inherit autotools systemd
27
28export EXPLICIT_VERSION="${PV}"
29
30SYSTEMD_SERVICE_${PN} = "cfengine3.service cf-apache.service cf-hub.service cf-postgres.service \
31 cf-runalerts.service cf-consumer.service cf-execd.service \
32 cf-monitord.service cf-redis-server.service cf-serverd.service \
33"
34SYSTEMD_AUTO_ENABLE_${PN} = "disable"
35
36PACKAGECONFIG ??= "libpcre openssl \
37 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \
38"
39PACKAGECONFIG[libxml2] = "--with-libxml2=yes,--with-libxml2=no,libxml2,"
40PACKAGECONFIG[mysql] = "--with-mysql=yes,--with-mysql=no,mysql,"
41PACKAGECONFIG[postgresql] = "--with-postgresql=yes,--with-postgresql=no,postgresql,"
42PACKAGECONFIG[acl] = "--with-libacl=yes,--with-libacl=no,acl,"
43PACKAGECONFIG[libvirt] = "--with-libvirt=yes,--with-libvirt=no,libvirt,"
44PACKAGECONFIG[libpcre] = "--with-pcre=yes,--with-pcre=no,libpcre,"
45PACKAGECONFIG[openssl] = "--with-openssl=yes,--with-openssl=no,openssl,"
46PACKAGECONFIG[pam] = "--with-pam=yes,--with-pam=no,libpam,"
47PACKAGECONFIG[libyaml] = "--with-libyaml,--without-libyaml,libyaml,"
48PACKAGECONFIG[systemd] = "--with-systemd-service=${systemd_system_unitdir},--without-systemd-service"
49PACKAGECONFIG[libcurl] = "--with-libcurl,--without-libcurl,curl,"
50
51EXTRA_OECONF = "hw_cv_func_va_copy=yes --with-init-script=${sysconfdir}/init.d --with-tokyocabinet"
52
53do_install_append() {
54 install -d ${D}${localstatedir}/${BPN}/bin
55 for f in `ls ${D}${bindir}`; do
56 ln -s ${bindir}/`basename $f` ${D}${localstatedir}/${BPN}/bin/
57 done
58
59 install -d ${D}${sysconfdir}/default
60 cat << EOF > ${D}${sysconfdir}/default/cfengine3
61RUN_CF_SERVERD=1
62RUN_CF_EXECD=1
63RUN_CF_MONITORD=1
64RUN_CF_HUB=0
65EOF
66
67 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
68 install -m 0755 -D ${D}${sysconfdir}/init.d/cfengine3 ${D}${datadir}/${BPN}/cfengine3
69 sed -i -e 's#/etc/init.d#${datadir}/${BPN}#' ${D}${systemd_system_unitdir}/*.service
70 fi
71}
72
73RDEPENDS_${PN} += "${BPN}-masterfiles"