On 2017/11/26 00:41, Rodrigo Mosconi wrote:
> Fixed and updated the port to the latest LTS version.
The time_t %ld -> %lld patches are still needed. You will see warnings in
build on amd64; these will cause breakage on 32-bit arches.
There's some other problem with the patches - applying your diff and
doing "make clean; make patch" in the port doesn't work.
> -@cwd ${CFENGINE_BASE}
> -bin/
> -bin/cf-agent
> -bin/cf-execd
> -bin/cf-key
> -bin/cf-monitord
> -bin/cf-promises
> -bin/cf-runagent
> -bin/cf-serverd
> -bin/cf-upgrade
> @mode 0750
> @sample ${CFENGINE_BASE}/
> @mode 0700
> @@ -375,5 +386,15 @@ bin/cf-upgrade
> @sample ${CFENGINE_BASE}/modules/
> @sample ${CFENGINE_BASE}/outputs/
> @sample ${CFENGINE_BASE}/ppkeys/
> -@mode
> @extraunexec rm -rf ${CFENGINE_BASE}/*
> +@cwd ${CFENGINE_BASE}
> +@exec mkdir ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-agent ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-execd ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-key ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-monitord ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-promises ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-runagent ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-serverd ${CFENGINE_BASE}/bin
> +@exec-add ln -s ${LOCALBASE}/bin/cf-upgrade ${CFENGINE_BASE}/bin
> +@mode
I think this is the wrong workaround. For a start, "pkg_add cfengine;
pkg_delete cfengine" will leave the bin files lying around.
However according to the README, "courtesy symlinks are provided in
/var/cfengine/bin for compatibility with standard documentation." --
can't we just kill the symlinks and tell users to adapt?
Otherwise...this diff does get the package through pkg_add's symlink
bogosity check (because the symlink targets then exist within the same
@cwd prefix as the symlinks themselves), but it's still IMO rather
dirty.
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/Makefile,v
retrieving revision 1.56
diff -u -p -r1.56 Makefile
--- Makefile 19 Nov 2016 15:28:40 -0000 1.56
+++ Makefile 26 Nov 2017 11:30:32 -0000
@@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.56 2016/11/19 15:28:40 sthen Exp $
-BROKEN = pkg_add fails: problem with symlinks
-
COMMENT = GNU system administration tool for networks
DISTNAME = cfengine-3.7.2
+REVISION = 0
SHARED_LIBS += promises 0.0 # 1.0
CATEGORIES = sysutils
@@ -19,7 +18,7 @@ WANTLIB += c crypto iconv lzma m pam pcr
MASTER_SITES = https://cfengine-package-repos.s3.amazonaws.com/tarballs/
-CFENGINE_BASE = /var/cfengine
+CFENGINE_BASE = var/cfengine
CFENGINE_EXAMPLES = ${PREFIX}/share/examples/cfengine
SUBST_VARS += CFENGINE_BASE CFENGINE_EXAMPLES
@@ -47,7 +46,7 @@ CONFIGURE_ARGS = --with-openssl=/usr \
--with-qdbm \
--without-tokyocabinet \
--disable-fhs \
- --with-workdir=${CFENGINE_BASE}
+ --with-workdir=/${CFENGINE_BASE}
MAKE_FLAGS += examplesdir="${CFENGINE_EXAMPLES}" \
masterfilesdir="${CFENGINE_EXAMPLES}/CoreBase"
@@ -80,10 +79,10 @@ post-extract:
${WRKDIST}/ext/Makefile.in
post-install:
- ${INSTALL_PROGRAM_DIR} ${WRKINST}${CFENGINE_BASE}/bin
+ ${INSTALL_PROGRAM_DIR} ${WRKINST}/${CFENGINE_BASE}/bin
.for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-upgrade \
cf-runagent cf-serverd
- ln -s ${TRUEPREFIX}/bin/$i ${WRKINST}${CFENGINE_BASE}/bin/
+ ln -s ${TRUEPREFIX}/bin/$i ${WRKINST}/${CFENGINE_BASE}/bin/
.endfor
.include <bsd.port.mk>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/pkg/PLIST,v
retrieving revision 1.14
diff -u -p -r1.14 PLIST
--- pkg/PLIST 22 Jan 2016 11:38:23 -0000 1.14
+++ pkg/PLIST 26 Nov 2017 11:30:32 -0000
@@ -357,23 +357,24 @@ share/examples/cfengine/zenoss.cf
@rcscript ${RCDIR}/cf_monitord
@rcscript ${RCDIR}/cf_serverd
@rcscript ${RCDIR}/cfengine
-@cwd ${CFENGINE_BASE}
-bin/
-bin/cf-agent
-bin/cf-execd
-bin/cf-key
-bin/cf-monitord
-bin/cf-promises
-bin/cf-runagent
-bin/cf-serverd
-bin/cf-upgrade
+@cwd /
@mode 0750
-@sample ${CFENGINE_BASE}/
+${CFENGINE_BASE}/
+@mode
+${CFENGINE_BASE}/bin/
+${CFENGINE_BASE}/bin/cf-agent
+${CFENGINE_BASE}/bin/cf-execd
+${CFENGINE_BASE}/bin/cf-key
+${CFENGINE_BASE}/bin/cf-monitord
+${CFENGINE_BASE}/bin/cf-promises
+${CFENGINE_BASE}/bin/cf-runagent
+${CFENGINE_BASE}/bin/cf-serverd
+${CFENGINE_BASE}/bin/cf-upgrade
@mode 0700
-@sample ${CFENGINE_BASE}/inputs/
-@sample ${CFENGINE_BASE}/masterfiles/
-@sample ${CFENGINE_BASE}/modules/
-@sample ${CFENGINE_BASE}/outputs/
-@sample ${CFENGINE_BASE}/ppkeys/
+@sample /${CFENGINE_BASE}/inputs/
+@sample /${CFENGINE_BASE}/masterfiles/
+@sample /${CFENGINE_BASE}/modules/
+@sample /${CFENGINE_BASE}/outputs/
+@sample /${CFENGINE_BASE}/ppkeys/
@mode
-@extraunexec rm -rf ${CFENGINE_BASE}/*
+@extraunexec rm -rf /${CFENGINE_BASE}/*
Index: pkg/README
===================================================================
RCS file: /cvs/ports/sysutils/cfengine/pkg/README,v
retrieving revision 1.2
diff -u -p -r1.2 README
--- pkg/README 12 Jul 2014 11:25:00 -0000 1.2
+++ pkg/README 26 Nov 2017 11:30:32 -0000
@@ -20,12 +20,12 @@ Create a key-pair, necessary directories
# cf-key
# cp -pR ${LOCALBASE}/share/examples/cfengine/CoreBase/* \
- /var/cfengine/masterfiles/
+ /${CFENGINE_BASE}/masterfiles/
Edit the files you have just copied as appropriate. You will certainly
need to change the domain and probably acl here:
- # $EDITOR /var/cfengine/masterfiles/def.cf
+ # $EDITOR /${CFENGINE_BASE}/masterfiles/def.cf
Bootstrap the server, using its own IP address:
@@ -62,10 +62,10 @@ 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
+dynamically-linked to libraries in /${CFENGINE_BASE}/lib, but the OpenBSD
packages are dynamically-linked to libraries in ${LOCALBASE}. As a
result, some of the self-repair functionality is not available.
As per package(5) standards, the program files are installed under
-${LOCALBASE}/sbin; courtesy symlinks are provided in /var/cfengine/bin
+${LOCALBASE}/sbin; courtesy symlinks are provided in /${CFENGINE_BASE}/bin
for compatibility with standard documentation.