summaryrefslogtreecommitdiff
path: root/www/aws/Makefile
blob: dcec3916f31baf8c1409355ab16ae4b255afb381 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
# Created by: John Marino <marino@FreeBSD.org>
# $FreeBSD$

PORTNAME=	aws
PORTVERSION=	3.1.0.0
CATEGORIES=	www
MASTER_SITES=	http://downloads.dragonlace.net/src/

MAINTAINER=	marino@FreeBSD.org
COMMENT=	Adacore Ada Web Server and framework

BUILD_DEPENDS=	gprbuild>=20120510:${PORTSDIR}/devel/gprbuild \
		xmlada>=3.2:${PORTSDIR}/textproc/xmlada \
		gnatpython>=20101207:${PORTSDIR}/devel/gnatpython

USE_PYTHON=	yes
USE_BZIP2=	yes
GNU_CONFIGURE=	yes
USE_GMAKE=	yes
USES=		ada
MAKE_JOBS_SAFE=	yes
DOTBUILD=	release
ADDL_RPATH=	${LOCALBASE}/lib:${LOCALBASE}/lib/aws/native/relocatable

OPTIONS_SINGLE=		Secure-Socket-Layer
OPTIONS_DEFINE=		IP6 DEBUG LDAP DSRT RELOC
OPTIONS_DEFAULT=	SSL
NO_OPTIONS_SORT=	yes
OPTIONS_SINGLE_Secure-Socket-Layer= SSL GNUTLS NOSSL

NOSSL_DESC=		Disable SSL support
DSRT_DESC=		Disable shared runtime
RELOC_DESC=		Build shared libraries (default is static)
IP6_DESC=		Support IPv6 instead of IPv4

DESTINY=	${WRKDIR}/destino
MAKE_ENV+=	DESTDIR=${DESTINY} AWK=${AWK}
MAKEFILE=	makefile

CONF_ARGS=	PROCESSORS=${MAKE_JOBS_NUMBER}
CONF_ARGS+=	GCC=ada
CONF_ARGS+=	PYTHON=python${PYTHON_VER}
CONF_ARGS+=	XMLADA=true
CONF_ARGS+=	PRJ_BUILD=${DOTBUILD}
CONF_ARGS+=	prefix=${PREFIX}
CONF_ARGS+=	LPATH=${PREFIX}/lib
CONF_ARGS+=	ZPATH=/usr/lib

.include <bsd.port.options.mk>

###################
##  SSL Support  ##
###################

.if ${PORT_OPTIONS:MSSL}
WITH_OPENSSL_PORT= yes
USE_OPENSSL=	yes
CONF_ARGS+=	SOCKET=openssl
.elif ${PORT_OPTIONS:MGNUTLS}
CONF_ARGS+=	SOCKET=gnutls
LIB_DEPENDS+=	gnutls:${PORTSDIR}/security/gnutls
LIB_DEPENDS+=	crypto:${PORTSDIR}/security/openssl
LIB_DEPENDS+=	gcrypt:${PORTSDIR}/security/libgcrypt
.endif

####################
##  LDAP Support  ##
####################

.if ${PORT_OPTIONS:MLDAP}
USE_OPENLDAP=	yes
CONF_ARGS+=	LDAP=true
.endif

####################
##  IPv6 Support  ##
####################

.if ${PORT_OPTIONS:MIP6}
CONF_ARGS+=	IPv6=true
.endif

#####################
##  Debug Support  ##
#####################

.if ${PORT_OPTIONS:MDEBUG}
CONF_ARGS+=	DEBUG=true
.endif

##############################
##  Shared Runtime Library  ##
##############################

.if ${PORT_OPTIONS:MDSRT}
CONF_ARGS+=	ENABLE_SHARED=false
.endif

############################
##  Default Library Type  ##
############################

.if ${PORT_OPTIONS:MRELOC}
CONF_ARGS+=	DEFAULT_LIBRARY_TYPE=relocatable
.endif

post-patch:
	@${REINPLACE_CMD} \
	   -e 's|@ADDITIONAL_RPATH@|${ADDL_RPATH}|' \
	   -e 's|@PREFIX@|${LOCALBASE}|g' \
		${WRKSRC}/src/src.gpr \
		${WRKSRC}/include/include.gpr

do-configure:
	@cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
		${GMAKE} setup ${CONF_ARGS}

do-build:
	# We cannot use a redefined ALL_TARGET because MAKE_JOBS_SAFE is set
	# for PROCESSORS, but that also sets -j for gmake which breaks build
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
		${GMAKE} build build_doc

test: install
	@cd ${WRKSRC}/regtests && ${SETENV} ${MAKE_ENV} \
		python${PYTHON_VER} testsuite.py

post-install:
	# AWS plist changes due to options are complex, and are not simply
	# additive.  Trying to capture every permutation is error prone and
	# tedious, so a generated PLIST is the way to go.
	@${CP} -pR ${DESTINY}${PREFIX}/ ${PREFIX}/
	@cd ${DESTINY}${PREFIX}; ${FIND} * \( -type f -or -type l \) | \
	   ${SORT} > ${WRKDIR}/PLIST.all
	@cd ${DESTINY}${PREFIX}; ${FIND} * -type d | ${AWK} '/\//' | ${SORT} -r | \
	   ${SED} -e '/lib\/gnat$$/d' -e '/share\/doc$$/d' -e '/share\/gps/d' \
	   -e '/share\/examples$$/d' -e 's/^/@dirrm /g' >> ${WRKDIR}/PLIST.all
	@echo "@unexec rmdir %D/lib/gnat 2>/dev/null || true" >> ${WRKDIR}/PLIST.all
	@echo "@unexec rmdir %D/share/gps/plug-ins 2>/dev/null || true" >> ${WRKDIR}/PLIST.all
	@echo "@unexec rmdir %D/share/gps 2>/dev/null || true" >> ${WRKDIR}/PLIST.all
	@echo "@unexec rmdir %D/share/doc 2>/dev/null || true" >> ${WRKDIR}/PLIST.all
	@echo "@unexec rmdir %D/share/examples 2>/dev/null || true" >> ${WRKDIR}/PLIST.all
	@${CAT} ${WRKDIR}/PLIST.all >> ${TMPPLIST}

.include <bsd.port.mk>