summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorfhajny <fhajny>2015-12-08 17:15:21 +0000
committerfhajny <fhajny>2015-12-08 17:15:21 +0000
commit276f700011731ba91403dcd9dd278bfc51e1a2c1 (patch)
tree01d665c770a8fe7d858b0feae62125f08a3762f1 /sysutils
parent24644dfa52ac2019ddbe8abe3539d76e8f8ddd7a (diff)
downloadpkgsrc-276f700011731ba91403dcd9dd278bfc51e1a2c1.tar.gz
Update sysutils/cfengine3 to 3.7.2.
Patch based largely on a pull request by bahamat@: https://github.com/joyent/pkgsrc/pull/307 3.7.2: Bug fixes: - readfile() and read*list() should print an error if they fail to read file. (Redmine #7702) - Fix 'AIX_PREINSTALL_ALREADY_DONE.txt: cannot create' error message on AIX. - If there is an error saving a mustache template file it is now logged with log-level error (was inform). - Change: Clarify bootstrap/failsafe reports - Fixed several bugs which prevented CFEngine from loading libraries from the correct location. This affected several platforms. (Redmine #6708) - If file_select.file_types is set to symlink and there are regular files in the scanned directory, CFEngine no longer produces an unneccessary error message. (Redmine #6996) - Fix: Solaris packages no longer contain duplicate library files, but instead symlinks to them. (Redmine #7591) - cf-agent, cf-execd, cf-promises, cf-runagent and cf-serverd honor multiple -D, -N and -s arguments (Redmine #7191) - Fix "@endif" keyword sometimes being improperly processed by policy parser. (Redmine #7413) - It is possible to edit the same value in multiple regions of one file. (Redmine #7460) - Fix select_class not setting class when used in common bundle with slist. (Redmine #7482) - Fix broken HA policy for 3rd disaster-recovery node. - Directories should no more be changed randomly into files. (Redmine #6027) - Include latest security updates for 3.7. - Reduce malloc() thread contention on heavily loaded cf-serverd, by not exiting early in the logging function, if no message is to be printed. (Redmine #7624) - Improve cf-serverd's lock contention because of getpwnam() call. (Redmine #7643) - action_policy "warn" now correctly produces warnings instead of various other verbosity levels. (Redmine #7274) - Change: Improve efficiency and debug reports (Redmine #7527) - Change package modules permissions on hub package so that hub can execute package promises. (Redmine #7602) - No longer hang when changing permissions/ownership on fifos (Redmine #7030) - Fix exporting CSV reports through HTTPS. (Redmine #7267) - failsafe.cf will be created when needed. (Redmine #7634) - Mustache templates: Fix key when value is not a primitive. The old behavior, when iterating across a map or array of maps, was to abort if the key was requested with . The new behavior is to always replace with either the key name or the iteration position in the array. An error is printed if is used outside of a Mustache iteration section. - Legacy package promise: Result classes are now defined if the package being promised is already up to date. (Redmine #7399) - TTY detection should be more reliable. (Redmine #7606) Masterfiles: - Add: Path to svcprop in stdlib - Add: New `results` classes body [] (Redmine #7418, #7481) - Remove: Support for email settings from augments_file (Redmine #7682) 3.7.1: Bug fixes: - Fix daemons not restarting correctly on upgrade on AIX. (Redmine #7550) - Fix upgrade causing error message under systemd because of open ports. - Fix build with musl libc. (Redmine #7455) - Long promiser strings with multiple lines are now abbreviated in logs. (Redmine #3964) - Fixed a bug which could cause daemons to not to be killed correctly when upgrading or manually running "service cfengine3 stop". (Redmine #7193) - Package promise: Fix inability to install certain packages with numbers. - Fix package promise not removing dependant packages. (Redmine #7424) - Fix warning "Failed to parse csv file entry" with certain very long commands promises. (Redmine #7400) - Fix misaligned help output in cf-hub. (Redmine #7273) - Augmenting inputs from the augments_file (Redmine #7420) - Add support for failover to 3rd HA node located outside cluster. - Upgrade all dependencies for patch release. - Fix a bug which caused daemons not to be restarted on upgrade. (Redmine #7528) 3.7.0: New features: - New package promise implementation. - Full systemd support for all relevant platforms - New classes to determine whether certain features are enabled: * feature_yaml * feature_xml For the official CFEngine packages, these are always enabled, but packages from other sources may be built without the support. - New readdata() support for generic data input (CSV, YAML, JSON, or auto) - YAML support: new readyaml() function and in readdata() - CSV support: new readcsv() function and in readdata() - New string_mustache() function - New data_regextract() function - eval() can now be called with "class" as the "mode" argument, which will cause it to return true ("any") if the calculated result is non-zero, and false ("!any") if it is zero. - New list_ifelse() function - New mapjson() function as well as JSON support in maparray(). - filestat() function now supports "xattr" argument for extended attributes. - "ifvarclass" now has "if" as an alias, and "unless" as an inverse alias. - Ability to expand JSON variables directory in Mustache templates: Prefix the name with '%' for multiline expansion, '$' for compact expansion. - Ability to expand the iteration *key* in Mustache templates with @ - Canonical JSON output: JSON output has reliably sorted keys so the same data structure will produce the same JSON every time. - New "@if minimum_version(x.x)" syntax in order to hide future language improvements from versions that don't understand them. - compile time option (--with-statedir) to override the default state/ directory path. - Fix error messages/ handling in process signalling which no longer allowed any signals to fail silently - Also enable shortcut keyword for cf-serverd classic protocol, eg to simplify the bootstrap process for clients that have different sys.masterdir settings (Redmine #3697) - methods promises now accepts the bundle name in the promiser string, as long as it doesn't have any parameters. - In a services promise, if the service_method bundle is not specified, it defaults to the promiser string (canonified) with "service_" as a prefix. The bundle must be in the same namespace as the promise. - inline JSON in policy files: surrounding with parsejson() is now optional *when creating a new data container*. - New data_expand() function to interpolate variables in a data container. - Add configurable network bandwidth limit for all outgoing connections ("bwlimit" attribute in "body common control") . To enforce it in both directions, make sure the attribute is set on both sides of the connection. - Secure bootstrap has been facilitated by use of "cf-agent --boostrap HUB_ADDRESS --trust-server=no" - Implement new TLS-relevant options (Redmine #6883): - body common control: tls_min_version - body server control: allowtlsversion - body common control: tls_ciphers - body server control: allowciphers (preexisting) Changes: - Improved output format, less verbose, and messages are grouped. - cf-execd: agent_expireafter default was changed to 120 minutes (Redmine #7113) - All embedded databases are now rooted in the state/ directory. - TLS used as default for all outgoing connections. - process promise now reports kept status instead of repaired if a signal is not sent, even if the restart_class is set. The old behavior was to set the repaired status whenever the process was not running. (Redmine#7216). - Bootstrapping requires keys to be generated in advance using cf-key. - Disable class set on reverse lookup of interfaces IP addresses. (Redmine #3993, Redmine #6870) - Define a hard class with just the OS major version on FreeBSD. - Abort cf-agent if OpenSSL's random number generator can't be seeded securely. - Masterfiles source tarball now installs using the usual commands "./configure; make install". - Updated Emacs syntax highlighting template to support the latest syntax enhancements in 3.7. Deprecations: - Arbitrary arguments to cfruncommand (using "cf-runagent -o") are not acceptable any more. (Redmine #6978) - 3.4 is no longer supported in masterfiles. Bug fixes: - Fix server common bundles evaluation order (Redmine#7211). - Limit LMDB disk usage by preserving sparse areas in LMDB files (Redmine#7242). - Fixed LMDB corruption on HP-UX 11.23. (Redmine #6994) - Fixed insert_lines failing to converge if preserve_block was used. (Redmine #7094) - Fixed init script failing to stop/restart daemons on openvz/lxc hosts. (Redmine #3394) - rm_rf_depth now deletes base directory as advertised. (Redmine #7009) - Refactored cf-agent's connection cache to properly differentiate hosts using all needed attributes like host and port. (Redmine #4646) - Refactored lastseen database handling to avoid inconsistencies. (Redmine #6660) - cf-key --trust-key now supports new syntax to also update the lastseen database, so that clients using old protocol will trust the server correctly. - Fixed a bug which sometimes caused an agent or daemon to kill or stop itself. (Redmine #7075, #7244) - Fixed a bug which made it difficult to kill CFEngine daemons, particularly cf-execd. (Redmine #6659, #7193) - Fixed a bug causing systemd not to be detected correctly on Debian. (Redmine #7297) - "cf-promises -T" will now correctly report the checked out commit, even if you haven't checked out a Git branch. (Redmine #7332) - Reduce verbosity of harmless errors related to socket timeouts and missing thermal zone files. (Redmine #6486 and #7238) - Fix process_result logic to match the purpose of body process_select days_older_than (Redmine #3009) Masterfiles: Added: - Support for user specified overring of framework defaults without modifying policy supplied by the framework itself (see example_def.json) - Support for def.json class augmentation in update policy - Run vacuum operation on postgresql every night as a part of maintenance. - Add measure_promise_time action body to lib (3.5, 3.6, 3.7, 3.8) - New negative class guard `cfengine_internal_disable_agent_email` so that agent email can be easily disabled by augmenting def.json Changed: - Relocate def.cf to controls/VER/ - Relocate update_def to controls/VER - Relocate all controls to controls/VER - Only load cf_hub and reports.cf on CFEngine Enterprise installs - Relocate acls related to report collection from bundle server access_rules to controls/VER/reports.cf into bundle server report_access_rules - Re-organize cfe_internal splitting core from enterprise specific policies and loading the appropriate inputs only when necessary - Moved update directory into cfe_internal as it is not generally intended to be modified - services/autorun.cf moved to lib/VER/ as it is not generally intended to be modified - To improve predictibility autorun bundles are activated in lexicographical order - Relocate services/file_change.cf to cfe_internal/enterprise. This policy is most useful for a good OOTB experience with CFEngine Enterprise Mission Portal. - Relocate service_catalogue from promsies.cf to services/main.cf. It is intended to be a user entry. This name change correlates with the main bundle being activated by default if there is no bundlesequence specified. - Reduce benchmarks sample history to 1 day. - Update policy no longer generates a keypair if one is not found. (Redmine: #7167) - Relocate cfe_internal_postgresql_maintenance bundle to lib/VER/ - Set postgresql_monitoring_maintenance only for versions 3.6.0 and 3.6.1 - Move hub specific bundles from lib/VER/cfe_internal.cf into lib/VER/cfe_internal_hub.cf and load them only if policy_server policy if set. - Re-organize lib/VER/stdlib.cf from lists into classic array for use with getvalues Removed: - Diff reporting on /etc/shadow (Enterprise) - Update policy from promise.cf inputs. There is no reason to include the update policy into promsies.cf, update.cf is the entry for the update policy - _not_repaired outcome from classes_generic and scoped_classes generic (Redmine: # 7022) Fixes: - standard_services now restarts the service if it was not already running when using service_policy => restart with chkconfig (Redmine #7258)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/cfengine3/Makefile62
-rw-r--r--sysutils/cfengine3/Makefile.cf123
-rw-r--r--sysutils/cfengine3/PLIST130
-rw-r--r--sysutils/cfengine3/distinfo21
-rw-r--r--sysutils/cfengine3/files/pkgsrc159
-rw-r--r--sysutils/cfengine3/files/smf/manifest.xml45
-rw-r--r--sysutils/cfengine3/patches/patch-ext_Makefile.in10
-rw-r--r--sysutils/cfengine3/patches/patch-libenv_unix_iface.c15
8 files changed, 440 insertions, 125 deletions
diff --git a/sysutils/cfengine3/Makefile b/sysutils/cfengine3/Makefile
index 79647094683..668f235ed85 100644
--- a/sysutils/cfengine3/Makefile
+++ b/sysutils/cfengine3/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.14 2015/04/14 13:33:32 fhajny Exp $
+# $NetBSD: Makefile,v 1.15 2015/12/08 17:15:21 fhajny Exp $
#
-DISTNAME= cfengine-3.6.5
+DISTNAME= cfengine-3.7.2
CATEGORIES= sysutils
-MASTER_SITES= http://cfengine.package-repos.s3.amazonaws.com/tarballs/
+MASTER_SITES= http://cfengine-package-repos.s3.amazonaws.com/tarballs/
MAINTAINER= pettai@NetBSD.org
HOMEPAGE= http://cfengine.com/pages/community
@@ -12,22 +12,25 @@ LICENSE= gnu-gpl-v3
USE_LANGUAGES= c c++ c99
USE_LIBTOOL= yes
-USE_TOOLS+= gmake
+USE_TOOLS+= gmake pax
.include "options.mk"
DISTFILES= ${DEFAULT_DISTFILES}
-DISTFILES+= masterfiles-${PKGVERSION_NOREV}.tar.gz
+DISTFILES+= cfengine-masterfiles-${PKGVERSION_NOREV}.tar.gz
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-fhs
CONFIGURE_ARGS+= --docdir=${DOCDIR}
+CONFIGURE_ARGS+= --datadir=${CFENGINE_DIR:Q}
CONFIGURE_ARGS+= --with-masterdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+= --with-sysconfdir=${PKG_SYSCONFDIR:Q}
CONFIGURE_ARGS+= --with-workdir=${CFENGINE_DIR:Q}
CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl:Q}
CONFIGURE_ARGS+= --with-pcre=${BUILDLINK_PREFIX.pcre:Q}
+CONFIGURE_DIRS+= . ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}
+
BUILD_DEFS+= VARBASE CFENGINE_DIR
FILES_SUBST+= CFENGINE_DIR=${CFENGINE_DIR}
@@ -46,27 +49,56 @@ CONF_FILES+= ${EGDIR}/CoreBase/${file} ${PKG_SYSCONFDIR}/${file}
.endfor
RCD_SCRIPTS= cfserverd cfexecd cfmonitord
+SMF_INSTANCES= ${RCD_SCRIPTS}
INSTALLATION_DIRS+= ${PKGMANDIR}/man8
INSTALL_MAKE_FLAGS+= examplesdir=${EGDIR} projlibdir=${PREFIX}/lib
+INSTALL_MAKE_FLAGS+= masterfilesdir=${EGDIR}/CoreBase
+INSTALL_MAKE_FLAGS+= package_modulesdir=${EGDIR}/CoreBase/modules/packages
+INSTALL_MAKE_FLAGS+= dist_package_modules_SCRIPTS="apt_get pkgsrc yum"
MAKE_DIRS= ${CFENGINE_DIR}
-MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls ${PKG_SYSCONFDIR}/libraries
-MAKE_DIRS+= ${PKG_SYSCONFDIR}/services
-
-update-masterfiles:
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/cfe_internal/core/deprecated
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/cfe_internal/update
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/cfe_internal/enterprise/ha
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls/3.5
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls/3.6
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls/3.7
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/inventory
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.5
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.6
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/lib/3.7
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/modules/packages
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/services/autorun
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/sketches/meta
+MAKE_DIRS+= ${PKG_SYSCONFDIR}/templates
+
+SUBST_CLASSES+= path
+SUBST_MESSAGE.path= Fixing default paths
+SUBST_STAGE.path= pre-configure
+SUBST_FILES.path= ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc
+SUBST_VARS.path= MACHINE_ARCH PKG_SYSCONFBASE PREFIX
+
+# This can be removed once this module is released in 3.8.
+post-extract:
+ ${INSTALL_SCRIPT} files/pkgsrc \
+ ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc
+
+update-masterfiles: configure
(${ECHO} '# $$''NetBSD''$$'; \
- ${ECHO} '# Generated by "${MAKE:Q} update-masterfiles", post-extract'; \
+ ${ECHO} '# Generated by "make update-masterfiles", post-configure'; \
${ECHO}; \
- cd ${WRKDIR}/masterfiles && ${FIND} * -type f | ${SORT} | \
- ${SED} -e 's|^|CFILES+=|') \
+ cd ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV} && (\
+ ${FIND} cfe_internal controls inventory lib services sketches/meta update -name '*.cf'; \
+ ${FIND} templates -name '*.mustache'; \
+ ${FIND} modules -type f | grep -v Makefile \
+ ) | ${SORT} | ${SED} -e 's|^|CFILES+=|') \
> ${.CURDIR}/../../sysutils/cfengine3/Makefile.cf
post-install:
- cp -r ${WRKDIR}/masterfiles ${DESTDIR}/${PREFIX}/share/examples/cfengine/CoreBase
for cf in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd ; \
- do \
- LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib ${DESTDIR}${PREFIX}/sbin/$$cf -M > ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/$$cf.8 ; \
+ do LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib ${DESTDIR}${PREFIX}/sbin/$$cf -M \
+ > ${DESTDIR}/${PREFIX}/${PKGMANDIR}/man8/$$cf.8 ; \
done
.include "../../devel/pcre/buildlink3.mk"
diff --git a/sysutils/cfengine3/Makefile.cf b/sysutils/cfengine3/Makefile.cf
index e84626faf84..b38533ddf3a 100644
--- a/sysutils/cfengine3/Makefile.cf
+++ b/sysutils/cfengine3/Makefile.cf
@@ -1,23 +1,61 @@
-# $NetBSD: Makefile.cf,v 1.1 2015/04/07 08:43:35 fhajny Exp $
-# This file is generated by "/opt/local/bin/bmake update-masterfiles", post-extract
+# $NetBSD: Makefile.cf,v 1.2 2015/12/08 17:15:21 fhajny Exp $
+# Generated by "make update-masterfiles", post-configure
CFILES+=cfe_internal/CFE_cfengine.cf
-CFILES+=cfe_internal/CFE_hub_specific.cf
-CFILES+=cfe_internal/CFE_knowledge.cf
-CFILES+=cfe_internal/cfengine_processes.cf
-CFILES+=cfe_internal/ha/ha.cf
-CFILES+=cfe_internal/ha/ha_def.cf
-CFILES+=cfe_internal/host_info_report.cf
-CFILES+=controls/3.4/cf_serverd.cf
-CFILES+=controls/cf_agent.cf
-CFILES+=controls/cf_execd.cf
-CFILES+=controls/cf_hub.cf
-CFILES+=controls/cf_monitord.cf
-CFILES+=controls/cf_runagent.cf
-CFILES+=controls/cf_serverd.cf
-CFILES+=def.cf
+CFILES+=cfe_internal/core/deprecated/cfengine_processes.cf
+CFILES+=cfe_internal/core/host_info_report.cf
+CFILES+=cfe_internal/core/limit_robot_agents.cf
+CFILES+=cfe_internal/core/log_rotation.cf
+CFILES+=cfe_internal/core/main.cf
+CFILES+=cfe_internal/enterprise/CFE_hub_specific.cf
+CFILES+=cfe_internal/enterprise/CFE_knowledge.cf
+CFILES+=cfe_internal/enterprise/file_change.cf
+CFILES+=cfe_internal/enterprise/ha/ha.cf
+CFILES+=cfe_internal/enterprise/ha/ha_def.cf
+CFILES+=cfe_internal/enterprise/ha/ha_update.cf
+CFILES+=cfe_internal/enterprise/main.cf
+CFILES+=cfe_internal/update/cfe_internal_dc_workflow.cf
+CFILES+=cfe_internal/update/cfe_internal_local_git_remote.cf
+CFILES+=cfe_internal/update/cfe_internal_update_from_repository.cf
+CFILES+=cfe_internal/update/update_bins.cf
+CFILES+=cfe_internal/update/update_policy.cf
+CFILES+=cfe_internal/update/update_processes.cf
+CFILES+=controls/3.5/cf_agent.cf
+CFILES+=controls/3.5/cf_execd.cf
+CFILES+=controls/3.5/cf_hub.cf
+CFILES+=controls/3.5/cf_monitord.cf
+CFILES+=controls/3.5/cf_runagent.cf
+CFILES+=controls/3.5/cf_serverd.cf
+CFILES+=controls/3.5/def.cf
+CFILES+=controls/3.5/def_inputs.cf
+CFILES+=controls/3.5/reports.cf
+CFILES+=controls/3.5/update_def.cf
+CFILES+=controls/3.5/update_def_inputs.cf
+CFILES+=controls/3.6/cf_agent.cf
+CFILES+=controls/3.6/cf_execd.cf
+CFILES+=controls/3.6/cf_hub.cf
+CFILES+=controls/3.6/cf_monitord.cf
+CFILES+=controls/3.6/cf_runagent.cf
+CFILES+=controls/3.6/cf_serverd.cf
+CFILES+=controls/3.6/def.cf
+CFILES+=controls/3.6/def_inputs.cf
+CFILES+=controls/3.6/reports.cf
+CFILES+=controls/3.6/update_def.cf
+CFILES+=controls/3.6/update_def_inputs.cf
+CFILES+=controls/3.7/cf_agent.cf
+CFILES+=controls/3.7/cf_execd.cf
+CFILES+=controls/3.7/cf_hub.cf
+CFILES+=controls/3.7/cf_monitord.cf
+CFILES+=controls/3.7/cf_runagent.cf
+CFILES+=controls/3.7/cf_serverd.cf
+CFILES+=controls/3.7/def.cf
+CFILES+=controls/3.7/def_inputs.cf
+CFILES+=controls/3.7/reports.cf
+CFILES+=controls/3.7/update_def.cf
+CFILES+=controls/3.7/update_def_inputs.cf
CFILES+=inventory/any.cf
CFILES+=inventory/debian.cf
+CFILES+=inventory/freebsd.cf
CFILES+=inventory/generic.cf
CFILES+=inventory/linux.cf
CFILES+=inventory/lsb.cf
@@ -38,11 +76,12 @@ CFILES+=lib/3.5/monitor.cf
CFILES+=lib/3.5/packages.cf
CFILES+=lib/3.5/paths.cf
CFILES+=lib/3.5/processes.cf
-CFILES+=lib/3.5/reports.cf
CFILES+=lib/3.5/services.cf
CFILES+=lib/3.5/storage.cf
+CFILES+=lib/3.6/autorun.cf
CFILES+=lib/3.6/bundles.cf
CFILES+=lib/3.6/cfe_internal.cf
+CFILES+=lib/3.6/cfe_internal_hub.cf
CFILES+=lib/3.6/cfengine_enterprise_hub_ha.cf
CFILES+=lib/3.6/commands.cf
CFILES+=lib/3.6/common.cf
@@ -56,35 +95,37 @@ CFILES+=lib/3.6/monitor.cf
CFILES+=lib/3.6/packages.cf
CFILES+=lib/3.6/paths.cf
CFILES+=lib/3.6/processes.cf
-CFILES+=lib/3.6/reports.cf
CFILES+=lib/3.6/services.cf
CFILES+=lib/3.6/stdlib.cf
CFILES+=lib/3.6/storage.cf
CFILES+=lib/3.6/users.cf
CFILES+=lib/3.6/vcs.cf
-CFILES+=promises.cf
-CFILES+=services/CVE_2015_0235/def.cf
-CFILES+=services/CVE_2015_0235/policy/CVE_2015_0235_inventory.cf
-CFILES+=services/autorun.cf
+CFILES+=lib/3.7/autorun.cf
+CFILES+=lib/3.7/bundles.cf
+CFILES+=lib/3.7/cfe_internal.cf
+CFILES+=lib/3.7/cfe_internal_hub.cf
+CFILES+=lib/3.7/cfengine_enterprise_hub_ha.cf
+CFILES+=lib/3.7/commands.cf
+CFILES+=lib/3.7/common.cf
+CFILES+=lib/3.7/databases.cf
+CFILES+=lib/3.7/edit_xml.cf
+CFILES+=lib/3.7/examples.cf
+CFILES+=lib/3.7/feature.cf
+CFILES+=lib/3.7/files.cf
+CFILES+=lib/3.7/guest_environments.cf
+CFILES+=lib/3.7/monitor.cf
+CFILES+=lib/3.7/packages.cf
+CFILES+=lib/3.7/paths.cf
+CFILES+=lib/3.7/processes.cf
+CFILES+=lib/3.7/services.cf
+CFILES+=lib/3.7/stdlib.cf
+CFILES+=lib/3.7/storage.cf
+CFILES+=lib/3.7/users.cf
+CFILES+=lib/3.7/vcs.cf
+CFILES+=modules/packages/apt_get
+CFILES+=modules/packages/pkgsrc
+CFILES+=modules/packages/yum
CFILES+=services/autorun/hello.cf
-CFILES+=services/file_change.cf
-CFILES+=services/linux_kernel/def.cf
-CFILES+=services/linux_kernel/examples/promises.cf
-CFILES+=services/linux_kernel/policy/linux_kernel_params_inventory.cf
-CFILES+=services/sysctl/def.cf
-CFILES+=services/sysctl/policy/example_sysctl_data_from_policy.cf
-CFILES+=services/sysctl/policy/sysctl_conf_selective_present.cf
-CFILES+=services/sysctl/test.cf
-CFILES+=services/yum/def.cf
-CFILES+=services/yum/policy/yum_inventory.cf
-CFILES+=services/yum/policy/yum_inventory_yum_info_yum.cf
-CFILES+=services/yum/policy/yum_inventory_yum_repolist.cf
+CFILES+=services/main.cf
CFILES+=sketches/meta/api-runfile.cf
CFILES+=templates/host_info_report.mustache
-CFILES+=update.cf
-CFILES+=update/cfe_internal_dc_workflow.cf
-CFILES+=update/cfe_internal_local_git_remote.cf
-CFILES+=update/cfe_internal_update_from_repository.cf
-CFILES+=update/update_bins.cf
-CFILES+=update/update_policy.cf
-CFILES+=update/update_processes.cf
diff --git a/sysutils/cfengine3/PLIST b/sysutils/cfengine3/PLIST
index 0c910f4e8fd..53144a6403d 100644
--- a/sysutils/cfengine3/PLIST
+++ b/sysutils/cfengine3/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2015/04/07 08:43:35 fhajny Exp $
+@comment $NetBSD: PLIST,v 1.8 2015/12/08 17:15:21 fhajny Exp $
lib/libpromises.la
man/man8/cf-agent.8
man/man8/cf-execd.8
@@ -18,22 +18,60 @@ sbin/cf-upgrade
share/doc/cfengine/ChangeLog
share/doc/cfengine/README.md
share/examples/cfengine/CoreBase/cfe_internal/CFE_cfengine.cf
-share/examples/cfengine/CoreBase/cfe_internal/CFE_hub_specific.cf
-share/examples/cfengine/CoreBase/cfe_internal/CFE_knowledge.cf
-share/examples/cfengine/CoreBase/cfe_internal/cfengine_processes.cf
-share/examples/cfengine/CoreBase/cfe_internal/ha/ha.cf
-share/examples/cfengine/CoreBase/cfe_internal/ha/ha_def.cf
-share/examples/cfengine/CoreBase/cfe_internal/host_info_report.cf
-share/examples/cfengine/CoreBase/controls/3.4/cf_serverd.cf
-share/examples/cfengine/CoreBase/controls/cf_agent.cf
-share/examples/cfengine/CoreBase/controls/cf_execd.cf
-share/examples/cfengine/CoreBase/controls/cf_hub.cf
-share/examples/cfengine/CoreBase/controls/cf_monitord.cf
-share/examples/cfengine/CoreBase/controls/cf_runagent.cf
-share/examples/cfengine/CoreBase/controls/cf_serverd.cf
-share/examples/cfengine/CoreBase/def.cf
+share/examples/cfengine/CoreBase/cfe_internal/core/deprecated/cfengine_processes.cf
+share/examples/cfengine/CoreBase/cfe_internal/core/host_info_report.cf
+share/examples/cfengine/CoreBase/cfe_internal/core/limit_robot_agents.cf
+share/examples/cfengine/CoreBase/cfe_internal/core/log_rotation.cf
+share/examples/cfengine/CoreBase/cfe_internal/core/main.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/CFE_hub_specific.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/CFE_knowledge.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/file_change.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/ha/ha.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/ha/ha_def.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/ha/ha_update.cf
+share/examples/cfengine/CoreBase/cfe_internal/enterprise/main.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/cfe_internal_dc_workflow.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/cfe_internal_local_git_remote.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/cfe_internal_update_from_repository.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/update_bins.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/update_policy.cf
+share/examples/cfengine/CoreBase/cfe_internal/update/update_processes.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_agent.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_execd.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_hub.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_monitord.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_runagent.cf
+share/examples/cfengine/CoreBase/controls/3.5/cf_serverd.cf
+share/examples/cfengine/CoreBase/controls/3.5/def.cf
+share/examples/cfengine/CoreBase/controls/3.5/def_inputs.cf
+share/examples/cfengine/CoreBase/controls/3.5/reports.cf
+share/examples/cfengine/CoreBase/controls/3.5/update_def.cf
+share/examples/cfengine/CoreBase/controls/3.5/update_def_inputs.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_agent.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_execd.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_hub.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_monitord.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_runagent.cf
+share/examples/cfengine/CoreBase/controls/3.6/cf_serverd.cf
+share/examples/cfengine/CoreBase/controls/3.6/def.cf
+share/examples/cfengine/CoreBase/controls/3.6/def_inputs.cf
+share/examples/cfengine/CoreBase/controls/3.6/reports.cf
+share/examples/cfengine/CoreBase/controls/3.6/update_def.cf
+share/examples/cfengine/CoreBase/controls/3.6/update_def_inputs.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_agent.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_execd.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_hub.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_monitord.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_runagent.cf
+share/examples/cfengine/CoreBase/controls/3.7/cf_serverd.cf
+share/examples/cfengine/CoreBase/controls/3.7/def.cf
+share/examples/cfengine/CoreBase/controls/3.7/def_inputs.cf
+share/examples/cfengine/CoreBase/controls/3.7/reports.cf
+share/examples/cfengine/CoreBase/controls/3.7/update_def.cf
+share/examples/cfengine/CoreBase/controls/3.7/update_def_inputs.cf
share/examples/cfengine/CoreBase/inventory/any.cf
share/examples/cfengine/CoreBase/inventory/debian.cf
+share/examples/cfengine/CoreBase/inventory/freebsd.cf
share/examples/cfengine/CoreBase/inventory/generic.cf
share/examples/cfengine/CoreBase/inventory/linux.cf
share/examples/cfengine/CoreBase/inventory/lsb.cf
@@ -54,11 +92,12 @@ share/examples/cfengine/CoreBase/lib/3.5/monitor.cf
share/examples/cfengine/CoreBase/lib/3.5/packages.cf
share/examples/cfengine/CoreBase/lib/3.5/paths.cf
share/examples/cfengine/CoreBase/lib/3.5/processes.cf
-share/examples/cfengine/CoreBase/lib/3.5/reports.cf
share/examples/cfengine/CoreBase/lib/3.5/services.cf
share/examples/cfengine/CoreBase/lib/3.5/storage.cf
+share/examples/cfengine/CoreBase/lib/3.6/autorun.cf
share/examples/cfengine/CoreBase/lib/3.6/bundles.cf
share/examples/cfengine/CoreBase/lib/3.6/cfe_internal.cf
+share/examples/cfengine/CoreBase/lib/3.6/cfe_internal_hub.cf
share/examples/cfengine/CoreBase/lib/3.6/cfengine_enterprise_hub_ha.cf
share/examples/cfengine/CoreBase/lib/3.6/commands.cf
share/examples/cfengine/CoreBase/lib/3.6/common.cf
@@ -72,38 +111,42 @@ share/examples/cfengine/CoreBase/lib/3.6/monitor.cf
share/examples/cfengine/CoreBase/lib/3.6/packages.cf
share/examples/cfengine/CoreBase/lib/3.6/paths.cf
share/examples/cfengine/CoreBase/lib/3.6/processes.cf
-share/examples/cfengine/CoreBase/lib/3.6/reports.cf
share/examples/cfengine/CoreBase/lib/3.6/services.cf
share/examples/cfengine/CoreBase/lib/3.6/stdlib.cf
share/examples/cfengine/CoreBase/lib/3.6/storage.cf
share/examples/cfengine/CoreBase/lib/3.6/users.cf
share/examples/cfengine/CoreBase/lib/3.6/vcs.cf
+share/examples/cfengine/CoreBase/lib/3.7/autorun.cf
+share/examples/cfengine/CoreBase/lib/3.7/bundles.cf
+share/examples/cfengine/CoreBase/lib/3.7/cfe_internal.cf
+share/examples/cfengine/CoreBase/lib/3.7/cfe_internal_hub.cf
+share/examples/cfengine/CoreBase/lib/3.7/cfengine_enterprise_hub_ha.cf
+share/examples/cfengine/CoreBase/lib/3.7/commands.cf
+share/examples/cfengine/CoreBase/lib/3.7/common.cf
+share/examples/cfengine/CoreBase/lib/3.7/databases.cf
+share/examples/cfengine/CoreBase/lib/3.7/edit_xml.cf
+share/examples/cfengine/CoreBase/lib/3.7/examples.cf
+share/examples/cfengine/CoreBase/lib/3.7/feature.cf
+share/examples/cfengine/CoreBase/lib/3.7/files.cf
+share/examples/cfengine/CoreBase/lib/3.7/guest_environments.cf
+share/examples/cfengine/CoreBase/lib/3.7/monitor.cf
+share/examples/cfengine/CoreBase/lib/3.7/packages.cf
+share/examples/cfengine/CoreBase/lib/3.7/paths.cf
+share/examples/cfengine/CoreBase/lib/3.7/processes.cf
+share/examples/cfengine/CoreBase/lib/3.7/services.cf
+share/examples/cfengine/CoreBase/lib/3.7/stdlib.cf
+share/examples/cfengine/CoreBase/lib/3.7/storage.cf
+share/examples/cfengine/CoreBase/lib/3.7/users.cf
+share/examples/cfengine/CoreBase/lib/3.7/vcs.cf
+share/examples/cfengine/CoreBase/modules/packages/apt_get
+share/examples/cfengine/CoreBase/modules/packages/pkgsrc
+share/examples/cfengine/CoreBase/modules/packages/yum
share/examples/cfengine/CoreBase/promises.cf
-share/examples/cfengine/CoreBase/services/CVE_2015_0235/def.cf
-share/examples/cfengine/CoreBase/services/CVE_2015_0235/policy/CVE_2015_0235_inventory.cf
-share/examples/cfengine/CoreBase/services/autorun.cf
share/examples/cfengine/CoreBase/services/autorun/hello.cf
-share/examples/cfengine/CoreBase/services/file_change.cf
-share/examples/cfengine/CoreBase/services/linux_kernel/def.cf
-share/examples/cfengine/CoreBase/services/linux_kernel/examples/promises.cf
-share/examples/cfengine/CoreBase/services/linux_kernel/policy/linux_kernel_params_inventory.cf
-share/examples/cfengine/CoreBase/services/sysctl/def.cf
-share/examples/cfengine/CoreBase/services/sysctl/policy/example_sysctl_data_from_policy.cf
-share/examples/cfengine/CoreBase/services/sysctl/policy/sysctl_conf_selective_present.cf
-share/examples/cfengine/CoreBase/services/sysctl/test.cf
-share/examples/cfengine/CoreBase/services/yum/def.cf
-share/examples/cfengine/CoreBase/services/yum/policy/yum_inventory.cf
-share/examples/cfengine/CoreBase/services/yum/policy/yum_inventory_yum_info_yum.cf
-share/examples/cfengine/CoreBase/services/yum/policy/yum_inventory_yum_repolist.cf
+share/examples/cfengine/CoreBase/services/main.cf
share/examples/cfengine/CoreBase/sketches/meta/api-runfile.cf
share/examples/cfengine/CoreBase/templates/host_info_report.mustache
share/examples/cfengine/CoreBase/update.cf
-share/examples/cfengine/CoreBase/update/cfe_internal_dc_workflow.cf
-share/examples/cfengine/CoreBase/update/cfe_internal_local_git_remote.cf
-share/examples/cfengine/CoreBase/update/cfe_internal_update_from_repository.cf
-share/examples/cfengine/CoreBase/update/update_bins.cf
-share/examples/cfengine/CoreBase/update/update_policy.cf
-share/examples/cfengine/CoreBase/update/update_processes.cf
share/examples/cfengine/abort.cf
share/examples/cfengine/accessed_before.cf
share/examples/cfengine/accessedbefore.cf
@@ -125,6 +168,7 @@ share/examples/cfengine/badtype.cf
share/examples/cfengine/bsdflags.cf
share/examples/cfengine/bundle_return_values.cf
share/examples/cfengine/bundlesmatching.cf
+share/examples/cfengine/bundlestate.cf
share/examples/cfengine/canonify.cf
share/examples/cfengine/cf2_integration.cf
share/examples/cfengine/change_detect.cf
@@ -151,7 +195,9 @@ share/examples/cfengine/countlinesmatching.cf
share/examples/cfengine/create_filedir.cf
share/examples/cfengine/createdb.cf
share/examples/cfengine/customize_by_named_list.cf
+share/examples/cfengine/data_expand.cf
share/examples/cfengine/data_readstringarray.cf
+share/examples/cfengine/data_regextract.cf
share/examples/cfengine/datastate.cf
share/examples/cfengine/defaults.cf
share/examples/cfengine/defaults2.cf
@@ -180,6 +226,7 @@ share/examples/cfengine/edit_setvar.cf
share/examples/cfengine/edit_template.cf
share/examples/cfengine/edit_triggerclass.cf
share/examples/cfengine/edit_xml.cf
+share/examples/cfengine/ensure_line_present_prepend_append.cf
share/examples/cfengine/env.cf
share/examples/cfengine/epimenides.cf
share/examples/cfengine/escape.cf
@@ -193,6 +240,7 @@ share/examples/cfengine/expand.cf
share/examples/cfengine/failedcommand.cf
share/examples/cfengine/failsafe.cf
share/examples/cfengine/file_change_detection.cf
+share/examples/cfengine/file_hash.cf
share/examples/cfengine/file_owner_list_template.cf
share/examples/cfengine/fileexists.cf
share/examples/cfengine/filenames.cf
@@ -263,6 +311,7 @@ share/examples/cfengine/log_private.cf
share/examples/cfengine/loops.cf
share/examples/cfengine/lsdir.cf
share/examples/cfengine/maparray.cf
+share/examples/cfengine/mapdata.cf
share/examples/cfengine/maplist.cf
share/examples/cfengine/max-min-mean-variance.cf
share/examples/cfengine/measure_log.cf
@@ -315,6 +364,7 @@ share/examples/cfengine/package_solaris.cf
share/examples/cfengine/package_windows_feature.cf
share/examples/cfengine/package_yum.cf
share/examples/cfengine/package_zypper.cf
+share/examples/cfengine/packagesmatching.cf
share/examples/cfengine/parallel_exec.cf
share/examples/cfengine/parseintrealstringarray.cf
share/examples/cfengine/parsestringarray.cf
@@ -332,10 +382,13 @@ share/examples/cfengine/process_matching3.cf
share/examples/cfengine/process_restart.cf
share/examples/cfengine/process_restart_basic.cf
share/examples/cfengine/process_signalling.cf
+share/examples/cfengine/processes_define_class_based_on_process_runtime.cf
share/examples/cfengine/product.cf
share/examples/cfengine/promise_knowledge.cf
share/examples/cfengine/promises.cf
share/examples/cfengine/randomint.cf
+share/examples/cfengine/readcsv.cf
+share/examples/cfengine/readdata.cf
share/examples/cfengine/readfile.cf
share/examples/cfengine/readintrealstringlist.cf
share/examples/cfengine/readlist.cf
@@ -397,6 +450,7 @@ share/examples/cfengine/strftime.cf
share/examples/cfengine/string_downcase.cf
share/examples/cfengine/string_head.cf
share/examples/cfengine/string_length.cf
+share/examples/cfengine/string_mustache.cf
share/examples/cfengine/string_reverse.cf
share/examples/cfengine/string_split.cf
share/examples/cfengine/string_tail.cf
diff --git a/sysutils/cfengine3/distinfo b/sysutils/cfengine3/distinfo
index 8062953d1b4..b3b17123dff 100644
--- a/sysutils/cfengine3/distinfo
+++ b/sysutils/cfengine3/distinfo
@@ -1,12 +1,11 @@
-$NetBSD: distinfo,v 1.8 2015/11/04 01:32:08 agc Exp $
+$NetBSD: distinfo,v 1.9 2015/12/08 17:15:21 fhajny Exp $
-SHA1 (cfengine-3.6.5.tar.gz) = 7329ab681bf39e4a607003f56df56fe0c6226406
-RMD160 (cfengine-3.6.5.tar.gz) = 323d047f8dffc37924d82e4dbcd4d75172b41ea6
-SHA512 (cfengine-3.6.5.tar.gz) = c024fcf2c28ac30884f91964310619939b5e9ae371e8c51ef6602eeee6ca147c7d8522916ab287a179161ddde6979ffe0a97acdf6cde340a128ea9f3397eb263
-Size (cfengine-3.6.5.tar.gz) = 2011114 bytes
-SHA1 (masterfiles-3.6.5.tar.gz) = f23e8e61ccef9b25a59ca6230406fba36d6b52ac
-RMD160 (masterfiles-3.6.5.tar.gz) = 538ec2192de35489110d101a7644d3a9262ccd51
-SHA512 (masterfiles-3.6.5.tar.gz) = 90ee42d1dbe707356656fbd26930eaa94882537236914a355a11e2f636ee2b4ae931cf083df8e9bfa94336551263e15b8ede372f384460ce491f0517c12a7505
-Size (masterfiles-3.6.5.tar.gz) = 128384 bytes
-SHA1 (patch-ext_Makefile.in) = 2a231187b2e3f237cd856d990bca9f2472817074
-SHA1 (patch-libenv_unix_iface.c) = f6fbb791be6283cd84a70674c58b166dac6b7c41
+SHA1 (cfengine-3.7.2.tar.gz) = 9f454db3ce9c86c6c230bfd5bba534970ada7893
+RMD160 (cfengine-3.7.2.tar.gz) = 83d48c484e3a8132fa0bf331402aa8305dab125c
+SHA512 (cfengine-3.7.2.tar.gz) = 8b4d0dac81cb3734489e3e1d60a034c3074d710f35a6c2ab35cffe9c066a63c3214b062ef4116ff3ef46461c8ce53ebb02c6513cb49f9edf2c9a81f4679066e6
+Size (cfengine-3.7.2.tar.gz) = 2114764 bytes
+SHA1 (cfengine-masterfiles-3.7.2.tar.gz) = 8b00f9e81815890220d7e8ad5209cdf1fc04b07d
+RMD160 (cfengine-masterfiles-3.7.2.tar.gz) = 2f67dd56f8b82575c799a1d9a83b44bd67d3bc38
+SHA512 (cfengine-masterfiles-3.7.2.tar.gz) = e2a6ceba4db90e6b2cd4f30fc2c276012660aca8a76fbd5bbc3debd8e6226cd5f8f270f5936b38e1ccd36cee706fd697bfde5c96739bde38d8c11f4ef3f0f86b
+Size (cfengine-masterfiles-3.7.2.tar.gz) = 449943 bytes
+SHA1 (patch-ext_Makefile.in) = b0f8c773b3351c949fe33028a3122c5673d8778d
diff --git a/sysutils/cfengine3/files/pkgsrc b/sysutils/cfengine3/files/pkgsrc
new file mode 100644
index 00000000000..1e7dd064961
--- /dev/null
+++ b/sysutils/cfengine3/files/pkgsrc
@@ -0,0 +1,159 @@
+#!/bin/sh
+
+## Licensed under:
+## MIT Public License
+## http://www.opensource.org/licenses/MIT
+
+## Copyright (c) 2015, Brian Bennett <bahamat@digitalelf.net>
+
+## pkgsrc package module for cfengine
+
+# Set up mock environment if necessary
+if [ -n $CFENGINE_TEST_PKGSRC_MOCK ]; then
+ alias pkgin='./mock_pkgin'
+ alias pkg_info='./mock_pkg_info'
+fi
+
+# Add pkgsrc paths
+export PATH=@PREFIX@/bin:@PREFIX@/sbin:$PATH
+export MACHINE_ARCH=@MACHINE_ARCH@
+export PKG_ROOT=@PREFIX@
+export PKG_INSTALL_CONF=@PKG_SYSCONFBASE@/pkg_install.conf
+
+LEVEL=0
+
+fatal () {
+ echo "ErrorMessage=$@"
+ exit 2
+}
+
+warn () {
+ [ $LEVEL -gt 0 ] && echo "[TRACE]: $*" >&2
+}
+
+supports_api_version () {
+ echo 1
+}
+
+repo_install () {
+ # If a version number is specified, insert a dash between the name and
+ # version
+ [ -n "$Version" ] && ver="-$Version"
+ pkgin -y in "${Name}${ver}" > /dev/null
+ if [ $? -gt 0 ]; then
+ fatal "Error installing ${Name}${ver}"
+ fi
+}
+
+file_install () {
+ # The specified config file might, for example override signature reqs:
+ # VERIFIED_INSTALLATION=never
+ pkg_add -U -C "$PKG_INSTALL_CONF" "$File" > /dev/null
+ if [ $? -gt 0 ]; then
+ echo "Error installing ${File}"
+ fi
+}
+
+remove () {
+ # If a version number is specified, insert a dash between the name and
+ # version
+ [ -n "$Version" ] && ver="-$Version"
+ pkgin -y rm "${Name}${ver}" > /dev/null
+}
+
+list_installed () {
+ parse_pkg_data "$(pkgin -p list)"
+}
+
+list_updates () {
+ # The difference between list-updates and list-updates-local, it seems
+ # is that list-updates expects to refresh from the upstream repo.
+ pkgin -f update >&2
+ list_updates_local
+}
+
+list_updates_local () {
+ parse_pkg_data "$(pkgin -pl '<' ls)"
+}
+
+get_package_data () {
+ if echo "$File" | grep '/' >/dev/null; then
+ # If there's a / in $File then we'll expec this to be a 'file' install.
+ # This is reliable because 1) pkgsrc packages don't have / in the name
+ # and because cfengine can't install a PackageType=file from a relative
+ # path.
+ #
+ # The package will be installed with pkg_add later, which also supports
+ # arbitrary HTTP locations.
+ echo "PackageType=file"
+ # To appease cfengine, we'll take the basename of the package passed.
+ echo "Name=$(echo "$File" | sed 's/.*\///g')"
+ else
+ # If $File does not contain /, it must be in an existing remote repo,
+ # because cfengine can't install files from relative paths.
+ echo "PackageType=repo"
+ # Cfengine expects a *single* matching package. So sort and return the
+ # most recent. If a version is specified it can partial match, in which
+ # case we'll again take the latest. If there's no match on the name
+ # or version, return nothing.
+ # There's possibly a bug here because we're already emitting that the
+ # PackageType is repo.
+ parse_pkg_data "$(pkgin -pP avail | grep "^$File" | grep "$Version;" | sort -n | tail -1)"
+ fi
+}
+
+parse_pkg_data () {
+ # This is a bit tricky.
+ # pkgin is called with parsable format and separates fields with ';'.
+ # Packages are further sub-split between name and version with '-', but
+ # package names may also contain '-'. To complicate matters, package
+ # versions can have '-' as well.
+
+ # Take the example package mozilla-rootcerts-1.0.20141117nb1
+ # $1 is the package-version compound. Discard the description in $2..
+ # Split $1 on 'separator' and store in array 'package'. Return length 'l'
+ # 'version' is the last element of array 'package'
+ # Now the tricky bit. We've split the package name, so now must reassemble
+ # it with dashes in tact, without the version number.
+ # For each element less 1 in 'package', if this is the first iteration
+ # print the element. On subsequent passes print "-element"
+ # Finally print the version and the machine architecture as well.
+ echo "$*" | awk -F';' '
+ {
+ separator="-"
+ l=split($1,package,separator)
+ version=package[l]
+ printf("Name=")
+ for (i=1ength;i<l;i++) {
+ if (i>1) {
+ printf("-")
+ }
+ printf("%s",package[i])
+ }
+ printf("\nVersion=%s\n",version)
+ printf("Architecture=%s\n",ENVIRON["MACHINE_ARCH"])
+ }'
+}
+
+# Cfengine passes data on STDIN. Absorb that and convert to shell variables.
+while IFS= read -r -u 0 line; do
+ eval "$line"
+ # options can be passed multiple times so we need to avoid clobbering
+ # previous instances. Plus, what we really want to eval is the value of
+ # each option.
+ if [ -n "$options" ]; then
+ eval "$options"
+ fi
+done
+
+case "$1" in
+ supports-api-version) supports_api_version;;
+ repo-install) repo_install;;
+ file-install) file_install;;
+ remove) remove;;
+ list-installed) list_installed;;
+ list-updates) list_updates;;
+ list-updates-local) list_updates_local;;
+ get-package-data) get_package_data;;
+ *) fatal "Invalid operation";;
+esac
diff --git a/sysutils/cfengine3/files/smf/manifest.xml b/sysutils/cfengine3/files/smf/manifest.xml
new file mode 100644
index 00000000000..5a30c0aaee8
--- /dev/null
+++ b/sysutils/cfengine3/files/smf/manifest.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type="manifest" name="cfexecd">
+ <service name="@SMF_PREFIX@/cfengine" type="service" version="1">
+ <dependency name="network" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/milestone/network:default" />
+ </dependency>
+ <dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
+ <service_fmri value="svc:/system/filesystem/local" />
+ </dependency>
+ <property_group name="startd" type="framework">
+ <propval name="duration" type="astring" value="contract" />
+ <propval name="ignore_error" type="astring" value="core,signal" />
+ </property_group>
+ <property_group name="application" type="application"></property_group>
+ <instance name='cfexecd' enabled='false'>
+ <exec_method type="method" name="start" exec="@PREFIX@/sbin/cf-execd" timeout_seconds="60" />
+ <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+ <template>
+ <common_name>
+ <loctext xml:lang="C">CfEngine Execution Daemon</loctext>
+ </common_name>
+ </template>
+ </instance>
+ <instance name='cfmonitord' enabled='false'>
+ <exec_method type="method" name="start" exec="@PREFIX@/sbin/cf-monitord" timeout_seconds="60" />
+ <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+ <template>
+ <common_name>
+ <loctext xml:lang="C">CfEngine Monitor Daemon</loctext>
+ </common_name>
+ </template>
+ </instance>
+ <instance name='cfserverd' enabled='false'>
+ <exec_method type="method" name="start" exec="@PREFIX@/sbin/cf-serverd" timeout_seconds="60" />
+ <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" />
+ <template>
+ <common_name>
+ <loctext xml:lang="C">CfEngine Server Daemon</loctext>
+ </common_name>
+ </template>
+ </instance>
+ <stability value="Evolving" />
+ </service>
+</service_bundle>
diff --git a/sysutils/cfengine3/patches/patch-ext_Makefile.in b/sysutils/cfengine3/patches/patch-ext_Makefile.in
index 3b2e15feb36..a22eecd43d6 100644
--- a/sysutils/cfengine3/patches/patch-ext_Makefile.in
+++ b/sysutils/cfengine3/patches/patch-ext_Makefile.in
@@ -1,14 +1,14 @@
-$NetBSD: patch-ext_Makefile.in,v 1.2 2015/04/07 08:43:35 fhajny Exp $
+$NetBSD: patch-ext_Makefile.in,v 1.3 2015/12/08 17:15:21 fhajny Exp $
No use for rpmvercmp.
---- ext/Makefile.in.orig 2015-04-03 10:59:08.525934907 +0000
+--- ext/Makefile.in.orig 2015-11-27 23:12:07.000000000 +0000
+++ ext/Makefile.in
-@@ -79,7 +79,6 @@ POST_UNINSTALL = :
+@@ -35,7 +35,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-sbin_PROGRAMS = rpmvercmp$(EXEEXT)
subdir = ext
- DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
diff --git a/sysutils/cfengine3/patches/patch-libenv_unix_iface.c b/sysutils/cfengine3/patches/patch-libenv_unix_iface.c
deleted file mode 100644
index a7a8ea172c4..00000000000
--- a/sysutils/cfengine3/patches/patch-libenv_unix_iface.c
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-libenv_unix_iface.c,v 1.1 2015/04/07 08:43:35 fhajny Exp $
-
-Ignore HAVE_STRUCT_SOCKADDR_SA_LEN on NetBSD, behavior different.
-
---- libenv/unix_iface.c.orig 2015-03-12 20:21:31.000000000 +0000
-+++ libenv/unix_iface.c
-@@ -52,7 +52,7 @@
-
- #ifndef __MINGW32__
-
--# ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
-+# if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) && !defined(__NetBSD__)
- # ifdef _SIZEOF_ADDR_IFREQ
- # define SIZEOF_IFREQ(x) _SIZEOF_ADDR_IFREQ(x)
- # else