summaryrefslogtreecommitdiff
path: root/sysutils/syslog-ng/Makefile
blob: 8747c6d0777707b548aa6e29cabb65212b9427fc (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
# $NetBSD: Makefile,v 1.17 2012/02/18 21:03:21 bouyer Exp $

VERS=		3.2.4
DISTNAME=	syslog-ng_${VERS}
PKGNAME=	syslog-ng-${VERS}
PKGREVISION=	3
CATEGORIES=	sysutils
MASTER_SITES=	http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/${VERS}/source/
WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.balabit.com/network-security/syslog-ng/
COMMENT=	Syslog-ng tries to fill the gaps original syslogd's were lacking
LICENSE=	gnu-gpl-v2

PKG_DESTDIR_SUPPORT=	user-destdir

USE_TOOLS+=	flex pkg-config gmake awk:run
USE_LIBTOOL=	YES

GNU_CONFIGURE=		YES
RCD_SCRIPTS=		syslogng
PKG_SYSCONFSUBDIR=	syslog-ng

CONFIGURE_ARGS+=	--enable-tcp-wrapper
CONFIGURE_ARGS+=	--localstatedir=${VARBASE}/db/syslog-ng
CONFIGURE_ARGS+=	--with-pidfile-dir=${VARBASE}/run
CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}

REPLACE_AWK+=		contrib/syslog2ng

EGDIR=			${PREFIX}/share/examples/syslog-ng
DOCDIR=			${PREFIX}/share/doc/syslog-ng

INSTALL_MAKE_FLAGS+=	sysconfdir=${EGDIR}

OWN_DIRS+=	${VARBASE}/db/syslog-ng

BUILD_DEFS+=	VARBASE

CONF_FILES+=	${EGDIR}/modules.conf ${PKG_SYSCONFDIR}/modules.conf
CONF_FILES+=	${EGDIR}/scl.conf ${PKG_SYSCONFDIR}/scl.conf
CONF_FILES+=	${EGDIR}/syslog-ng.conf ${PKG_SYSCONFDIR}/syslog-ng.conf

SUBST_CLASSES+=		unamepath
SUBST_STAGE.unamepath=	post-configure
SUBST_FILES.unamepath=	contrib/syslog2ng
SUBST_VARS.unamepath=	UNAME

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

.include "../../security/tcp_wrappers/buildlink3.mk"
.include "../../sysutils/eventlog/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
BUILDLINK_API_DEPENDS.openssl+=	openssl>=0.9.8
.include "../../security/openssl/buildlink3.mk"

.if ${OPSYS} == "SunOS"
CONFIGURE_ARGS+=	--enable-full-dynamic
CONFIGURE_ARGS+=	--enable-sun-streams
.endif

PKG_OPTIONS_VAR=	PKG_OPTIONS.syslog-ng
PKG_SUPPORTED_OPTIONS=	syslogng-spoof

PKG_OPTIONS_LEGACY_OPTS+=	spoof:syslogng-spoof

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

#
# spoof the original source address of forwarded syslog packets
#
.if !empty(PKG_OPTIONS:Msyslogng-spoof)
CONFIGURE_ARGS+=	--enable-spoof-source
.include "../../devel/libnet11/buildlink3.mk"
.endif

INSTALLATION_DIRS+=	bin
INSTALLATION_DIRS+=	${DOCDIR}
INSTALLATION_DIRS+=	${EGDIR}

post-install:
	${INSTALL_DATA} ${WRKSRC}/INSTALL ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${DOCDIR}
	${INSTALL_DATA} ${WRKSRC}/contrib/syslog-ng.conf.doc ${DESTDIR}${DOCDIR}
	for f in syslog-ng.conf.sample syslog-ng.conf.solaris syslog-ng.service\	; do \
		${INSTALL_DATA} ${WRKSRC}/doc/examples/$${f} ${DESTDIR}${EGDIR};\
	done
	${INSTALL_SCRIPT} ${WRKSRC}/contrib/syslog2ng ${DESTDIR}${PREFIX}/bin

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