aboutsummaryrefslogtreecommitdiffstats
path: root/russian/apache13-modssl/Makefile
blob: 54733444b33be576e2b2c3b45f767cc98ca849f8 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# New ports collection makefile for:    Russian Apache + mod_ssl
# Date created:     7 July 2000 1:05 MSD
# Whom:         Dmitry Sivachenko <dima@Chg.RU>
#
# $FreeBSD$
#

PORTNAME=   apache+mod_ssl
PORTVERSION=    ${VERSION_APACHE}+${VERSION_RA}+${VERSION_MODSSL}
CATEGORIES= russian www security
MASTER_SITES=   ${MASTER_SITE_APACHE_HTTPD} \
        ${MASTER_SITES_MODSSL:S/$/:modssl/} \
        ${MASTER_SITES_RA:S/$/:rapatches/}
DISTNAME=   apache_${VERSION_APACHE}
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} \
        mod_ssl-${VERSION_MODSSL}-${VERSION_APACHE}${EXTRACT_SUFX}:modssl \
        patches_${VERSION_APACHE}rusPL${VERSION_RA}.tar.gz:rapatches

MAINTAINER= lev@FreeBSD.org
COMMENT=    The Russian Apache webserver with SSL/TLS functionality

LIB_DEPENDS=    mm.13:${PORTSDIR}/devel/mm

MASTER_SITES_MODSSL=    http://www.modssl.org/source/ \
            ftp://ftp.modssl.org/source/ \
            ftp://ftp.pca.dfn.de/pub/tools/net/mod_ssl/ \
            ftp://ftp.ecrc.net/pub/security/mod_ssl/ \
            ftp://ftp.nvg.ntnu.no/pub/unix/mod_ssl/ \
            ftp://ftp.ulpgc.es/pub/mod_ssl/ \
            ftp://glock.missouri.edu/pub/mod_ssl/ \
            ftp://ftp.fu-berlin.de/unix/security/mod_ssl/ \
            ftp://ftp.ntrl.net/pub/mirror/ralfsw/mod_ssl/

MASTER_SITES_RA=    ftp://ftp.lexa.ru/pub/apache-rus/ \
            ftp://ftp.lexa.ru/pub/apache-rus/old-versions/

# New feature: conflicts
CONFLICTS=  apache+ipv6-* \
        apache+mod_ssl-* \
        apache-* \
        apache_fp-* \
        publicfile-* \
        apache+mod_ssl-*

USE_OPENSSL=    YES
USE_PERL5=  yes

.include <bsd.port.pre.mk>

VERSION_APACHE= 1.3.27
VERSION_MODSSL= 2.8.14
VERSION_RA= 30.17

#
# some defaults
#

DATADIR=${PREFIX}/www
DOCUMENT_ROOT=${DATADIR}/data
DEFAULT_PATH?=/bin:/usr/bin:${PREFIX}/bin

#
# suexec support
#
.if defined(WITH_APACHE_SUEXEC)

APACHE_SUEXEC_DOCROOT?=${DOCUMENT_ROOT}
APACHE_SUEXEC_LOG?=/var/log/httpd-suexec.log
APACHE_SUEXEC_USERDIR?=public_html

SUEXEC_CONF=\
     --enable-suexec \
     --suexec-docroot=${APACHE_SUEXEC_DOCROOT} \
     --suexec-caller=www \
     --suexec-uidmin=1000 \
     --suexec-gidmin=1000 \
     --suexec-logfile=${APACHE_SUEXEC_LOG} \
     --suexec-userdir=${APACHE_SUEXEC_USERDIR} \
     --suexec-safepath=${DEFAULT_PATH}

.if defined(APACHE_SUEXEC_UMASK)
SUEXEC_CONF+=   --suexec-umask=${APACHE_SUEXEC_UMASK}
.endif

PLIST_SUB+= SUEXEC=""
SUEXEC_MAN= suexec.8

.else # WITH_APACHE_SUEXEC

SUEXEC_CONF=
PLIST_SUB+= SUEXEC="@comment "
SUEXEC_MAN=

.endif # WITH_APACHE_SUEXEC

#
# Configutre parameters
#

HAS_CONFIGURE=  yes
CONFIGURE_ARGS= \
         --prefix=${PREFIX} \
         --server-uid=www \
         --server-gid=www \
         --with-perl=${PERL} \
         --with-layout=${FILESDIR}/FreeBSD.layout:FreeBSD \
         --without-confadjust

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

.if defined(WITH_DSO_MODULES)
CONFIGURE_ARGS+=\
         --enable-shared=max \
         --disable-shared=so \
         --disable-shared=charset \
         --enable-module=most \
         --enable-module=auth_db \
         --enable-module=mmap_static \
         --enable-module=define \
         --disable-module=auth_dbm \
         ${SUEXEC_CONF}

PLIST_SUB+=  DSO_MOD=""
.else
CONFIGURE_ARGS+=\
         --enable-shared=remain \
         --enable-module=most \
         --enable-module=auth_db \
         --enable-module=mmap_static \
         --enable-module=define \
         --disable-shared=define \
         --enable-module=ssl \
         --disable-shared=ssl \
         --disable-module=auth_dbm \
         ${SUEXEC_CONF}

PLIST_SUB+=  DSO_MOD="@comment "
.endif

OPTIM=       -DDOCUMENT_LOCATION=\\"${DOCUMENT_ROOT}\\" \
         -DDEFAULT_PATH=\\"${DEFAULT_PATH}\\"

.if defined(APACHE_HARD_SERVER_LIMIT)
OPTIM+=      -DHARD_SERVER_LIMIT=${APACHE_HARD_SERVER_LIMIT}
.else
OPTIM+=      -DHARD_SERVER_LIMIT=512
.endif

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

CONFIGURE_ENV=  CFLAGS='${CFLAGS}' \
        OPTIM='${OPTIM}' \
        SSL_BASE='SYSTEM' \
        EAPI_MM='SYSTEM' \
        PATH="${PREFIX}/bin:${PATH}"

INSTALL_TARGET= install-quiet

MAN1=       dbmmanage.1 htdigest.1 htpasswd.1
MAN8=       ab.8 apachectl.8 apxs.8 httpd.8 logresolve.8 rotatelogs.8 \
        ${SUEXEC_MAN}

TYPE=   test
CRT=
KEY=

pre-fetch:
    @${ECHO_MSG} ""
.if defined(WITH_DSO_MODULES)
    @${ECHO_MSG} "Build all modules (except mod_so and mod_charest) as DSO."
.else
    @${ECHO_MSG} "You could define WITH_DSO_MODULES to build all modules as DSO."
.endif
.if defined(APACHE_PERF_TUNING)
    @${ECHO_MSG} "Build Apache for maximum performance."
.else
    @${ECHO_MSG} "You could define APACHE_PERF_TUNING to build Apache for maximum performace."
.endif
.if defined(APACHE_HARD_SERVER_LIMIT)
    @${ECHO_MSG} "Build Apache with HARD_SERVER_LIMIT=${APACHE_HARD_SERVER_LIMIT}"
.else
    @${ECHO_MSG} "You could define APACHE_HARD_SERVER_LIMIT, default one is 512"
.endif
.if defined(WITH_APACHE_SUEXEC)
    @${ECHO_MSG} "Build apache with suexec support"
    @${ECHO_MSG} "   suexec docroot:  ${APACHE_SUEXEC_DOCROOT}"
    @${ECHO_MSG} "   suexec userdir:  ${APACHE_SUEXEC_USERDIR}"
    @${ECHO_MSG} "   suexec safepath: ${DEFAULT_PATH}"
    @${ECHO_MSG} "   suexec log:      ${APACHE_SUEXEC_LOG}"
    @${ECHO_MSG} "   These values could be defined as APACHE_SUEXEC_DOCROOT, APACHE_SUEXEC_USERDIR, DEFAULT_PATH and APACHE_SUEXEC_LOG."
.else
    @${ECHO_MSG} "You could define WITH_APACHE_SUEXEC to build suexec support."
.endif
    @${ECHO_MSG} ""

pre-patch:
    @cd ${WRKDIR}/apache_${VERSION_APACHE} \
    && ${ECHO_MSG} "===>  Applying Russian Apache extension" \
    && ${PATCH} ${PATCH_DIST_ARGS} < ${WRKDIR}/RA-1.3rusPL${VERSION_RA}.patch
    @cd ${WRKDIR} \
    && tar cf - src conf htdocs | tar xf - -C ${WRKDIR}/apache_${VERSION_APACHE}
    @cd ${WRKDIR}/mod_ssl-${VERSION_MODSSL}-${VERSION_APACHE} \
    && ${ECHO_MSG} "===>  Applying mod_ssl-${VERSION_MODSSL} extension" \
    && ./configure --with-apache=../${DISTNAME} --expert

post-patch:
    @cd ${WRKSRC} \
    && find . -type f -name "*.orig" -print | xargs ${RM} -f

post-build:
    @cd ${WRKSRC} \
    && ${ECHO_MSG} "===>  Creating Dummy Certificate for Server (SnakeOil)" \
    && ${ECHO_MSG} "      [use 'make certificate' to create a real one]" \
    && ${MAKE} certificate TYPE=dummy >/dev/null 2>&1

certificate:
    @cd ${WRKSRC} \
    && ${ECHO_MSG} "===>  Creating Test Certificate for Server" \
    && ${MAKE} certificate TYPE=${TYPE} CRT=${CRT} KEY=${KEY}

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

post-install:
    @if [ ! -f ${PREFIX}/etc/rc.d/apache.sh ]; then \
        ${ECHO} "Installing ${PREFIX}/etc/rc.d/apache.sh startup file."; \
        ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/apache.sh ${PREFIX}/etc/rc.d/apache.sh; \
    fi
.if defined(WITH_SUEXEC)
    @${ECHO_CMD} "sbin/suexec" >> ${TMPPLIST}
.endif

.include <bsd.port.post.mk>