aboutsummaryrefslogtreecommitdiffstats
path: root/www/apache13-ssl/Makefile
blob: 868712ed3e455b851516cdc749ca6920c5cfb974 (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
# New ports collection makefile for:    apache-ssl HTTPSD
# Date created:         8th November, 1998
# Whom:         Adam Laurie <adam@algroup.co.uk>
#           based on apache port by ache@nagual.pp.ru
#           and apache-ssl port by Mark Murray <mark@grondar.za>.
#           Oh, and with a little bit of help from Ben :)
#
# $FreeBSD$

PORTNAME=   apache+ssl
PORTVERSION=    ${APACHE_VERSION}.${APACHE_SSL_VERSION}
PORTREVISION=   1
CATEGORIES= www security
MASTER_SITES=   ${MASTER_SITE_APACHE_HTTPD} \
        ${MASTER_SITES_APACHE_SSL:S/$/:ssl/}
DISTNAME=   apache_${APACHE_VERSION}
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} \
        apache_${APACHE_VERSION}+ssl_${APACHE_SSL_VERSION}${EXTRACT_SUFX}:ssl
EXTRACT_ONLY=   ${DISTNAME}${EXTRACT_SUFX}

#PATCH_SITES=       ${MASTER_SITE_APACHE_HTTPD}
#PATCH_SITE_SUBDIR= patches/apply_to_${APACHE_VERSION}
#PATCHFILES=

MAINTAINER= apache@FreeBSD.org
COMMENT=    Apache secure webserver integrating OpenSSL

CONFLICTS=  apache+mod_ssl-1.* apache+mod_ssl+ipv6-1.* apache+mod_ssl+modsnmp-1.* \
        apache+mod_ssl+mod_snmp+ipv6-1.* apache+mod_ssl+mod_accel-1.* \
        apache+mod_ssl+mod_snmp+mod_accel-1.* \
        apache+ipv6-1.* apache-1.* apache-2.* apache_fp-1.* \
        caudium-devel-1.* caudium10-1.* caudium12-* \
        ru-apache+mod_ssl-1.* ru-apache-1.* thttpd-2.*

APACHE_VERSION=     1.3.34
APACHE_SSL_VERSION= 1.57
USE_OPENSSL=        yes
USE_PERL5=      yes
HAS_CONFIGURE=      yes
USE_RC_SUBR=        yes
RC_SCRIPTS_SUB=     PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} WWWOWN=${WWWOWN}
MAKE_ENV+=      EXAMPLESDIR=${EXAMPLESDIR}
USE_APACHE=     common13

MASTER_SITES_APACHE_SSL= \
        ftp://ftp.ox.ac.uk/pub/crypto/SSL/Apache-SSL/ \
        ftp://ftp.it.net.au/mirrors/crypto/SSL/Apache-SSL/ \
        ftp://opensores.thebunker.net/pub/mirrors/apache-ssl/

APACHE_HARD_SERVER_LIMIT?=  512

CFLAGS+=    -I${OPENSSLINC}/openssl
CONFIGURE_ARGS+=    \
        --prefix=${PREFIX} \
        --server-uid=www \
        --server-gid=www \
        --with-perl=${PERL} \
        --with-layout=FreeBSD \
        --without-confadjust \
        --disable-module=auth_dbm \
        --sysconfdir=${PREFIX}/etc/apache \
        --includedir=${PREFIX}/include/apache \
        --localstatedir=/var \
        --datadir=${PREFIX}/www \
        --proxycachedir=${PREFIX}/www/proxy \
        --libexecdir=${PREFIX}/libexec/apache \
        --target=httpsd

#       --enable-shared=remain \

OPTIM=      -DHARD_SERVER_LIMIT=${APACHE_HARD_SERVER_LIMIT} \
        -DDOCUMENT_LOCATION=\\"${PREFIX}/www/data/\\" \
        -DDEFAULT_PATH=\\"/bin:/usr/bin:${PREFIX}/bin\\"

DOCSDIR=    ${PREFIX}/share/doc/apache

.if defined(APACHE_PERF_TUNING)
OPTIM+=     -DBUFFERED_LOGS
CFLAGS+=    -O6 -fomit-frame-pointer
.endif

CONFIGURE_ENV+= OPTIM='${OPTIM}'
CONFIGURE_ENV+= EXTRA_SSL_LIBS="-L${OPENSSLLIB} -L${LOCALBASE}/lib"

.if defined(WITH_SUEXEC)
MAN8=       suexec.8
PLIST_SUB+= SUB_SUEXEC=""
.else
PLIST_SUB+= SUB_SUEXEC="@comment "
.endif

MAN1=       dbmmanage.1 htdigest.1 htpasswd.1
MAN8+=      ab.8 httpsdctl.8 apxs.8 httpsd.8 logresolve.8 rotatelogs.8

.include "${.CURDIR}/Makefile.modules"
.include <bsd.port.pre.mk>

post-extract:
    @cd ${WRKSRC} && ${TAR} xzf ${DISTDIR}/${DIST_SUBDIR}/apache_${APACHE_VERSION}+ssl_${APACHE_SSL_VERSION}${EXTRACT_SUFX}

post-patch:
    @cd ${WRKSRC} && ${SETENV} PREFIX=${PREFIX} ./FixPatch ${OPENSSLBASE}
    @${PATCH} ${PATCH_ARGS} < ${FILESDIR}/post-patch-conf:httpd.conf-dist
    @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
        ${FILESDIR}/apache.sh > ${WRKDIR}/apache.sh
post-install:
    @${ECHO_CMD} ""
    @${ECHO_CMD} "SSL is disabled by default"
    @${ECHO_CMD} "Please read:"
    @${ECHO_CMD} "  http://www.apache-ssl.org/docs.html"
    @${ECHO_CMD} " to know how to configure correctly apache-ssl"
    @${ECHO_CMD} ""
    @${INSTALL_SCRIPT} ${WRKDIR}/apache.sh ${PREFIX}/etc/rc.d

certificate:
    -${MKDIR} ${PREFIX}/etc/apache/certs
    @if [ -f ${OPENSSLDIR}/openssl.cnf ]; then \
        cd ${WRKSRC}/src; ${MAKE} ${MAKE_ENV} $@; \
        ${CP} ${WRKSRC}/SSLconf/conf/httpsd.pem \
        ${PREFIX}/etc/apache/certs/cert.pem; \
    else \
        ${ECHO_CMD} "You must create the file ${OPENSSLDIR}/openssl.cnf first."; \
    fi

.include <bsd.port.post.mk>