aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/rsyslog5/Makefile
blob: 52fd7b115a468777dbfd425ab06ad05185557e08 (plain) (blame)
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
# New ports collection makefile for: rsyslog4
# Date created:     29 December 2008
# Whom:             Cristiano Rolim Pereira <cristianorolim@hotmail.com>
#
# $FreeBSD$
#

PORTNAME=   rsyslog
PORTVERSION=    5.6.2
PORTREVISION=   1
CATEGORIES= sysutils
MASTER_SITES=   http://www.rsyslog.com/files/download/rsyslog/
.ifdef MNAME
PKGNAMESUFFIX?= -${MNAME}
.endif

MAINTAINER= pgollucci@FreeBSD.org
COMMENT?=   Syslogd supporting SQL, TCP and TLS

.ifdef MNAME
RUN_DEPENDS=    rsyslog>=${PORTVERSION}:${PORTSDIR}/sysutils/rsyslog5
PLIST=      ${.CURDIR}/pkg-plist
LATEST_LINK=    rsyslog5-${MNAME}
.else
LATEST_LINK=    rsyslog5
.endif

PORTSCOUT=  limit:^5.6

.ifdef WITH_MYSQL_MICROSECONDS
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-mysql-microseconds
.endif

.ifdef WITH_SANE_HOSTNAME
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-sane-hostname
.endif

CONFLICTS=  rsyslog-[!5].[!5].[0-9]*
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
GNU_CONFIGURE=  yes

# XXX: 5.5.6+ seem to crash frequently with low-mid load 
# on FreeBSD, temporailiy enable debugging by default.
# Now we can send gdb backtraces into the list:
# rsyslog-users <rsyslog@lists.adiscon.com>
OPTIONS=    DEBUG   "Enable debugging"  on

.ifdef WITH_DEBUG
CONFIGURE_ARGS+=--enable-rtinst --enable-debug
.endif

.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
CPPFLAGS+=-march=i686
.endif
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

.ifndef MNAME
MAN8=   rsyslogd.8
MAN5=   rsyslog.conf.5

USE_RC_SUBR=    ${PORTNAME}d
SUB_FILES=  pkg-message

CONFIGURE_ARGS+=--enable-imfile --enable-mail --enable-imtemplate --enable-testbench=no

post-patch:
    @${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|/usr/local/lib/rsyslog/|${PREFIX}/lib/rsyslog/|'\
        ${WRKSRC}/tools/syslogd.c
    @${GREP} -rl '/etc/rsyslog.conf' ${WRKSRC}|${XARGS} ${REINPLACE_CMD} -e\
        's|/etc/rsyslog.conf|${PREFIX}/etc/rsyslog.conf|'
    @${FIND} ${WRKSRC} -name '*.bak' -delete

post-install:
.ifndef NOPORTDOCS
    @${INSTALL} -d ${DOCSDIR}/
    @${INSTALL_DATA} ${WRKSRC}/doc/*html ${DOCSDIR}/
    @${INSTALL_DATA} ${WRKSRC}/doc/*jpg ${DOCSDIR}/
.endif
.ifndef NOPORTEXAMPLES
    @${INSTALL} -d ${EXAMPLESDIR}
    @${INSTALL_DATA} ${WRKSRC}/doc/rsyslog-example.conf ${EXAMPLESDIR}
.endif
    @${CAT} ${PKGMESSAGE}
.endif

.ifdef MNAME

.if ${MNAME} == "snmp" && ${ARCH} == "i386" && ${OSVERSION} >= 800000
BROKEN=     Does not link on i386: can't find symbol snmp_timeout in libnetsnmp
.endif

CONFIGURE_ARGS+=    --disable-rsyslogd --disable-klog

DESCR?=     ${.CURDIR}/../rsyslog5/pkg-descr
DISTINFO_FILE?= ${.CURDIR}/../rsyslog5/distinfo
.endif

.if ${OSVERSION} < 700042
USE_GCC=    4.2+
.endif

.include <bsd.port.post.mk>