cfengine: add recipe and base policy

Add recipes of cfengine and cfengine-masterfiles which provides base
policy files.

There are 3 optional database backend: qdbm, tokyocabinet and lmdb with
descending priority. Package tokyocabinet is released as a rework of
qdbm by same upstream author, so it is choosen to be default database
backend.

See:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452657

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Kai Kang
2016-07-18 09:06:06 +08:00
committed by Martin Jansa
parent 898b3977af
commit 06e58b6f54
5 changed files with 187 additions and 0 deletions
@@ -0,0 +1,28 @@
Upstream-Status: Inappropriate [configuration]
Directory /usr/local is not used for us. Remove the policy that not to install
binaries to /usr/local/sbin.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
diff --git a/cfe_internal/update/update_bins.cf b/cfe_internal/update/update_bins.cf
index 1796caa..697af0d 100644
--- a/cfe_internal/update/update_bins.cf
+++ b/cfe_internal/update/update_bins.cf
@@ -55,16 +55,6 @@ bundle agent cfe_internal_bins
depth_search => u_recurse_basedir("inf"),
action => u_immediate;
- "/usr/local/sbin/$(agents)"
- comment => "Create symlinks of CFE binaries in /usr/local/sbin",
- handle => canonify("cfe_internal_bins_files_sbin_$(agents)"),
- move_obstructions => "true",
- link_from => u_ln_s("$(sys.workdir)/bin/$(agents)");
-
- "/usr/local/sbin/$(agents).cfsaved"
- comment => "Remove all .cfsaved file extension",
- handle => canonify("cfe_internal_bins_files_remove_$(agent)_cfsaved"),
- delete => u_tidy;
}
bundle agent cfe_internal_update_bins
@@ -0,0 +1,37 @@
#
# Copyright (C) 2014 - 2016 Wind River Systems, Inc.
#
SUMMARY = "Base policy for CFEngine"
DESCRIPTION = "CFEngine is an IT infrastructure automation framework \
that helps engineers, system administrators and other stakeholders \
in an IT system to manage and understand IT infrastructure throughout \
its lifecycle. CFEngine takes systems from Build to Deploy, Manage and Audit. \
\
This package is intended to provide a stable base policy for \
installations and upgrades, and is used by CFEngine 3.6 and newer. \
\
The contents of this packge are intended to live in `/var/cfengine/masterfiles` \
or wherever `$(sys.masterdir)` points. \
"
HOMEPAGE = "http://cfengine.com"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=52cd3d13af93180822888ab0088e9328"
SRC_URI = "https://cfengine-package-repos.s3.amazonaws.com/tarballs/${BP}.tar.gz \
file://remove-policy-of-usr-local-sbin.patch \
"
SRC_URI[md5sum] = "b101ddcd546738af6ec91be5c297cb24"
SRC_URI[sha256sum] = "63dec2f8649f5f2788cd463dccf47f8dbe941522acfcf3093517f983bbfa0606"
inherit autotools
export EXPLICIT_VERSION="${PV}"
EXTRA_OECONF = "--prefix=${localstatedir}/cfengine"
FILES_${PN} += "${localstatedir}/cfengine"
RDEPENDS_${PN} += "python-core"
@@ -0,0 +1,28 @@
Upstream-Status: Inappropriate [configuration]
projlibdir use a hard coded lib path, this will cause error when build a 64bit
target. So change it to suitable path.
Signed-off-by: Song.Li <Song.Li@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 38e2b9c..bc6b996 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,7 +188,7 @@ AS_IF([test x"$enable_fhs" = xyes], [
fi
sbindir='${exec_prefix}/bin' # /var/cfengine/bin despite being sbin_?
- projlibdir='${exec_prefix}/lib'
+ projlibdir='${libdir}'
mandir='${exec_prefix}/share/man'
])
--
1.7.1
@@ -0,0 +1,23 @@
Upstream-Status: Inappropriate [configuration]
Set the path of default configure file.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
diff --git a/misc/init.d/cfengine3.in b/misc/init.d/cfengine3.in
index d6ae26f..1dee283 100644
--- a/misc/init.d/cfengine3.in
+++ b/misc/init.d/cfengine3.in
@@ -101,11 +101,7 @@ if [ -z "$LOCKDIR" ]; then
fi
# default control file
-if [ "$DEBIAN" = "1" ]; then
- DEFAULT=/etc/default/cfengine3
-else
- DEFAULT=/etc/sysconfig/cfengine3
-fi
+DEFAULT=/etc/default/cfengine3
if [ -f $DEFAULT ]; then
. $DEFAULT
@@ -0,0 +1,71 @@
#
# Copyright (C) 2014 - 2016 Wind River Systems, Inc.
#
SUMMARY = "CFEngine is an IT infrastructure automation framework"
DESCRIPTION = "CFEngine is an IT infrastructure automation framework \
that helps engineers, system administrators and other stakeholders \
in an IT system to manage and understand IT infrastructure throughout \
its lifecycle. CFEngine takes systems from Build to Deploy, Manage and Audit."
HOMEPAGE = "http://cfengine.com"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cd59c3650c8b7ff36bab1cc6587b097a"
DEPENDS = "attr tokyocabinet"
SRC_URI = "https://cfengine-package-repos.s3.amazonaws.com/tarballs/${BP}.tar.gz \
file://change-hard-coded-lib-path.patch \
file://set-path-of-default-config-file.patch \
"
SRC_URI[md5sum] = "63da39655cfca30ca885fcc4a1bf8aa4"
SRC_URI[sha256sum] = "32a38aedf1199c2361e1335e0d4a1d98f9efa7cd591bcb647f35c7395bb66f2d"
inherit autotools systemd
export EXPLICIT_VERSION="${PV}"
SYSTEMD_SERVICE_${PN} = "cfengine3.service cfengine3-web.service"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"
PACKAGECONFIG ??= "libpcre openssl \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
"
PACKAGECONFIG[libxml2] = "--with-libxml2=yes,--with-libxml2=no,libxml2,"
PACKAGECONFIG[mysql] = "--with-mysql=yes,--with-mysql=no,mysql,"
PACKAGECONFIG[postgresql] = "--with-postgresql=yes,--with-postgresql=no,postgresql,"
PACKAGECONFIG[acl] = "--with-libacl=yes,--with-libacl=no,acl,"
PACKAGECONFIG[libvirt] = "--with-libvirt=yes,--with-libvirt=no,libvirt,"
PACKAGECONFIG[libpcre] = "--with-pcre=yes,--with-pcre=no,libpcre,"
PACKAGECONFIG[openssl] = "--with-openssl=yes,--with-openssl=no,openssl,"
PACKAGECONFIG[pam] = "--with-pam=yes,--with-pam=no,libpam,"
PACKAGECONFIG[libyaml] = "--with-libyaml,--without-libyaml,libyaml,"
PACKAGECONFIG[systemd] = "--with-systemd-service=${systemd_system_unitdir},--without-systemd-service"
PACKAGECONFIG[libcurl] = "--with-libcurl,--without-libcurl,curl,"
EXTRA_OECONF = "hw_cv_func_va_copy=yes --with-init-script=${sysconfdir}/init.d --with-tokyocabinet"
do_install_append() {
install -d ${D}${localstatedir}/${BPN}/bin
for f in `ls ${D}${bindir}`; do
ln -s ${bindir}/`basename $f` ${D}${localstatedir}/${BPN}/bin/
done
install -d ${D}${sysconfdir}/default
cat << EOF > ${D}${sysconfdir}/default/cfengine3
RUN_CF_SERVERD=1
RUN_CF_EXECD=1
RUN_CF_MONITORD=1
RUN_CF_HUB=0
EOF
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -m 0755 -D ${D}${sysconfdir}/init.d/cfengine3 ${D}${datadir}/${BPN}/cfengine3
sed -i -e 's#/etc/init.d#${datadir}/${BPN}#' ${D}${systemd_system_unitdir}/*.service
fi
}
RDEPENDS_${PN} += "${BPN}-masterfiles"