1 # (luigiwalser, ngompa): httpd build hates parallelization
2 %define _smp_ncpus_max
8
3 %define contentdir
%{_datadir}/httpd
4 %define docroot
/var
/www
6 %{?!maxmodules:%global maxmodules 128}
7 %{?!serverlimit:%global serverlimit 1024}
12 Summary: The most widely used Web server on the Internet
13 License: Apache
License
15 URL: http
://httpd.apache.org
/
16 Source0: http
://www.apache.org
/dist
/httpd
/httpd
-%version.tar.bz2
19 Source15: ihttpd.service
20 Source16: debug
-sshd.service
21 Source18: ihttpd.dracut
22 Source19: ihttpd.module
-setup
24 # build/scripts patches
25 Patch1: httpd
-2.4.1-apctl.patch
26 Patch2: httpd
-2.4.9-apxs.patch
27 Patch3: httpd
-2.4.1-deplibs.patch
28 Patch5: ihttpd
-2.4.20-layout.patch
29 Patch6: httpd
-2.4.3-apctl
-systemd.patch
30 Patch7: httpd
-2.4.10-detect
-systemd.patch
31 # Features/functional changes
32 Patch20: httpd
-2.4.3-release.patch
33 #Disable in ihttpd to avoid build fail
34 #Patch23: httpd-2.4.4-export.patch
35 Patch24: httpd
-2.4.1-corelimit.patch
36 #Patch26: httpd-2.4.4-r1337344+.patch
37 Patch27: httpd
-2.4.2-icons.patch
38 Patch28: httpd
-2.4.4-r1332643
+.patch
39 # http://marc.info/?l=apache-httpd-dev&m=134867223818085&w=2
40 Patch29: httpd
-2.4.27-systemd.patch
41 Patch30: httpd
-2.4.4-cachehardmax.patch
42 #Patch31: httpd-2.4.18-sslmultiproxy.patch
43 Patch34
: httpd
-2.4.17-socket
-activation.patch
44 #Patch35: httpd-2.4.33-sslciphdefault.patch
46 # http://issues.apache.org/bugzilla/show_bug.cgi?id=32524
47 Patch100
: httpd
-2.4.25-ab_source_address.patch
48 Patch101
: httpd
-2.2.10-ldap_auth_now_modular_in
-apr
-util
-dbd
-ldap_fix.diff
51 Requires: webserver
-base
55 Requires(post
): systemd
>= %{systemd_required_version}
56 Requires(post
): rpm
-helper
>= 0.24.8-1
57 Requires(post
): openssl makedev
58 Requires(preun
): rpm
-helper
>= 0.24.8-1
60 BuildRequires
: apr
-devel apr
-util
-devel
63 This package contains the main binary of apache
, a powerful
, full
-featured
,
64 efficient and freely
-available Web server. Apache is also the most popular Web
65 server on the Internet.
67 This version of apache is fully static
, and few modules are available built
-in.
70 %setup -q
-n httpd
-%{version}
74 %patch3 -p1
-b .deplibs
75 %patch5 -p1
-b .layout
76 %patch6 -p1
-b .apctlsystemd
77 %patch7 -p1
-b .detectsystemd
79 #Disable in ihttpd to avoid build fail
80 #%patch23 -p1 -b .export
81 %patch24 -p1
-b .corelimit
82 #%patch26 -p1 -b .r1337344+
83 %patch27 -p1
-b .icons
84 %patch29 -p1
-b .systemd
85 %patch30 -p1
-b .cachehardmax
87 #%patch31 -p1 -b .sslmultiproxy
88 %patch34 -p1
-b .socketactivation
89 #%patch35 -p1 -b .sslciphdefault
90 #patch44 -p1 -b .luaresume
92 %patch100 -p1
-b .ab_source_address.droplet
93 %patch101 -p0
-b .PR45994.droplet
95 # Patch in vendor/release string
96 sed "s
/@RELEASE@
/%{product_distribution}/" < %{PATCH20} | patch
-p1
98 # forcibly prevent use of bundled apr, apr-util, pcre
99 rm -rf srclib
/{apr
,apr
-util
,pcre
}
103 -e 's|\@exp_installbuilddir\@|
%{_libdir}/httpd
/build|
;' \
104 -e 's|get_vars\
("prefix"\
)|"
%{_libdir}/httpd
/build"|
;' \
105 -e 's|get_vars\
("sbindir"\
) . "
/envvars"|"\$installbuilddir
/envvars"|
;' \
109 find
-type f
-print0 | xargs
-0 perl
-pi \
110 -e 's|
/usr
/local/bin
/perl|perl|g
;' \
111 -e 's|
/usr
/local/bin
/perl5|perl|g
;' \
112 -e 's|
/path
/to
/bin
/perl|perl|g
;'
116 -e 's
/DYNAMIC_MODULE_LIMIT \d
+/DYNAMIC_MODULE_LIMIT
%{maxmodules}/;' \
121 -e 's
/DEFAULT_SERVER_LIMIT \d
+/DEFAULT_SERVER_LIMIT
%{serverlimit}/' \
122 server
/mpm
/prefork
/prefork.c \
123 server
/mpm
/worker
/worker.c \
124 server
/mpm
/event
/event.c
126 # don't try to touch srclib
127 perl
-pi
-e "s|^SUBDIRS
= .
*|SUBDIRS
= os server modules support|g" Makefile.
in
129 # this will only work if configured correctly in the config (FullOs)...
130 cp server
/core.c server
/core.c.untagged
132 # Install index.bin source
133 install -m
644 %{SOURCE1} index.bin.c
137 # regenerate configure scripts
138 autoheader
&& autoconf ||
exit 1
140 # Required to be able to run as root
141 export CFLAGS
="$RPM_OPT_FLAGS
-DBIG_SECURITY_HOLE"
142 ldflags_hacky_workaround_for_systemd_lib_not_added
="
-lsystemd "
143 export LDFLAGS
="$
{ldflags_hacky_workaround_for_systemd_lib_not_added
}-Wl
,-z
,relro
,-z
,now"
145 # Hard-code path to links to avoid unnecessary builddep
146 export LYNX_PATH
=/usr
/bin
/links
149 --enable-layout
=IHttpd \
150 --sysconfdir
='
/etc' \
151 --includedir
='
/usr
/include
/ihttpd' \
152 --libexecdir
='
/usr
/lib64
/ihttpd
/modules' \
153 --datadir
='
/usr
/share
/ihttpd' \
157 --with
-program
-name
='
%name' \
160 --disable
-distcache \
162 --enable-auth
-basic \
163 --enable-authn
-core \
164 --enable-authn
-file \
165 --enable-authz
-core \
166 --enable-authz
-host \
167 --enable-authz
-user \
169 --enable-socache
-shmcb \
173 --enable-log
-config \
176 --enable-modules
=none \
177 --enable-mods
-static
='unixd auth_basic authn_core authn_file authz_core authz_host authz_user rewrite socache_shmcb dir mime log_config cgi ssl'
179 # parallel build fails on the build host
182 export CFLAGS
="$RPM_OPT_FLAGS"
183 gcc index.bin.c
-o index.bin
188 install -D
-p
-m
755 ihttpd
%{buildroot}%{_sbindir}/ihttpd
190 #IHttpd dracut config
191 install -D
-p
-m
644 %{SOURCE18} %{buildroot}%{_sysconfdir}/dracut.conf.d/99-%{name}.conf
193 #IHttpd dracut module
194 install -d
-m
755 %{buildroot}%{_prefix}/lib
/dracut
/modules.d
/99ihttpd
195 install -D
-p
-m
755 %{SOURCE19} %{buildroot}%{_prefix}/lib
/dracut
/modules.d
/99ihttpd
/module
-setup.sh
198 install -d
-m
755 %{buildroot}%{_prefix}/lib/%{name}
199 install -D
-p
-m
755 index.bin
%{buildroot}%{_prefix}/lib/%{name}/
200 install -D
-p
-m
755 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{name}/reboot.bin
201 install -D
-p
-m
644 %{SOURCE20} %{buildroot}%{_prefix}/lib/%{name}/
202 install -D
-p
-m
644 %{SOURCE15} %{buildroot}%{_prefix}/lib/%{name}/
203 install -D
-p
-m
644 %{SOURCE16} %{buildroot}%{_prefix}/lib/%{name}/
209 %_create_ssl_certificate %{name}
212 %config(noreplace
) %{_prefix}/lib/%{name}/%{name}.conf
213 %config(noreplace
) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
215 %dir %{_prefix}/lib
/dracut
/modules.d
/99ihttpd
216 %{_prefix}/lib
/dracut
/modules.d
/99ihttpd
/module
-setup.sh
217 %dir %{_prefix}/lib/%{name}
218 %{_prefix}/lib/%{name}/%{name}.service
219 %{_prefix}/lib/%{name}/debug
-sshd.service
220 %{_prefix}/lib/%{name}/index.bin
221 %{_prefix}/lib/%{name}/reboot.bin