Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cfengine3 to 3.7.2 #307

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions sysutils/cfengine3/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# $NetBSD: Makefile,v 1.14 2015/04/14 13:33:32 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= [email protected]
HOMEPAGE= http://cfengine.com/pages/community
Expand All @@ -17,7 +17,7 @@ USE_TOOLS+= gmake
.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
Expand Down Expand Up @@ -54,16 +54,21 @@ MAKE_DIRS= ${CFENGINE_DIR}
MAKE_DIRS+= ${PKG_SYSCONFDIR}/controls ${PKG_SYSCONFDIR}/libraries
MAKE_DIRS+= ${PKG_SYSCONFDIR}/services

# This can be removed once this module is released in 3.8.
pre-configure:
${CP} files/pkgsrc ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc
chmod 755 ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV}/modules/packages/pkgsrc

update-masterfiles:
(${ECHO} '# $$''NetBSD''$$'; \
${ECHO} '# Generated by "${MAKE:Q} update-masterfiles", post-extract'; \
${ECHO}; \
cd ${WRKDIR}/masterfiles && ${FIND} * -type f | ${SORT} | \
cd ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV} && ${FIND} * -type f | ${SORT} | \
${SED} -e 's|^|CFILES+=|') \
> ${.CURDIR}/../../sysutils/cfengine3/Makefile.cf

post-install:
cp -r ${WRKDIR}/masterfiles ${DESTDIR}/${PREFIX}/share/examples/cfengine/CoreBase
cp -r ${WRKDIR}/cfengine-masterfiles-${PKGVERSION_NOREV} ${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 ; \
Expand Down
352 changes: 313 additions & 39 deletions sysutils/cfengine3/Makefile.cf

Large diffs are not rendered by default.

477 changes: 381 additions & 96 deletions sysutils/cfengine3/PLIST

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions sysutils/cfengine3/distinfo
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
$NetBSD: distinfo,v 1.8 2015/11/04 01:32:08 agc 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) = 3b462021c279303a5fb0e57823232a82ebbede2d
163 changes: 163 additions & 0 deletions sysutils/cfengine3/files/pkgsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
#!/bin/sh

## Licensed under:
## MIT Public License
## http://www.opensource.org/licenses/MIT

## Copyright (c) 2015, Brian Bennett <[email protected]>

## 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

# /opt/local supports SmartOS
# /opt/pkg supports Mac OS X from Joyent, 2015Q2 or later
# /usr/pkg supports standard pkgsrc
# This should be sufficient to support all platforms supported by pgksrc.
# pkgsrc bootstrapped manually to non-standard locations is not currently supported.
export PATH=/opt/local/bin:/opt/local/sbin:/opt/pkg/bin:/opt/pkg/sbin:/usr/pkg/bin:/usr/pkg/sbin:$PATH
export MACHINE_ARCH=$(pkg_info -X pkg_install | grep MACHINE_ARCH | cut -d = -f 2)
export PKG_ROOT=$(pkg_info -pq pkg_install | cut -d ' ' -f 2)
export PKG_INSTALL_CONF=${PKG_ROOT}/etc/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
58 changes: 58 additions & 0 deletions sysutils/cfengine3/files/smf/cf-execd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Created by Manifold
--><service_bundle type="manifest" name="cf-execd">

<service name="application/management/cfengine/cf-execd" type="service" version="1">

<create_default_instance enabled="false"/>

<single_instance/>

<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>






<method_context>

</method_context>

<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"/>

<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>


<stability value="Evolving"/>

<template>
<common_name>
<loctext xml:lang="C">
CfEngine Execution Daemon
</loctext>
</common_name>
</template>

</service>

</service_bundle>
58 changes: 58 additions & 0 deletions sysutils/cfengine3/files/smf/cf-monitord.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Created by Manifold
--><service_bundle type="manifest" name="cf-monitord">

<service name="application/management/cfengine/cf-monitord" type="service" version="1">

<create_default_instance enabled="false"/>

<single_instance/>

<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>






<method_context>

</method_context>

<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"/>

<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>


<stability value="Evolving"/>

<template>
<common_name>
<loctext xml:lang="C">
CfEngine Monitor Daemon
</loctext>
</common_name>
</template>

</service>

</service_bundle>
Loading