pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

zabbix50-proxy: Cleanup libssh build and regen configure



Module Name:	pkgsrc-wip
Committed By:	Juraj Lutter <otis%NetBSD.org@localhost>
Pushed By:	otis
Date:		Thu Sep 17 18:29:23 2020 +0000
Changeset:	e9d33e8dfa09a4bd6c8018d7c9ced28f80dbfe5a

Modified Files:
	zabbix50-proxy/Makefile
	zabbix50-proxy/PLIST
	zabbix50-proxy/distinfo
	zabbix50-proxy/options.mk
Added Files:
	zabbix50-proxy/patches/patch-m4_ax__lib__mysql.m4
	zabbix50-proxy/patches/patch-m4_libssh.m4
	zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.am
Removed Files:
	zabbix50-proxy/patches/patch-configure
	zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.in

Log Message:
zabbix50-proxy: Cleanup libssh build and regen configure

This commit brings more changes:
- In order to properly detect libssh >= 0.9.5, change the
  logic directly in libssh.m4
- While here, also fix the bashism for mysql
- configure patch is not needed any longer
- Call autoconf, automake and aclocal before build in order
  to regenerate the apropriate configure and Makefile files
  after m4 patches.
- Change share directory and examples directory component
  from "zabbix" to "zabbix-server". Similar change will be
  applied also for -proxy and -agent when needed. This allows
  to have server and proxy installed at once, without filename
  clashes.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e9d33e8dfa09a4bd6c8018d7c9ced28f80dbfe5a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zabbix50-proxy/Makefile                            | 30 +++++++++++++---
 zabbix50-proxy/PLIST                               | 15 ++++----
 zabbix50-proxy/distinfo                            |  5 +--
 zabbix50-proxy/options.mk                          | 12 +++----
 zabbix50-proxy/patches/patch-configure             | 15 --------
 zabbix50-proxy/patches/patch-m4_ax__lib__mysql.m4  | 15 ++++++++
 zabbix50-proxy/patches/patch-m4_libssh.m4          | 40 ++++++++++++++++++++++
 .../patches/patch-src_zabbix__proxy_Makefile.am    | 12 +++++++
 .../patches/patch-src_zabbix__proxy_Makefile.in    | 15 --------
 9 files changed, 107 insertions(+), 52 deletions(-)

diffs:
diff --git a/zabbix50-proxy/Makefile b/zabbix50-proxy/Makefile
index 135a106a1b..6514596eec 100644
--- a/zabbix50-proxy/Makefile
+++ b/zabbix50-proxy/Makefile
@@ -5,12 +5,14 @@
 PKGNAME=	${DISTNAME:S/-/-proxy-/}
 COMMENT=	Enterprise-class Monitoring Solution for Everyone
 
+CONFLICTS+=	zabbix-[0-9]*
 CONFLICTS+=	zabbix-proxy-[0-9]*
 
-USE_TOOLS+=		pax pkg-config
+USE_TOOLS+=		autoreconf autoconf automake pax pkg-config
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--enable-proxy
 CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=	--datarootdir=${PREFIX}/share/${PKGBASE}
 CONFIGURE_ARGS+=	--with-iconv=${BUILDLINK_PREFIX.iconv}
 CONFIGURE_ARGS+=	--with-ldap=${BUILDLINK_PREFIX.openldap-client}
 CONFIGURE_ARGS+=	--with-libcurl
@@ -20,12 +22,12 @@ CONFIGURE_ARGS+=	--with-libxml2
 CONFIGURE_ARGS+=	--with-openssl=${BUILDLINK_PREFIX.openssl}
 CONFIGURE_ARGS+=	--with-zlib=${BUILDLINK_PREFIX.zlib}
 
-EGDIR=		share/examples/zabbix
+EGDIR=		share/examples/${PKGBASE}
 CONF_FILES+=	${EGDIR}/zabbix_proxy.conf ${PKG_SYSCONFDIR}/zabbix_proxy.conf
 
 RCD_SCRIPTS=	zabbix_proxy
 
-INSTALLATION_DIRS+=	${EGDIR} share/zabbix
+INSTALLATION_DIRS+=	${EGDIR} share/${PKGBASE}
 
 SUBST_CLASSES+=			fix-paths
 SUBST_STAGE.fix-paths=		pre-configure
@@ -34,12 +36,30 @@ SUBST_FILES.fix-paths=		conf/*.conf
 SUBST_FILES.fix-paths+=		man/*.man
 SUBST_SED.fix-paths=		-e 's,/usr/local/etc,${PKG_SYSCONFDIR},g'
 
+SUBST_CLASSES+=			fix-pkgbase
+SUBST_STAGE.fix-pkgbase=	post-patch
+SUBST_MESSAGE.fix-pkgbase=	Fixing PKGBASE.
+SUBST_FILES.fix-pkgbase=	src/zabbix_proxy/Makefile.am
+SUBST_SED.fix-pkgbase=		-e 's,%%PKGBASE%%,${PKGBASE},g'
+
+PLIST_SUBST+=			PKGBASE=${PKGBASE}
+
+CFLAGS.SunOS+=			-DDUK_USE_BYTEORDER=1
+
 .include "../../mk/bsd.prefs.mk"
 
+pre-configure:
+	set -e; cd ${WRKSRC}; \
+	   aclocal -I m4 ; automake -ai --foreign; autoconf -I m4
+
 post-install:
 	cd ${WRKSRC}/database/${ZABBIX_DB_TYPE}; \
-		${PAX} -rw . ${DESTDIR}${PREFIX}/share/zabbix/
-	rm ${DESTDIR}${PREFIX}/share/zabbix/Makefile*
+		${PAX} -rw . ${DESTDIR}${PREFIX}/share/${PKGBASE}/
+	${RM} ${DESTDIR}${PREFIX}/share/${PKGBASE}/Makefile*
+	${RM} ${DESTDIR}${PREFIX}/share/${PKGBASE}/data.sql
+	${RM} ${DESTDIR}${PREFIX}/share/${PKGBASE}/images.sql
+	${MV} ${DESTDIR}${PREFIX}/bin/zabbix_js \
+	   ${DESTDIR}${PREFIX}/bin/zabbix_proxy_js
 
 .include "options.mk"
 
diff --git a/zabbix50-proxy/PLIST b/zabbix50-proxy/PLIST
index ae59358675..f52b171d50 100644
--- a/zabbix50-proxy/PLIST
+++ b/zabbix50-proxy/PLIST
@@ -1,14 +1,11 @@
 @comment $NetBSD$
-bin/zabbix_js
+bin/zabbix_proxy_js
 man/man8/zabbix_proxy.8
 sbin/zabbix_proxy
-share/examples/zabbix/zabbix_proxy.conf
-share/zabbix/data.sql
-${PLIST.mysql}share/zabbix/double.sql
-${PLIST.pgsql}share/zabbix/double.sql
-share/zabbix/images.sql
-share/zabbix/schema.sql
-${PLIST.pgsql}share/zabbix/timescaledb.sql
-@pkgdir share/zabbix/externalscripts
+share/examples/${PKGBASE}/zabbix_proxy.conf
+share/${PKGBASE}/double.sql
+share/${PKGBASE}/schema.sql
+share/${PKGBASE}/timescaledb.sql
+@pkgdir share/${PKGBASE}/externalscripts
 @pkgdir lib/modules
 @pkgdir etc/zabbix_proxy.conf.d
diff --git a/zabbix50-proxy/distinfo b/zabbix50-proxy/distinfo
index 260bfb9553..c7fcaad6ea 100644
--- a/zabbix50-proxy/distinfo
+++ b/zabbix50-proxy/distinfo
@@ -4,6 +4,7 @@ SHA1 (zabbix-5.0.3.tar.gz) = 77923e72cc33109e129c61994008f29cc5c14191
 RMD160 (zabbix-5.0.3.tar.gz) = a1d122b71549a230f21f9d85dbc28042b40ec7ea
 SHA512 (zabbix-5.0.3.tar.gz) = d08a031b334f531320f6b695af3ed7e3514c802ea28e0cec75040c518409e16ab4c591b389091aa12c07129f9b758d050c958967e3e86e725f4595f3b3a90d97
 Size (zabbix-5.0.3.tar.gz) = 18893485 bytes
-SHA1 (patch-configure) = cf647b9ee52a96882d31f8783ac19b66e3e65105
+SHA1 (patch-m4_ax__lib__mysql.m4) = 9786c6bff3d22334263921c201bf241a207a46bc
+SHA1 (patch-m4_libssh.m4) = 8b4ac3964caf94bb0e4939d265dcefc08a07a0df
 SHA1 (patch-src_libs_zbxsysinfo_netbsd_net.c) = 468f2112a3d65b0a73f371194ae15ce0df0ad71c
-SHA1 (patch-src_zabbix__proxy_Makefile.in) = 222264bb6145dcd180657e657899aa960fba6d2e
+SHA1 (patch-src_zabbix__proxy_Makefile.am) = 00c8f9a8d3923df96944e0bcb4f1f4d3a3fb5e76
diff --git a/zabbix50-proxy/options.mk b/zabbix50-proxy/options.mk
index 2a73ad0059..dac394f711 100644
--- a/zabbix50-proxy/options.mk
+++ b/zabbix50-proxy/options.mk
@@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.1 2017/05/21 17:30:03 adam Exp $
 
 PKG_OPTIONS_VAR=		PKG_OPTIONS.zabbix50-proxy
-PKG_SUPPORTED_OPTIONS+=		inet6 libssh2 snmp
+PKG_SUPPORTED_OPTIONS+=		inet6 libssh libssh2 snmp
 PKG_OPTIONS_OPTIONAL_GROUPS=	database
 PKG_OPTIONS_GROUP.database=	mysql pgsql sqlite3
 PKG_SUGGESTED_OPTIONS+=		libssh2 snmp pgsql
@@ -12,13 +12,15 @@ PKG_SUGGESTED_OPTIONS+=		inet6
 
 .include "../../mk/bsd.options.mk"
 
-PLIST_VARS+=		mysql
-PLIST_VARS+=		pgsql
-
 .if !empty(PKG_OPTIONS:Minet6)
 CONFIGURE_ARGS+=	--enable-ipv6
 .endif
 
+.if !empty(PKG_OPTIONS:Mlibssh)
+CONFIGURE_ARGS+=	--with-ssh=${BUILDLINK_PREFIX.libssh}
+.include "../../security/libssh/buildlink3.mk"
+.endif
+
 .if !empty(PKG_OPTIONS:Mlibssh2)
 CONFIGURE_ARGS+=	--with-ssh2=${BUILDLINK_PREFIX.libssh2}
 .include "../../security/libssh2/buildlink3.mk"
@@ -28,7 +30,6 @@ CONFIGURE_ARGS+=	--with-ssh2=${BUILDLINK_PREFIX.libssh2}
 CONFIGURE_ARGS+=	--with-mysql
 .include "../../mk/mysql.buildlink3.mk"
 ZABBIX_DB_TYPE=		mysql
-PLIST.mysql=            yes
 .endif
 
 .if !empty(PKG_OPTIONS:Msnmp)
@@ -40,7 +41,6 @@ CONFIGURE_ARGS+=	--with-net-snmp
 CONFIGURE_ARGS+=	--with-postgresql
 .include "../../mk/pgsql.buildlink3.mk"
 ZABBIX_DB_TYPE=		postgresql
-PLIST.pgsql=            yes
 .endif
 
 .if !empty(PKG_OPTIONS:Msqlite3)
diff --git a/zabbix50-proxy/patches/patch-configure b/zabbix50-proxy/patches/patch-configure
deleted file mode 100644
index 4573979279..0000000000
--- a/zabbix50-proxy/patches/patch-configure
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Fix bash-ism.
-
---- configure.orig	2020-07-13 07:56:36.000000000 +0000
-+++ configure
-@@ -8494,7 +8494,7 @@ fi
- rm -f core conftest.err conftest.$ac_objext \
-     conftest$ac_exeext conftest.$ac_ext
- 
--            if test "$found_mysql_tls" == "yes"; then
-+            if test "$found_mysql_tls" = "yes"; then
- 
- 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS ciphersuites in MySQL library" >&5
- $as_echo_n "checking for TLS ciphersuites in MySQL library... " >&6; }
diff --git a/zabbix50-proxy/patches/patch-m4_ax__lib__mysql.m4 b/zabbix50-proxy/patches/patch-m4_ax__lib__mysql.m4
new file mode 100644
index 0000000000..a976cde4c8
--- /dev/null
+++ b/zabbix50-proxy/patches/patch-m4_ax__lib__mysql.m4
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Fix bash-ism.
+
+--- m4/ax_lib_mysql.m4.orig	2020-08-24 09:42:55.000000000 +0000
++++ m4/ax_lib_mysql.m4
+@@ -236,7 +236,7 @@ AC_DEFUN([AX_LIB_MYSQL],
+             LDFLAGS="${LDFLAGS} ${MYSQL_LDFLAGS}"
+             LIBS="${LIBS} ${MYSQL_LIBS}"
+             LIBMYSQL_TLS_TRY_LINK([no])
+-            if test "$found_mysql_tls" == "yes"; then
++            if test "$found_mysql_tls" = "yes"; then
+                 LIBMYSQL_TLS_CIPHERS_TRY_LINK([no])
+             else
+                 LIBMARIADB_TLS_TRY_LINK([no])
diff --git a/zabbix50-proxy/patches/patch-m4_libssh.m4 b/zabbix50-proxy/patches/patch-m4_libssh.m4
new file mode 100644
index 0000000000..d7791453ce
--- /dev/null
+++ b/zabbix50-proxy/patches/patch-m4_libssh.m4
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Fix libssh >= 0.9.5 detection.
+
+--- m4/libssh.m4.orig	2020-05-10 17:36:06.000000000 +0000
++++ m4/libssh.m4
+@@ -83,13 +83,19 @@ AC_HELP_STRING([--with-ssh@<:@=DIR@:>@],
+          SSH_LDFLAGS=-L/usr/lib
+          SSH_LIBS="-lssh"
+          found_ssh="yes"
+-	 LIBSSH_ACCEPT_VERSION([/usr/include/libssh/libssh.h])
++	 LIBSSH_ACCEPT_VERSION([/usr/include/libssh/libssh_version.h])
++	 if test "x$accept_ssh_version" = "xno"; then
++	    LIBSSH_ACCEPT_VERSION([/usr/include/libssh/libssh.h])
++	 fi
+        elif test -f /usr/local/include/libssh/libssh.h; then
+          SSH_CFLAGS=-I/usr/local/include
+          SSH_LDFLAGS=-L/usr/local/lib
+          SSH_LIBS="-lssh"
+          found_ssh="yes"
+-	 LIBSSH_ACCEPT_VERSION([/usr/local/include/libssh/libssh.h])
++	 LIBSSH_ACCEPT_VERSION([/usr/local/include/libssh/libssh_version.h])
++	 if test "x$accept_ssh_version" = "xno"; then
++	    LIBSSH_ACCEPT_VERSION([/usr/local/include/libssh/libssh.h])
++	 fi
+        else #libraries are not found in default directories
+          found_ssh="no"
+          AC_MSG_RESULT(no)
+@@ -100,7 +106,10 @@ AC_HELP_STRING([--with-ssh@<:@=DIR@:>@],
+          SSH_LDFLAGS=-L$_libssh_dir/lib
+          SSH_LIBS="-lssh"
+          found_ssh="yes"
+-	 LIBSSH_ACCEPT_VERSION([$_libssh_dir/include/libssh/libssh.h])
++	 LIBSSH_ACCEPT_VERSION([$_libssh_dir/include/libssh/libssh_version.h])
++	 if test "x$accept_ssh_version" = "xno"; then
++	    LIBSSH_ACCEPT_VERSION([$_libssh_dir/include/libssh/libssh.h])
++	 fi
+        else #if test -f $_libssh_dir/include/libssh/libssh.h; then
+          found_ssh="no"
+          AC_MSG_RESULT(no)
diff --git a/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.am b/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.am
new file mode 100644
index 0000000000..063faaeacb
--- /dev/null
+++ b/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.am
@@ -0,0 +1,12 @@
+$NetBSD$
+
+Install config file to component's example directory.
+
+--- src/zabbix_proxy/Makefile.am.orig	2020-08-24 09:42:55.000000000 +0000
++++ src/zabbix_proxy/Makefile.am
+@@ -97,4 +97,4 @@ install-data-hook:
+ 	$(MKDIR_P) "$(DESTDIR)$(PROXY_CONFIG_FILE).d"
+ 	$(MKDIR_P) "$(DESTDIR)$(EXTERNAL_SCRIPTS_PATH)"
+ 	$(MKDIR_P) "$(DESTDIR)$(LOAD_MODULE_PATH)"
+-	test -f "$(DESTDIR)$(PROXY_CONFIG_FILE)" || cp "../../conf/zabbix_proxy.conf" "$(DESTDIR)$(PROXY_CONFIG_FILE)"
++	$(INSTALL_DATA) "../../conf/zabbix_proxy.conf" "$(DESTDIR)/${PREFIX}/share/examples/%%PKGBASE%%"
diff --git a/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.in b/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.in
deleted file mode 100644
index fa0dd9d63a..0000000000
--- a/zabbix50-proxy/patches/patch-src_zabbix__proxy_Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-src_zabbix__proxy_Makefile.in,v 1.2 2018/11/12 10:51:34 he Exp $
-
-Install zabbix proxy config in example directory.
-
---- src/zabbix_proxy/Makefile.in.orig	2020-07-13 07:56:40.000000000 +0000
-+++ src/zabbix_proxy/Makefile.in
-@@ -1062,7 +1062,7 @@ install-data-hook:
- 	$(MKDIR_P) "$(DESTDIR)$(PROXY_CONFIG_FILE).d"
- 	$(MKDIR_P) "$(DESTDIR)$(EXTERNAL_SCRIPTS_PATH)"
- 	$(MKDIR_P) "$(DESTDIR)$(LOAD_MODULE_PATH)"
--	test -f "$(DESTDIR)$(PROXY_CONFIG_FILE)" || cp "../../conf/zabbix_proxy.conf" "$(DESTDIR)$(PROXY_CONFIG_FILE)"
-+	cp "../../conf/zabbix_proxy.conf" "$(DESTDIR)${PREFIX}/share/examples/zabbix"
- 
- # Tell versions [3.59,3.63) of GNU make to not export all variables.
- # Otherwise a system limit (for SysV at least) may be exceeded.


Home | Main Index | Thread Index | Old Index