aboutsummaryrefslogtreecommitdiffstats
path: root/security/ike/Makefile
blob: cdfa2523ba796b9e493f1b74147de82451ec81b2 (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
# New ports collection makefile for:    ike
# Date created:     24 march 2007
# Whom:         mgrooms@shrew.net
#
# $FreeBSD$
#

PORTNAME=   ike
PORTVERSION=    2.1.7
CATEGORIES= security net
MASTER_SITES=   http://www.shrew.net/download/ike/
DISTNAME=   ${PORTNAME}-${PORTVERSION}-release
EXTRACT_SUFX=   .tbz2

MAINTAINER= mgrooms@shrew.net
COMMENT=    Shrew Soft IKE daemon and client tools

ONLY_FOR_ARCHS= i386 amd64

USE_RC_SUBR=    iked
USE_BISON=  build
USE_OPENSSL=    yes
USE_CMAKE=  yes
USE_BZIP2=  yes
USE_LDCONFIG=   yes
WRKSRC=     ${WRKDIR}/${PORTNAME}

OPTIONS=    QTGUI       "Enable QT client front end applications" on \
        NATT        "Enable NAT-Traversal (kernel-patch required)" off \
        LDAP        "Enable LDAP XAuth daemon support" off \
        DEBUG       "Enable Debug support" off

MAN1=       ikea.1 ikec.1
MAN5=       iked.conf.5
MAN8=       iked.8

.include <bsd.port.pre.mk>

.ifdef(WITH_DEBUG)
CMAKE_ARGS+=    -DDEBUG=YES
.endif

.ifdef(WITH_LDAP)
USE_OPENLDAP=   YES
CMAKE_ARGS+=    -DLDAP=YES
.endif

.ifdef(WITH_NATT)
CMAKE_ARGS+=    -DNATT=YES
.endif

.ifdef(WITH_QTGUI)
CMAKE_ARGS+=    -DQTGUI=YES
LIB_DEPENDS+=   qt-mt:${PORTSDIR}/x11-toolkits/qt33
.endif

post-patch:
.if defined(WITH_NATT)
. if ${OSVERSION} < 800000
    @${ECHO_MSG} "===> -------------------------------------------------------------------------"
    @${ECHO_MSG} "===> WARNING: You will need to patch your kernel for NAT-T functionality!"
.  if ${OSVERSION} < 600000
    @${ECHO_MSG} "===>   There is no known NAT-T patch for FreeBSD 1 - 5!!!"
.  endif
.  if ${OSVERSION} > 600000 && ${OSVERSION} < 699999
    @${ECHO_MSG} "===>   http://ipsec-tools.sf.net/freebsd6-natt.diff"
.  endif
.  if ${OSVERSION} > 700000 && ${OSVERSION} < 799999
    @${ECHO_MSG} "===>   http://people.freebsd.org/~vanhu/NAT-T/patch-natt-7.2-2009-05-12.diff"
.  endif
    @${ECHO_MSG} "===> You may need to edit the patch if it fails to apply cleanly."
    @${ECHO_MSG} "===> -------------------------------------------------------------------------"
    @sleep 3
. endif
.endif

post-build:
# QT 3.3 UIC (User Interface Compiler) creates these, so remove them.
# Otherwise x11-toolkits/qt33 would have to be patched, as Gentoo did.
.for f in .qt_plugins_* qt_plugins_*
    @${RM} -f ${LOCALBASE}/etc/settings/${f}
.endfor
    @${RMDIR} ${LOCALBASE}/etc/settings || ${TRUE}

post-install:
    @if ! ${SYSCTL} -a | ${GREP} -q ipsec; then \
    ${ECHO_MSG} "===> -------------------------------------------------------------------------"; \
    ${ECHO_MSG} "===> WARNNG: You need IPsec support in your kernel, please see:"; \
    ${ECHO_MSG} "===>   http://www.freebsd.org/doc/en/books/handbook/ipsec.html"; \
    ${ECHO_MSG} "===> -------------------------------------------------------------------------"; \
    fi ;
.if defined(WITH_NATT)
    @${ECHO_MSG} "===> -------------------------------------------------------------------------"
    @${ECHO_MSG} "===> WARNING: To use NAT Traversal ( NAT-T ) support, please be sure to"
    @${ECHO_MSG} "===> include the following line in your kernel config file."
    @${ECHO_MSG} "===>   options IPSEC_NAT_T"
    @${ECHO_MSG} "===> -------------------------------------------------------------------------"
.endif

.include <bsd.port.post.mk>