Browse files

test4

  • Loading branch information...
1 parent 50ae513 commit d78ee40807e901d2dd03a63b26ddae6c289175bf @jirib committed Mar 23, 2013
Showing with 132 additions and 65 deletions.
  1. +16 −16 sysutils/cfengine/Makefile
  2. +61 −27 sysutils/cfengine/pkg/PLIST
  3. +54 −21 sysutils/cfengine/pkg/README
  4. +1 −1 sysutils/cfengine/pkg/cfengine.rc
View
32 sysutils/cfengine/Makefile
@@ -2,10 +2,10 @@
COMMENT = GNU system administration tool for networks
-DISTNAME = cfengine-3.4.4
-SHARED_LIBS += promises 1.0 # 1.0
+DISTNAME = cfengine-3.4.4
+SHARED_LIBS += promises 0.0 # 1.0
CATEGORIES = sysutils
-HOMEPAGE = http://www.cfengine.com/
+HOMEPAGE = http://cfengine.com/
MAINTAINER = Okan Demirmen <okan@openbsd.org>
@@ -18,10 +18,10 @@ CFENGINE_BASE = /var/cfengine
CFENGINE_EXAMPLES = ${PREFIX}/share/examples/cfengine
SUBST_VARS += CFENGINE_BASE CFENGINE_EXAMPLES
-FLAVORS = pgsql mysql
+FLAVORS = pgsql
FLAVOR ?=
-WANTLIB = c crypto m pcre pthread qdbm
+WANTLIB = c crypto m pcre pthread qdbm
CONFIGURE_STYLE = gnu
USE_GMAKE = Yes
LIB_DEPENDS = databases/qdbm \
@@ -33,9 +33,11 @@ CONFIGURE_ARGS = --with-openssl=/usr \
--with-qdbm \
--without-libxml2 \
--without-libvirt \
+ --without-mysql \
--enable-fhs \
--with-workdir=${CFENGINE_BASE}
-MAKE_FLAGS += examplesdir="${CFENGINE_EXAMPLES}" masterfilesdir="${CFENGINE_EXAMPLES}/CoreBase"
+MAKE_FLAGS += examplesdir="${CFENGINE_EXAMPLES}" \
+ masterfilesdir="${CFENGINE_EXAMPLES}/CoreBase"
.if ${FLAVOR:Mpgsql}
WANTLIB += pq
@@ -45,19 +47,17 @@ LIB_DEPENDS += databases/postgresql
CONFIGURE_ARGS += --without-postgresql
.endif
-.if ${FLAVOR:Mmysql}
-WANTLIB += mysqlclient_r
-CONFIGURE_ARGS += --with-mysql
-LIB_DEPENDS += databases/mysql
-.else
-CONFIGURE_ARGS += --without-mysql
-.endif
-
-#NO_TEST = Yes
+NO_TEST = Yes
post-extract:
- perl -i -pe \
+ @perl -i -pe \
's|^sbin_PROGRAMS.*rpmvercmp||;' \
${WRKDIST}/ext/Makefile.in
+post-install:
+ ${INSTALL_PROGRAM_DIR} ${WRKINST}${CFENGINE_BASE}/bin
+.for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-report cf-runagent cf-serverd
+ ln -s ${TRUEPREFIX}/sbin/$i ${WRKINST}${CFENGINE_BASE}/bin/
+.endfor
+
.include <bsd.port.mk>
View
88 sysutils/cfengine/pkg/PLIST
@@ -1,14 +1,5 @@
@comment $OpenBSD$
-@extraunexec rm -rf ${SYSCONFDIR}/cfengine
-@extraunexec rm -rf ${CFENGINE_BASE}
-@mode 0700
-@sample ${SYSCONFDIR}/cfengine/
-@mode
-@sample ${SYSCONFDIR}/cfengine/controls/
-@sample ${SYSCONFDIR}/cfengine/libraries/
-@sample ${SYSCONFDIR}/cfengine/services/
-@sample ${CFENGINE_BASE}/
-@sample ${CFENGINE_BASE}/masterfiles/
+@extraunexec rm -rf ${CFENGINE_BASE}/*
lib/cfengine/
lib/cfengine/libpromises.la
@lib lib/cfengine/libpromises.so.${LIBpromises_VERSION}
@@ -34,33 +25,70 @@ share/doc/cfengine/README
share/doc/pkg-readmes/${FULLPKGNAME}
share/examples/cfengine/
share/examples/cfengine/CoreBase/
+@mode 0700
+@sample ${CFENGINE_BASE}/
+@sample ${CFENGINE_BASE}/inputs/
+@mode
share/examples/cfengine/CoreBase/cf-sketch-runfile.cf
-@sample ${SYSCONFDIR}/cfengine/cf-sketch-runfile.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/cf-sketch-runfile.cf
+@mode
share/examples/cfengine/CoreBase/controls/
+@mode 0700
+@sample ${CFENGINE_BASE}/inputs/controls/
+@mode
share/examples/cfengine/CoreBase/controls/cf_agent.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_agent.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_agent.cf
+@mode
share/examples/cfengine/CoreBase/controls/cf_execd.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_execd.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_execd.cf
+@mode
share/examples/cfengine/CoreBase/controls/cf_monitord.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_monitord.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_monitord.cf
+@mode
share/examples/cfengine/CoreBase/controls/cf_report.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_report.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_report.cf
+@mode
share/examples/cfengine/CoreBase/controls/cf_runagent.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_runagent.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_runagent.cf
+@mode
share/examples/cfengine/CoreBase/controls/cf_serverd.cf
-@sample ${SYSCONFDIR}/cfengine/controls/cf_serverd.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/controls/cf_serverd.cf
+@mode
share/examples/cfengine/CoreBase/def.cf
-@sample ${SYSCONFDIR}/cfengine/def.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/def.cf
+@mode
share/examples/cfengine/CoreBase/libraries/
+@mode 0700
+@sample ${CFENGINE_BASE}/inputs/libraries/
+@mode
share/examples/cfengine/CoreBase/libraries/cfengine_stdlib.cf
-@sample ${SYSCONFDIR}/cfengine/libraries/cfengine_stdlib.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/libraries/cfengine_stdlib.cf
+@mode
share/examples/cfengine/CoreBase/promises.cf
-@sample ${SYSCONFDIR}/cfengine/promises.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/promises.cf
+@mode
share/examples/cfengine/CoreBase/services/
+@mode 0700
+@sample ${CFENGINE_BASE}/inputs/services/
+@mode
share/examples/cfengine/CoreBase/services/init_msg.cf
-@sample ${SYSCONFDIR}/cfengine/services/init_msg.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/services/init_msg.cf
+@mode
share/examples/cfengine/CoreBase/update.cf
-@sample ${SYSCONFDIR}/cfengine/update.cf
+@mode 0600
+@sample ${CFENGINE_BASE}/inputs/update.cf
+@mode
share/examples/cfengine/active_directory.cf
share/examples/cfengine/app_baseline.cf
share/examples/cfengine/guest_environment_kvm.cf
@@ -143,7 +171,6 @@ share/examples/cfengine/unit_execresult.cf
share/examples/cfengine/unit_expand.cf
share/examples/cfengine/unit_failedcommand.cf
share/examples/cfengine/unit_failsafe.cf
-@sample ${SYSCONFDIR}/cfengine/failsafe.cf
share/examples/cfengine/unit_file_change_detection.cf
share/examples/cfengine/unit_file_owner_list_template.cf
share/examples/cfengine/unit_fileexists.cf
@@ -327,10 +354,17 @@ share/examples/cfengine/win_dns_client.cf
share/examples/cfengine/win_emergency.cf
share/examples/cfengine/win_registry.cf
share/examples/cfengine/win_schedule.cf
-@exec-add if [ ! -e ${CFENGINE_BASE}/bin ]; then ln -sf ${TRUEPREFIX}/sbin ${CFENGINE_BASE}/bin ; fi
-@exec-add if [ ! -e ${CFENGINE_BASE}/inputs ]; then ln -sf ${SYSCONFDIR}/cfengine ${CFENGINE_BASE}/inputs ; fi
-@exec if [ ! -f ${CFENGINE_BASE}/ppkeys/localhost.priv ]; then %D/sbin/cf-key >/dev/null; fi
@rcscript ${RCDIR}/cf_execd
@rcscript ${RCDIR}/cf_monitord
@rcscript ${RCDIR}/cf_serverd
-@rcscript ${RCDIR}/cfengine
+@rcscript ${RCDIR}/cfengine
+@cwd ${CFENGINE_BASE}
+bin/
+bin/cf-agent
+bin/cf-execd
+bin/cf-key
+bin/cf-monitord
+bin/cf-promises
+bin/cf-report
+bin/cf-runagent
+bin/cf-serverd
View
75 sysutils/cfengine/pkg/README
@@ -4,33 +4,66 @@ $OpenBSD$
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------
-OpenBSD cfengine port has some tweaks differenting from standard cfengine
-community installation.
+Getting started
+===============
+During installation sample configuration files are placed in
+/var/cfengine/inputs. Before you can use Cfengine you need to create
+a public and private key pair by executing cf-key as root.
-As cfengine on OpenBSD is not built statically and depends on libraries
-in ${LOCALBASE}, this questions auto-repairing funcionality of cfengine
-itself which usually (as it is for cfengine enterprise edition) it is built
-statically and runs self-governingly from /var/cfengine.
+Configuring client machines
+---------------------------
+Client machines contact a policy hub to fetch up-to-date policies.
+This is done by the cf-agent(8) program, which can be run manually
+(especially while you are setting things up), but is usually started
+periodically by cf-execd(8).
-For upstream compability cfengine on OpenBSD has following symlinks:
+Clients also usually run cf-monitord(8) to collect statistics.
- /var/cfengine/inputs -> ${SYSCONFDIR}/cfengine
- /var/cfengine/bin -> ${LOCALBASE}/sbin
+Configuration files for these programs are in /var/cfengine/inputs/controls/:
+cf_agent.cf, cf_monitord.cf and cf_execd.cf.
-During installation cfengine key was generated in ${CFENGINE_BASE}/ppkeys
-and sample configuration files places in ${SYSCONFDIR}/cfengine to offer
-a user quick start-up with cfengine.
+To start these programs automatically at boot, you can add the following
+line to /etc/rc.conf.local:
-In most of your installations you will only need the cfagent with a proper
-configuration file which would connect to policy hub for its up-to-date
-policies.
+pkg_scripts="${pkg_scripts} cfengine"
-For more info you should have a look at the reference manual and the relevant
-docs:
+Configuring policy hubs (cfengine "servers")
+--------------------------------------------
+Policy hubs also need to run cf-serverd(8). Again an rc.d(8) script
+is provided which can be added to /etc/rc.conf.local:
- http://www.cfengine.org/manuals/cf3-reference.html
+pkg_scripts="${pkg_scripts} cf_serverd"
-cf-report process could be limited by maximum number of openfiles defined in
-daemon class, thus consider bumping the openfiles-cur to at least 256 in
-login.conf(5).
+For more information, see the quickstart guide for an introduction, and
+reference manual for more details:
+
+ https://cfengine.com/manuals/cf3-quickstart
+ https://cfengine.com/manuals/cf3-reference
+
+Resource limits
+===============
+cf-report(8) may require more file descriptors than are available by
+default. If you run into problems, increase limits in your shell (for
+example, in ksh(1) you might use "ulimit -n 256").
+
+For a more permanent change, increase the openfiles limits for your
+user's class in /etc/login.conf; this takes effect at login.
+
+Notable changes from cfengine community packages
+================================================
+The standard packages from cfengine.com have their programs
+dynamically-linked to libraries in /var/cfengine/lib, but the OpenBSD
+packages are dynamically-linked to libraries in ${LOCALBASE}. As a
+result, some of the self-repair functionality is not available.
+
+For upstream compatibility, the following symlinks have been installed:
+
+ /var/cfengine/bin/cf-agent -> ${LOCALBASE}/sbin/cf-agent
+ /var/cfengine/bin/cf-execd -> ${LOCALBASE}/sbin/cf-execd
+ /var/cfengine/bin/cf-key -> ${LOCALBASE}/sbin/cf-key
+ /var/cfengine/bin/cf-monitord -> ${LOCALBASE}/sbin/cf-monitord
+ /var/cfengine/bin/cf-promises -> ${LOCALBASE}/sbin/cf-promises
+ /var/cfengine/bin/cf-report -> ${LOCALBASE}/sbin/cf-report
+ /var/cfengine/bin/cf-runagent -> ${LOCALBASE}/sbin/cf-runagent
+ /var/cfengine/bin/cf-serverd -> ${LOCALBASE}/sbin/cf-serverd
View
2 sysutils/cfengine/pkg/cfengine.rc
@@ -4,7 +4,7 @@
# "meta" script running the following rc.d(8) scripts with the given argument
-_pkg_scripts="cf_execd cf_serverd cf_monitord"
+_pkg_scripts="cf_execd cf_monitord"
if [ "$1" = stop ]; then
for _i in ${_pkg_scripts}; do _l="${_i} ${_l}"; done

0 comments on commit d78ee40

Please sign in to comment.