Hi ports@,

Below is a diff that updates sysutils/monit to 5.27.0. Tested on amd64.

Some notes:

1) I added a patch to make sure the -fcf-protection=full compiler option
is not used. If this option is used, the compiler emits
.note.gnu.property ELF section headers and as a result, the produced
binary does not run: some garbage is printed to the screen and the
output ends as follows if I try to run it:
/usr/local/bin/monit[2]:: not found
/usr/local/bin/monit[2]: L: not found
/usr/local/bin/monit[20]: syntax error: `(' unexpected
I don't know if just patching away the use of this compiler option is
the way to go or that something else would be better. Feedback on that
is appreciated.

jasper@ helped me figure out that the presence of the
.note.gnu.property section header was to blame, thanks for that.

2) I made the use of C99 explicit by appending -std=c99 to CFLAGS since
at least C99 is required now. Borrowed from some commits I've seen
from kmos@.

3) The tarball does not contain a README anymore so don't install it
in the post-install target.

Thanks,
Caspar Schutijser


Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/monit/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile    14 Sep 2019 21:18:18 -0000      1.64
+++ Makefile    26 Jul 2020 11:05:17 -0000
@@ -2,7 +2,7 @@
 
 COMMENT=       monitoring and managing daemons utility
 
-DISTNAME=      monit-5.26.0
+DISTNAME=      monit-5.27.0
 
 CATEGORIES=    sysutils
 
@@ -19,6 +19,9 @@ MASTER_SITES= ${HOMEPAGE}/dist/
 
 CONFIGURE_STYLE=gnu
 
+# Must specify C99 for base-gcc
+CFLAGS+=       -std=c99
+
 SUBST_VARS=    LOCALSTATEDIR
 
 pre-configure:
@@ -26,7 +29,6 @@ pre-configure:
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/{doc,examples}/monit
-       ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/monit
        ${INSTALL_DATA} ${WRKSRC}/monitrc ${PREFIX}/share/examples/monit
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/monit/distinfo,v
retrieving revision 1.42
diff -u -p -r1.42 distinfo
--- distinfo    14 Sep 2019 21:18:18 -0000      1.42
+++ distinfo    26 Jul 2020 11:05:17 -0000
@@ -1,2 +1,2 @@
-SHA256 (monit-5.26.0.tar.gz) = h/xFaKOvmivokEDvsWnjouR7Ji+Z541d3emd2J8C88I=
-SIZE (monit-5.26.0.tar.gz) = 1371327
+SHA256 (monit-5.27.0.tar.gz) = 2MDe72JPGTqVJQL+m6q/pm49jQV99XONpD+aN3kq/KQ=
+SIZE (monit-5.27.0.tar.gz) = 1455341
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/sysutils/monit/patches/patch-Makefile_in,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile_in
--- patches/patch-Makefile_in   14 Sep 2019 21:18:18 -0000      1.4
+++ patches/patch-Makefile_in   26 Jul 2020 11:05:17 -0000
@@ -1,12 +1,12 @@
 $OpenBSD: patch-Makefile_in,v 1.4 2019/09/14 21:18:18 sthen Exp $
 
-Using $< in a non-suffix rule context is a GNUmake idiom (Makefile:1279)
+Using $< in a non-suffix rule context is a GNUmake idiom.
 
 Index: Makefile.in
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -1297,7 +1297,7 @@ cleanall: clean distclean
-       -rm -rf m4 config
+@@ -1326,7 +1326,7 @@ cleanall: clean distclean
+       -git clean -fxd
  
  monit.1: doc/monit.pod
 -      $(POD2MAN) $(POD2MANFLAGS) $< > $@
@@ -14,3 +14,16 @@ Index: Makefile.in
        -rm -f pod2*
  
  # -------------
+@@ -1337,10 +1337,10 @@ src/y.tab.c src/y.tab.h: run-yacc
+ 
+ .INTERMEDIATE: run-yacc
+ run-yacc: src/p.y
+-      $(YACC) $(YACCFLAGS) -o src/y.tab.c $<
++      $(YACC) $(YACCFLAGS) -o src/y.tab.c src/p.y
+ 
+ src/lex.yy.c: src/l.l
+-      $(FLEX) $(FLEXFLAGS) -o$@ $<
++      $(FLEX) $(FLEXFLAGS) -o$@ src/l.l
+ @WITH_CODESIGN_TRUE@all-local: $(bin_PROGRAMS)
+ @WITH_CODESIGN_TRUE@  $(foreach file, $(bin_PROGRAMS), codesign -s 
$(CODESIGN_IDENTITY) -v --deep --timestamp --options runtime $(file))
+ 
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure     26 Jul 2020 11:05:17 -0000
@@ -0,0 +1,51 @@
+$OpenBSD$
+
+Patch away the detection/use of -fcf-protection=full. This compiler option
+results in .note.gnu.property ELF section headers being emitted and (at least)
+ld.lld(1) does not like this section header.
+
+Index: configure
+--- configure.orig
++++ configure
+@@ -4473,41 +4473,6 @@ else
+   :
+ fi
+ 
+-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler 
accepts -fcf-protection=full" >&5
+-$as_echo_n "checking whether C compiler accepts -fcf-protection=full... " 
>&6; }
+-if ${ax_cv_check_cflags___fcf_protection_full+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-  ax_check_save_flags=$CFLAGS
+-  CFLAGS="$CFLAGS  -fcf-protection=full"
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-  ax_cv_check_cflags___fcf_protection_full=yes
+-else
+-  ax_cv_check_cflags___fcf_protection_full=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+-  CFLAGS=$ax_check_save_flags
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
$ax_cv_check_cflags___fcf_protection_full" >&5
+-$as_echo "$ax_cv_check_cflags___fcf_protection_full" >&6; }
+-if test "x$ax_cv_check_cflags___fcf_protection_full" = xyes; then :
+-  CFLAGS="$CFLAGS -fcf-protection=full"
+-else
+-  :
+-fi
+-
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler 
accepts -fstack-clash-protection" >&5
+ $as_echo_n "checking whether C compiler accepts -fstack-clash-protection... " 
>&6; }
+ if ${ax_cv_check_cflags___fstack_clash_protection+:} false; then :
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/monit/pkg/PLIST,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST
--- pkg/PLIST   1 May 2019 19:21:57 -0000       1.11
+++ pkg/PLIST   26 Jul 2020 11:05:17 -0000
@@ -3,7 +3,6 @@
 @bin bin/monit
 @man man/man1/monit.1
 share/doc/monit/
-share/doc/monit/README
 share/examples/monit/
 share/examples/monit/monitrc
 @mode 0600

Reply via email to