summaryrefslogtreecommitdiffstats
path: root/www/apache21/Makefile
blob: 2002c2a53852882a0d4aa423d380409bddc9a4b6 (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
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
146
147
148
149
150
151
152
# New ports collection makefile for:	apache2
# Date created:				7 April 2001
# Whom:					Hye-Shik Chang <perky@fallin.lv>
#
# $FreeBSD$
#

PORTNAME=	apache
PORTVERSION=	2.0.39
PORTREVISION=	1
CATEGORIES=	www ipv6
MASTER_SITES=	http://www.apache.org/dist/httpd/ \
		http://apache.mirrorcentral.com/dist/httpd/ \
		http://apache.missouri.edu/dist/httpd/ \
		http://ftp.epix.net/apache/dist/httpd/ \
		ftp://ftp.digex.net/pub/packages/network/apache/httpd/ \
		ftp://ftp.cuckoo.com/pub/mirrors/apache/dist/httpd/ \
		http://www.freebsd.org/gifs/:freebsd \
		http://www2.freebsd.org/gifs/:freebsd
DISTNAME=	httpd-${PORTVERSION}
DISTFILES=	${DISTNAME}.tar.gz powerlogo.gif:freebsd
EXTRACT_ONLY=	${DISTNAME}.tar.gz

MAINTAINER?=	perky@fallin.lv

LATEST_LINK=	apache2

WITH_MPM?=	prefork
HTTP_PORT?=	80

HAS_CONFIGURE=	yes
USE_PERL5=	yes
USE_REINPLACE=	yes
CONFIGURE_ARGS=	--prefix=${PREFIX_RELDEST} \
		--enable-layout=FreeBSD \
		--with-perl=${PERL5} \
		--enable-so \
		--with-mpm=${WITH_MPM} \
		--with-port=${HTTP_PORT} \
		--libdir=${PREFIX_RELDEST}/lib/apache2 \
		--includedir=${PREFIX_RELDEST}/include/apache2
CONFIGURE_ENV=	CC="${CC}" CPPFLAGS="${CPPFLAGS}" CFLAGS="${CFLAGS}" \
		LDFLAGS="${LDFLAGS}" EXPAT_PATHS="${EXPAT_PATHS}"
SHARED_MODULES= all cgid ext_filter bucketeer
PREFIX_RELDEST=	${PREFIX:S,${DESTDIR},,}
RC_SUB=		-e 's,@@PREFIX@@,${PREFIX_RELDEST},g'
MAKE_ENV+=	DESTDIR=${DESTDIR} EXPR_COMPAT=yes
PLIST_SUB+=	DESTDIR=${DESTDIR}

.if defined(NOPORTDOCS)
MAKE_ENV+=	-DNOPORTDOCS
.endif

.if defined(WITH_BUNDLED_EXPAT)
EXPAT_PATHS=	xml/expat-cvs xml/expat $$srcdir/xml/expat
PLIST_SUB+=	EXPAT=""
.else
LIB_DEPENDS=	expat.2:${PORTSDIR}/textproc/expat2
EXPAT_PATHS=	${LOCALBASE} ${PREFIX} ${LOCALBASE:S,${DESTDIR},,}
PLIST_SUB+=	EXPAT="@comment "
.endif

.if !defined(WITHOUT_SSL) && exists(/usr/lib/libcrypto.so)
SHARED_MODULES+= ssl
PLIST_SUB+=	MODSSL=""
RC_SUB+=	-e 's,@@SSL@@,ssl,g'
.else
PLIST_SUB+=	MODSSL="@comment "
RC_SUB+=	-e 's,@@SSL@@,,g'
.endif

.if defined(WITH_SUEXEC)
SUEXEC_DOCROOT?= ${PREFIX_RELDEST}/www/data
SUEXEC_USERDIR?= public_html
CONFIGURE_ARGS+= --enable-suexec \
		--with-suexec-caller=www \
		--with-suexec-uidmin=1000 --with-suexec-gidmin=1000 \
		--with-suexec-userdir="${SUEXEC_USERDIR}" \
		--with-suexec-docroot="${SUEXEC_DOCROOT}" \
		--with-suexec-safepath="${PREFIX_RELDEST}/bin:${LOCALBASE}/bin:/usr/bin:/bin" \
		--with-suexec-logfile="/var/log/httpd-suexec.log" \
		--with-suexec-bin="${PREFIX_RELDEST}/sbin/suexec"
PLIST_SUB+=	SUEXEC=""
.else
PLIST_SUB+=	SUEXEC="@comment "
.endif

.if !defined(WITHOUT_CACHE) && defined(WITH_THREADS)
SHARED_MODULES+= cache file-cache disk-cache mem_cache
PLIST_SUB+=	MODCACHE=""
.else
PLIST_SUB+=	MODCACHE="@comment "
.endif

.if !defined(WITHOUT_PROXY)
SHARED_MODULES+= proxy proxy-connect proxy-ftp proxy-http
PLIST_SUB+=	MODPROXY=""
.else
PLIST_SUB+=	MODPROXY="@comment "
.endif

.if defined(WITH_EXPERIMENTAL)
SHARED_MODULES+= case_filter case_filter_in deflate ext_filter charset_lite
PLIST_SUB+=	EXPERIMENTAL=""
.else
PLIST_SUB+=	EXPERIMENTAL="@comment "
.endif

.if ${WITH_MPM} != "prefork"
PKGNAMESUFFIX=	-${WITH_MPM}
WITH_THREADS=	yes
.if !defined(FORCE_THREADING_MPM)
FORBIDDEN=	"doesn\'t work with threading MPMs on FreeBSD. If you are \
		brave enough, make again with -DFORCE_THREADING_MPM"
.endif
.endif

.if defined(WITH_THREADS)
CONFIGURE_ARGS+= --enable-threads
.endif

CONFIGURE_ARGS+= --enable-mods-shared="${SHARED_MODULES}" ${CONFIGURE_TARGET}

MAN1=		dbmmanage.1 htdigest.1 htpasswd.1
MAN8=		ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8 suexec.8

post-extract:
	@${CP} ${DISTDIR}/powerlogo.gif ${WRKSRC}/docs/icons/freebsd.gif

post-patch:
	@cd ${WRKSRC}/docs/docroot && \
	 for f in index.html.*; do (\
	  ${REINPLACE_CMD} -e 's,apache_pb,icons/freebsd.gif" \
		ALT="[Powered by FreeBSD]"><IMG SRC="apache_pb2_ani,g' $$f \
	 ); done
	@${REINPLACE_CMD} -e 's,/usr .*/xml/expat,\$${EXPAT_PATHS},g' \
		${WRKSRC}/srclib/apr-util/configure
	@${FIND} ${WRKSRC} \( -name "*.orig" -or -name "*.bak" \) -exec ${RM} -f {} \;
	@${SED} ${RC_SUB} ${FILESDIR}/apache.sh >${WRKDIR}/apache2.sh
	@${SED} ${RC_SUB} ${FILESDIR}/config.layout >>${WRKSRC}/config.layout
	@${RM} -f ${WRKSRC}/docs/manual/index.html.ko.euc-kr

pre-install:
	PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL

post-install:
	@if [ ! -f ${PREFIX}/etc/rc.d/apache2.sh ]; then \
		${ECHO} "Installing ${PREFIX}/etc/rc.d/apache2.sh startup file."; \
		${INSTALL_SCRIPT} -m 751 ${WRKDIR}/apache2.sh ${PREFIX}/etc/rc.d/apache2.sh; \
	fi

.include <bsd.port.mk>
OpenPOWER on IntegriCloud