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
62 BuildRequires
: libcurl
-devel
63 BuildRequires
: libtool
>= 1.4.2
64 BuildRequires
: multiarch
-utils
>= 1.0.3
65 BuildRequires
: pkgconfig
(apr
-1) >= 1.7.0-4
66 BuildRequires
: pkgconfig
(apr
-util
-1) >= 1.6.1-5
67 BuildRequires
: pkgconfig
(libpcre
)
68 BuildRequires
: pkgconfig
(openssl
)
69 BuildRequires
: pkgconfig
(systemd
)
70 BuildRequires
: pkgconfig
(zlib
)
73 This package contains the main binary of apache
, a powerful
, full
-featured
,
74 efficient and freely
-available Web server. Apache is also the most popular Web
75 server on the Internet.
77 This version of apache is fully static
, and few modules are available built
-in.
80 %setup -q
-n httpd
-%{version}
84 %patch3 -p1
-b .deplibs
85 %patch5 -p1
-b .layout
86 %patch6 -p1
-b .apctlsystemd
87 %patch7 -p1
-b .detectsystemd
89 #Disable in ihttpd to avoid build fail
90 #%patch23 -p1 -b .export
91 %patch24 -p1
-b .corelimit
92 #%patch26 -p1 -b .r1337344+
93 %patch27 -p1
-b .icons
94 %patch29 -p1
-b .systemd
95 %patch30 -p1
-b .cachehardmax
97 #%patch31 -p1 -b .sslmultiproxy
98 %patch34 -p1
-b .socketactivation
99 #%patch35 -p1 -b .sslciphdefault
100 #patch44 -p1 -b .luaresume
102 %patch100 -p1
-b .ab_source_address.droplet
103 %patch101 -p0
-b .PR45994.droplet
105 # Patch in vendor/release string
106 sed "s
/@RELEASE@
/%{product_distribution}/" < %{PATCH20} | patch
-p1
108 # forcibly prevent use of bundled apr, apr-util, pcre
109 rm -rf srclib
/{apr
,apr
-util
,pcre
}
113 -e 's|\@exp_installbuilddir\@|
%{_libdir}/httpd
/build|
;' \
114 -e 's|get_vars\
("prefix"\
)|"
%{_libdir}/httpd
/build"|
;' \
115 -e 's|get_vars\
("sbindir"\
) . "
/envvars"|"\$installbuilddir
/envvars"|
;' \
119 find
-type f
-print0 | xargs
-0 perl
-pi \
120 -e 's|
/usr
/local/bin
/perl|perl|g
;' \
121 -e 's|
/usr
/local/bin
/perl5|perl|g
;' \
122 -e 's|
/path
/to
/bin
/perl|perl|g
;'
126 -e 's
/DYNAMIC_MODULE_LIMIT \d
+/DYNAMIC_MODULE_LIMIT
%{maxmodules}/;' \
131 -e 's
/DEFAULT_SERVER_LIMIT \d
+/DEFAULT_SERVER_LIMIT
%{serverlimit}/' \
132 server
/mpm
/prefork
/prefork.c \
133 server
/mpm
/worker
/worker.c \
134 server
/mpm
/event
/event.c
136 # don't try to touch srclib
137 perl
-pi
-e "s|^SUBDIRS
= .
*|SUBDIRS
= os server modules support|g" Makefile.
in
139 # this will only work if configured correctly in the config (FullOs)...
140 cp server
/core.c server
/core.c.untagged
142 # Install index.bin source
143 install -m
644 %{SOURCE1} index.bin.c
147 # regenerate configure scripts
148 autoheader
&& autoconf ||
exit 1
150 # Required to be able to run as root
151 export CFLAGS
="$RPM_OPT_FLAGS
-DBIG_SECURITY_HOLE"
152 ldflags_hacky_workaround_for_systemd_lib_not_added
="
-lsystemd "
153 export LDFLAGS
="$
{ldflags_hacky_workaround_for_systemd_lib_not_added
}-Wl
,-z
,relro
,-z
,now"
155 # Hard-code path to links to avoid unnecessary builddep
156 export LYNX_PATH
=/usr
/bin
/links
159 --enable-layout
=IHttpd \
160 --sysconfdir
='
/etc' \
161 --includedir
='
/usr
/include
/ihttpd' \
162 --libexecdir
='
/usr
/lib64
/ihttpd
/modules' \
163 --datadir
='
/usr
/share
/ihttpd' \
167 --with
-program
-name
='
%name' \
170 --disable
-distcache \
172 --enable-auth
-basic \
173 --enable-authn
-core \
174 --enable-authn
-file \
175 --enable-authz
-core \
176 --enable-authz
-host \
177 --enable-authz
-user \
179 --enable-socache
-shmcb \
183 --enable-log
-config \
186 --enable-modules
=none \
187 --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'
189 # parallel build fails on the build host
192 export CFLAGS
="$RPM_OPT_FLAGS"
193 gcc index.bin.c
-o index.bin
198 install -D
-p
-m
755 ihttpd
%{buildroot}%{_sbindir}/ihttpd
200 #IHttpd dracut config
201 install -D
-p
-m
644 %{SOURCE18} %{buildroot}%{_sysconfdir}/dracut.conf.d/99-%{name}.conf
203 #IHttpd dracut module
204 install -d
-m
755 %{buildroot}%{_prefix}/lib
/dracut
/modules.d
/99ihttpd
205 install -D
-p
-m
755 %{SOURCE19} %{buildroot}%{_prefix}/lib
/dracut
/modules.d
/99ihttpd
/module
-setup.sh
208 install -d
-m
755 %{buildroot}%{_prefix}/lib/%{name}
209 install -D
-p
-m
755 index.bin
%{buildroot}%{_prefix}/lib/%{name}/
210 install -D
-p
-m
755 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{name}/reboot.bin
211 install -D
-p
-m
644 %{SOURCE20} %{buildroot}%{_prefix}/lib/%{name}/
212 install -D
-p
-m
644 %{SOURCE15} %{buildroot}%{_prefix}/lib/%{name}/
213 install -D
-p
-m
644 %{SOURCE16} %{buildroot}%{_prefix}/lib/%{name}/
219 %_create_ssl_certificate %{name}
222 %config(noreplace
) %{_prefix}/lib/%{name}/%{name}.conf
223 %config(noreplace
) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
225 %dir %{_prefix}/lib
/dracut
/modules.d
/99ihttpd
226 %{_prefix}/lib
/dracut
/modules.d
/99ihttpd
/module
-setup.sh
227 %dir %{_prefix}/lib/%{name}
228 %{_prefix}/lib/%{name}/%{name}.service
229 %{_prefix}/lib/%{name}/debug
-sshd.service
230 %{_prefix}/lib/%{name}/index.bin
231 %{_prefix}/lib/%{name}/reboot.bin