summaryrefslogtreecommitdiff
path: root/net/ucd-snmp/Makefile
blob: 50fb8bc6b7f02d6973a438fc1439796f7d11a1f3 (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
# $NetBSD: Makefile,v 1.49 2003/06/02 01:17:40 jschauma Exp $

DISTNAME=	ucd-snmp-4.2.4
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=net-snmp/} \
		ftp://ucd-snmp.ucdavis.edu/ \
		ftp://sunsite.cnlab-switch.ch/mirror/ucd-snmp/ \
		ftp://ftp.win.or.jp/pub/network/snmp/ucd-snmp/

MAINTAINER=	tech-pkg@netbsd.org
HOMEPAGE=	http://www.net-snmp.org/
COMMENT=	Extensible SNMP implementation

CONFLICTS+=	net-snmp-[0-9]*

BUILD_DEFS+=	USE_INET6

USE_BUILDLINK2=	# defined
USE_PERL5=	build

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

USE_LIBTOOL=		yes
LIBTOOL_OVERRIDE=	${WRKSRC}/libtool

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-defaults
CONFIGURE_ARGS+=	--with-libwrap=${BUILDLINK_PREFIX.tcp_wrappers}
CONFIGURE_ARGS+=	--with-logfile="/var/log/snmpd"
CONFIGURE_ARGS+=	--with-mib-modules="smux host"
#
# NOTE: if you do not allow dummy values some tools such as
# scotty/tkined may ignore results when they shouldn't.
#
CONFIGURE_ARGS+=	--with-dummy-values
#
# NOTE: without this the default is USER@DOMAINNAME of the package builder
#
CONFIGURE_ARGS+=	--with-sys-contact="default_user@contact.domain"
CONFIGURE_ARGS+=	--with-sys-location="defaultlocation"
CONFIGURE_ARGS+=	--enable-shared
.if defined(USE_INET6) && ${USE_INET6} == "YES"
CONFIGURE_ARGS+=--enable-ipv6
.else
CONFIGURE_ARGS+=--disable-ipv6
.endif

# This might make it easier to use scotty's MIBs and local MIBs.
CONFIGURE_ARGS+=	--with-mibdirs="${PREFIX}/share/snmp/mibs:${PREFIX}/lib/tcl/tnm2.1.10/mibs:${PREFIX}/lib/tnm2.1.8/mibs:/usr/local/share/snmp/mibs"

.if (${OPSYS} == "NetBSD")
CFLAGS+=	-Dnetbsd1
.endif

# Deal with libwrap bogosity by providing these variables to programs which
# do not supply them.
#
post-extract:
	@${ECHO} 'int allow_severity, deny_severity;'			\
		> ${WRKSRC}/snmplib/libwrap.c
	@${LN} ${WRKSRC}/s/netbsd.h ${WRKSRC}/s/netbsdelf.h

pre-configure:
.if (${OPSYS} == NetBSD)
	if [ -f /usr/include/uvm/uvm_param.h ]; then			\
		cd ${BUILDLINK_DIR}/include;				\
		${MKDIR} vm;						\
		${LN} -s /usr/include/uvm/uvm_param.h vm/vm_param.h;	\
	fi
.  if (${LOWER_ARCH} == i386 && ${OS_VERSION:M1.5.[123]*} != "")
	${MKDIR} ${BUILDLINK_DIR}/include/sys
	${LN} -s ${FILESDIR}/disklabel.h ${BUILDLINK_DIR}/include/sys
.  endif
.endif
#
# Adapt for the fact that the default I've seen of ac_max_sed_cmds=90
# will not work w/ built-in sed on Solaris.
#
.if ${OPSYS} == SunOS
	cd ${WRKSRC};							\
	${SED}	's/ac_max_sed_cmds=[0-9][0-9]*/ac_max_sed_cmds=10/'	\
		${CONFIGURE_SCRIPT} > ${CONFIGURE_SCRIPT}.fixed;	\
	${MV} -f ${CONFIGURE_SCRIPT}.orig ${CONFIGURE_SCRIPT}
.endif

post-build:
	${SED} 's,@PREFIX@,${PREFIX},g' < ${FILESDIR}/snmpd.sh > ${WRKDIR}/snmpd
	${SED} 's,@PREFIX@,${PREFIX},g' < ${FILESDIR}/snmptrapd.sh > ${WRKDIR}/snmptrapd

post-install:
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/ucd-snmp
	${INSTALL_DATA} ${WRKSRC}/EXAMPLE.conf ${PREFIX}/share/examples/ucd-snmp
	${INSTALL_DATA_DIR} ${PREFIX}/lib/snmp/dlmod
	${INSTALL_SCRIPT} ${WRKDIR}/snmpd ${PREFIX}/etc/rc.d
	${INSTALL_SCRIPT} ${WRKDIR}/snmptrapd ${PREFIX}/etc/rc.d

.include "../../lang/perl5/buildlink2.mk"
.include "../../security/openssl/buildlink2.mk"
.include "../../security/tcp_wrappers/buildlink2.mk"

.include "../../mk/bsd.pkg.mk"