aboutsummaryrefslogtreecommitdiffstats
path: root/devel/apr2/Makefile
blob: 639d6d4a456ed4239fccdf51273ce748a62d2431 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Created by: Garrett Rooney <rooneg@electricjellyfish.net>
# $FreeBSD$

PORTNAME=   apr
PORTVERSION=    2.0.${SNAPDATE}
CATEGORIES= devel
MASTER_SITES=   LOCAL/ohauer
PKGNAMESUFFIX=  2
DISTNAME=   ${PORTNAME}_${SNAPDATE}

MAINTAINER= apache@FreeBSD.org
COMMENT=    Apache Portability Library

LICENSE=    APACHE20

LIB_DEPENDS=    libexpat.so:${PORTSDIR}/textproc/expat2

NO_PACKAGE= yes

# r1676013
SNAPDATE=   20150425134304

USES=       autoreconf:build cpe iconv libtool pathfix perl5 \
        python:2.7,build tar:xz
CPE_PRODUCT=    apr-util
CPE_VENDOR= apache
CPE_VERSION=    ${PORTVERSION:S|.${SNAPDATE}||}
USE_PERL5=      build
USE_LDCONFIG=       yes
GNU_CONFIGURE=      yes

OPTIONS_SUB=        yes
OPTIONS_DEFINE=     DEVELOPER_ONLY
OPTIONS_GROUP=      APR APU
OPTIONS_GROUP_APR=  IPV6 DEVRANDOM
OPTIONS_GROUP_APU=  BDB GDBM MYSQL NDBM PGSQL SQLITE
OPTIONS_RADIO=      CRYPTO
OPTIONS_RADIO_CRYPTO=   SSL NSS
OPTIONS_DEFAULT=    THREADS IPV6 DEVRANDOM BDB GDBM SSL

DEVELOPER_ONLY_DESC=    I want to test apr2 not the maintainer
DEVRANDOM_DESC=     Use /dev/random or compatible
NDBM_DESC=      NDBM support
NSS_DESC=       NSS crypto driver
SSL_DESC=       OpenSSL crypto driver

WRKSRC= ${WRKDIR}/apr

DEVRANDOM_CONFIGURE_WITH=   devrandom

# APR-Util Options
BDB_USE=        BDB=48+
GDBM_CONFIGURE_WITH=    gdbm=${LOCALBASE}
GDBM_LIB_DEPENDS=   libgdbm.so:${PORTSDIR}/databases/gdbm
IPV6_CONFIGURE_ENABLE=  ipv6
MYSQL_CFLAGS=       -I${LOCALBASE}/include -I${LOCALBASE}/include/mysql -DHAVE_MYSQL_H
MYSQL_CONFIGURE_WITH=   mysql=${LOCALBASE}
MYSQL_LIBS=     -L${LOCALBASE}/lib/mysql
MYSQL_USE=      MYSQL=yes
NDBM_CONFIGURE_WITH=    ndbm=/usr
PGSQL_CONFIGURE_ENV=    ac_cv_path_PGSQL_CONFIG=""
PGSQL_CONFIGURE_WITH=   pgsql=${LOCALBASE}
PGSQL_USES=     pgsql
SQLITE_CONFIGURE_WITH=  sqlite3=${LOCALBASE}
SQLITE_USE=     SQLITE=yes

# crypto
SSL_USE=        OPENSSL=yes
SSL_CONFIGURE_WITH= openssl=${OPENSSLBASE}
SSL_CPPFLAGS=       -I${OPENSSLINC}
SSL_LDFLAGS=        -L${OPENSSLLIB}
NSS_LIB_DEPENDS=    libnss3.so:${PORTSDIR}/security/nss
NSS_CPPFLAGS=       -I${LOCALBASE}/include/nss
NSS_LDFLAGS=        -L${LOCALBASE}/lib/nss
NSS_CONFIGURE_WITH= nss=${LOCALBASE}

.include <bsd.port.options.mk>

CONFIGURE_ENV+= CC="${CC}"
CONFIGURE_ARGS+=--with-installbuilddir=${DATADIR}/build-2 \
        --enable-threads \
        --enable-posix-shm \
        --with-expat=${LOCALBASE} \
        --with-iconv=${ICONV_PREFIX}

SHLIB_MAJOR=    0
PLIST_SUB+= SHLIB_MAJOR="${SHLIB_MAJOR}"

# stick BDB here, else BDB_INCLUDE_DIR and BDB_LIB_DIR
# are not resolvable
.if ${PORT_OPTIONS:MBDB}
CONFIGURE_ARGS+=    --with-berkeley-db=${BDB_INCLUDE_DIR}:${BDB_LIB_DIR}
.else
CONFIGURE_ARGS+=    --without-berkeley-db
.endif

.if ! ${PORT_OPTIONS:MDEVELOPER_ONLY}
IGNORE= not for the general public. Maintainer only supports developers of apr
.endif

# crypto required (apache24)
.if ${PORT_OPTIONS:MSSL} || ${PORT_OPTIONS:MNSS}
CONFIGURE_ARGS+=    --with-crypto
.else
CONFIGURE_ARGS+=    --without-crypto
.endif

post-patch:
    ${REINPLACE_CMD} -e 's|%%OSVERSION%%|${OSVERSION}|g' ${WRKSRC}/build/apr_hints.m4
    ${REINPLACE_CMD} -e '1s|${SETENV} python|${PYTHON_CMD}|' \
        ${WRKSRC}/build/gen-build.py
    ${REINPLACE_CMD} -e 's|PrintPath python|PrintPath ${PYTHON_VERSION}|' \
        -e 's|python -c|${PYTHON_VERSION} -c|' \
        ${WRKSRC}/build/buildcheck.sh

pre-configure:
    @(cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${SH} ./buildconf)

pre-install:
# looking forward to sub packages and create the modules directory
    @${MKDIR} ${STAGEDIR}${PREFIX}/lib/apr-2
    @${TOUCH} ${STAGEDIR}${PREFIX}/lib/apr-2/.keep.me

post-install:
    ${FIND} ${STAGEDIR}/${PREFIX}/lib -name \*.so | ${XARGS} ${STRIP_CMD}

test:   build
    @-make test -C ${WRKSRC}

#regression-test:   test

.include <bsd.port.mk>