summaryrefslogtreecommitdiff
path: root/net/frr/Makefile
blob: 14dfe99256f74835093a280c5e42a2fd75bf4afe (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
# $NetBSD: Makefile,v 1.10 2022/05/16 11:54:19 kardel Exp $

GITHUB_PROJECT=	frr
VERSION=	8.2.2
GITHUB_TAG=	frr-${VERSION}
DISTNAME=	frr-${VERSION}
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_GITHUB:=FRRouting/}

MAINTAINER=	kardel@NetBSD.org
HOMEPAGE=	https://github.com/FRRouting/frr/
COMMENT=	Frr routing multi protocol suite
LICENSE=	gnu-gpl-v2

CONFLICTS=	quagga-[0-9]*

WRKSRC=			${WRKDIR}/frr-frr-${VERSION}
USE_LANGUAGES=		c c++
USE_TOOLS+=		gmake perl bash pkg-config autoconf automake autoreconf bison
USE_LIBTOOL=		YES
GNU_CONFIGURE=		yes
BUILD_DEFS=		VARBASE
BISON_REQD=		3.3

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

FRR_GROUP?=	_frr
FRR_VTY_GROUP?=	frrvty

FRR_USER?=		_frr
FRR_CONF_MODE=		0640
FRR_CONFDIR_MODE=	0755
FRR_LOG_MODE=		0640

PKG_SYSCONFDIR_PERMS=	${FRR_USER} ${FRR_VTY_GROUP} ${FRR_CONFDIR_MODE}
PKG_SYSCONFSUBDIR=	frr

PKG_GECOS.${FRR_USER}=	FRRouting User
PKG_HOME.${FRR_USER}=	/nonexistent
PKG_SHELL.${FRR_USER}=	/bin/sh

PKG_GROUPS=	${FRR_GROUP} ${FRR_VTY_GROUP}
PKG_USERS=	${FRR_USER}:${FRR_GROUP}

RCD_SUPPLIED=	bgpd ospf6d ospfd ripd ripngd zebra
RCD_SCRIPTS=	${RCD_SUPPLIED} staticd

.for f in ${RCD_SUPPLIED}
RCD_SCRIPT_SRC.${f}=	${WRKSRC}/pkgsrc/${f}.sh
.endfor

USE_TOOLS+=	bash:run
REPLACE_BASH=	tools/frr.in tools/*.sh.in

REPLACE_PYTHON=	tools/generate_support_bundle.py tools/frr-reload.py tools/frr_babeltrace.py

MESSAGE_SUBST+=		FRR_USER=${FRR_USER}
MESSAGE_SUBST+=		FRR_VTY_GROUP=${FRR_VTY_GROUP}

SUBST_CLASSES+=		ids
SUBST_STAGE.ids=	pre-configure
SUBST_MESSAGE.ids=	Fixing user/group references.
SUBST_FILES.ids=	pkgsrc/zebra.sh.in
SUBST_VARS.ids=		FRR_USER FRR_VTY_GROUP

SUBST_CLASSES+=		workdir
SUBST_STAGE.workdir=	post-configure
SUBST_MESSAGE.workdir=	Fixing absolute workdir references.
SUBST_FILES.workdir=	lib/version.h
SUBST_SED.workdir=	-e "s,${WRKDIR},"'{WRKDIR},g'
SUBST_VARS.workdir=

.if ${OPSYS} == "NetBSD"
# prohibit cluttering NetBSD executables with notes
# that are not recognized by the kernel leading to
# confusing but harmless warning messages
CFLAGS+=		-DFRR_XREF_NO_NOTE
.endif

CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
CONFIGURE_ARGS+=	--enable-user=${FRR_USER}
CONFIGURE_ARGS+=	--enable-group=${FRR_GROUP}
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}/run/frr
CONFIGURE_ARGS+=	--enable-multipath=64
CONFIGURE_ARGS+=	--enable-vty-group=${FRR_VTY_GROUP}
CONFIGURE_ARGS+=	--enable-configfile-mask=${FRR_CONF_MODE}
CONFIGURE_ARGS+=	--enable-logfile-mask=${FRR_LOG_MODE}
CONFIGURE_ARGS+=	--enable-fpm
CONFIGURE_ARGS+=	--with-pkg-git-version
CONFIGURE_ARGS+=	--with-pkg-extra-version=/${DISTNAME}
# CONFIGURE_ARGS+=	--enable-address-sanitizer
CONFIGURE_ARGS+=	--enable-dev-build
pre-configure:
	cd ${WRKSRC} && ${SH} bootstrap.sh

#
# remove dynamically acquired .js files
#
post-build:
	cd ${WRKSRC} && rm -f doc/user/_build/html/_static/jquery-*.js doc/user/_build/html/_static/underscore-*.js

.include "../../devel/libyang2/buildlink3.mk"
.include "../../devel/readline/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../net/libcares/buildlink3.mk"
.include "../../textproc/json-c/buildlink3.mk"

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