summaryrefslogtreecommitdiff
path: root/sysutils/collectd/Makefile.common
blob: f80884308acf455fe33869940ed53ffd5309f725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# $NetBSD: Makefile.common,v 1.27 2021/12/28 01:02:42 nros Exp $
#
# used by sysutils/collectd/Makefile
# used by sysutils/collectd-amqp/Makefile
# used by sysutils/collectd-curl/Makefile
# used by sysutils/collectd-dbi/Makefile
# used by sysutils/collectd-dns/Makefile
# used by sysutils/collectd-gmond/Makefile
# used by sysutils/collectd-gps/Makefile
# used by sysutils/collectd-grpc/Makefile
# used by sysutils/collectd-kafka/Makefile
# used by sysutils/collectd-lua/Makefile
# used by sysutils/collectd-memcachec/Makefile
# used by sysutils/collectd-mongodb/Makefile
# used by sysutils/collectd-mysql/Makefile
# used by sysutils/collectd-network/Makefile
# used by sysutils/collectd-notify_desktop/Makefile
# used by sysutils/collectd-notify-email/Makefile
# used by sysutils/collectd-nut/Makefile
# used by sysutils/collectd-openldap/Makefile
# used by sysutils/collectd-pinba/Makefile
# used by sysutils/collectd-postgresql/Makefile
# used by sysutils/collectd-redis/Makefile
# used by sysutils/collectd-riemann/Makefile
# used by sysutils/collectd-rrdtool/Makefile
# used by sysutils/collectd-snmp/Makefile
# used by sysutils/collectd-tokyotyrant/Makefile
# used by sysutils/collectd-varnish/Makefile
# used by sysutils/collectd-virt/Makefile
# used by sysutils/collectd-write_prometheus/Makefile
# used by sysutils/collectd-xen/Makefile
# used by sysutils/collectd-xmms/Makefile
# used by sysutils/collectd-yajl/Makefile
# used by sysutils/p5-collectd/Makefile
# used by sysutils/py-collectd/Makefile

DISTNAME=	collectd-5.12.0
MASTER_SITES=	http://collectd.org/files/
CATEGORIES=	sysutils
EXTRACT_SUFX=	.tar.bz2
EXTRACT_USING=	bsdtar

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://collectd.org/
LICENSE=	gnu-gpl-v2

GNU_CONFIGURE=		yes
USE_LIBTOOL=		yes
USE_TOOLS+=		autoconf automake pkg-config
USE_LANGUAGES=		c c99 c++

DISTINFO_FILE=		${.CURDIR}/../../sysutils/collectd/distinfo
PATCHDIR=		${.CURDIR}/../../sysutils/collectd/patches

.if !empty(COLLECTD_PACKAGE)
PKGNAME?=		${DISTNAME:S/collectd/collectd-${COLLECTD_PACKAGE}/}

DEPENDS+=		collectd>=${PKGVERSION_NOREV}:../../sysutils/collectd

COLLECTD_PLUGINS?=	${COLLECTD_PACKAGE:S/-/_/}

BUILD_TARGET=		${COLLECTD_PLUGINS:S/$/.la/}

.  for plugin in ${COLLECTD_PLUGINS}
CONFIGURE_ARGS+=	--enable-${plugin}
GENERATE_PLIST+=	${ECHO} "lib/collectd/${plugin}.la";
.  endfor

INSTALLATION_DIRS+=	lib/collectd

.  if ${COLLECTD_PLUGINS} == "perl"
post-install:
.  else
do-install:
.  endif
.  for plugin in ${COLLECTD_PLUGINS}
	cd ${WRKSRC} && ${SETENV} ${INSTALL_ENV} \
		${LIBTOOL} --mode=install ${INSTALL_LIB} ${plugin}.la \
		${DESTDIR}${PREFIX}/lib/collectd/${plugin}.la
.  endfor
.endif

.include "../../mk/bsd.prefs.mk"

BUILD_DEFS+=		VARBASE

# special case for grpc++ below
COLLECTD_LIBS=		aquaero5 atasmart curl dbi dpdk esmtp ganglia	\
			gcrypt gps hiredis iptc iptc jansson jevents	\
			ldap memcached microhttpd mnl modbus mongoc	\
			mosquitto mysql netapp netsnmp netsnmpagent	\
			oping owcapi pcap perl pq pqos protobuf		\
			protobuf-c python qpid-proton rabbitmq rdkafka	\
			routeros rrd sensors slurm ssl statgra		\
			tokyotyrant udev upsclient varnish xenctrl xmms	\
			yajl

CONFIGURE_ARGS+=	--with-cuda=no --with-java=no --with-mic=no	\
			--with-oracle=no --with-perl-bindings=no	\
			--disable-all-plugins

.for lib in ${COLLECTD_LIBS}
CONFIGURE_ARGS+=	--with-lib${lib}=${COLLECTD_LIB.${lib}:Uno}
.endfor
# can't use ENABLE_LIB.grpc++ as a variable name
CONFIGURE_ARGS+=	--with-libgrpc++=${COLLECTD_LIB.grpcpp:Uno}

CONFIGURE_ARGS+=	--disable-werror
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}

CONFIGURE_ARGS.NetBSD+=	ac_cv_func_getfsstat=no
# aarch64 accidentally had this function for a bit.
CONFIGURE_ARGS.NetBSD+=	c_cv_have_htonll=no

CPPFLAGS.SunOS+=	-DSOLARIS2=${OS_VERSION:C/5.//}

SUBST_CLASSES+=		ver
SUBST_MESSAGE.ver=	Fixing canonical version number
SUBST_STAGE.ver=	pre-configure
SUBST_FILES.ver=	configure.ac
SUBST_SED.ver=		-e 's,m4_esyscmd(./version-gen.sh),${PKGVERSION_NOREV},'

pre-configure:
	cd ${WRKSRC} && autoreconf

.include "../../mk/pthread.buildlink3.mk"