]> Raphaƫl G. Git Repositories - ihttpd/blob - SPECS/ihttpd.spec
7e4170ee80ab24c743663efaf16eb56676d5c473
[ihttpd] / SPECS / ihttpd.spec
1 # (luigiwalser, ngompa): httpd build hates parallelization
2 %define _smp_ncpus_max 8
3 %define contentdir %{_datadir}/httpd
4 %define docroot /var/www
5
6 %{?!maxmodules:%global maxmodules 128}
7 %{?!serverlimit:%global serverlimit 1024}
8
9 Name: ihttpd
10 Version: 2.4.54
11 Release: %mkrel 1
12 Summary: The most widely used Web server on the Internet
13 License: Apache License
14 Group: System/Servers
15 URL: http://httpd.apache.org/
16 Source0: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2
17 Source1: index.bin.c
18 Source2: reboot.sh
19 Source15: ihttpd.service
20 Source16: debug-sshd.service
21 Source18: ihttpd.dracut
22 Source19: ihttpd.module-setup
23 Source20: ihttpd.conf
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
45 # Bug fixes
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
49
50 # For /var/www/html
51 Requires: webserver-base
52 # For /etc/mime.types
53 Requires: mailcap
54
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
59
60 BuildRequires: bison
61 BuildRequires: flex
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)
71
72 %description
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.
76
77 This version of apache is fully static, and few modules are available built-in.
78
79 %prep
80 %setup -q -n httpd-%{version}
81
82 %patch1 -p1 -b .apctl
83 %patch2 -p1 -b .apxs
84 %patch3 -p1 -b .deplibs
85 %patch5 -p1 -b .layout
86 %patch6 -p1 -b .apctlsystemd
87 %patch7 -p1 -b .detectsystemd
88
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
96 # No longer applies
97 #%patch31 -p1 -b .sslmultiproxy
98 %patch34 -p1 -b .socketactivation
99 #%patch35 -p1 -b .sslciphdefault
100 #patch44 -p1 -b .luaresume
101
102 %patch100 -p1 -b .ab_source_address.droplet
103 %patch101 -p0 -b .PR45994.droplet
104
105 # Patch in vendor/release string
106 sed "s/@RELEASE@/%{product_distribution}/" < %{PATCH20} | patch -p1
107
108 # forcibly prevent use of bundled apr, apr-util, pcre
109 rm -rf srclib/{apr,apr-util,pcre}
110
111 # fix apxs
112 perl -pi \
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"|;' \
116 support/apxs.in
117
118 # correct perl paths
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;'
123
124 # bump max modules
125 perl -pi \
126 -e 's/DYNAMIC_MODULE_LIMIT \d+/DYNAMIC_MODULE_LIMIT %{maxmodules}/;' \
127 include/httpd.h
128
129 # bump server limit
130 perl -pi \
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
135
136 # don't try to touch srclib
137 perl -pi -e "s|^SUBDIRS = .*|SUBDIRS = os server modules support|g" Makefile.in
138
139 # this will only work if configured correctly in the config (FullOs)...
140 cp server/core.c server/core.c.untagged
141
142 # Install index.bin source
143 install -m 644 %{SOURCE1} index.bin.c
144
145 %build
146 %serverbuild
147 # regenerate configure scripts
148 autoheader && autoconf || exit 1
149
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"
154
155 # Hard-code path to links to avoid unnecessary builddep
156 export LYNX_PATH=/usr/bin/links
157
158 %configure \
159 --enable-layout=IHttpd \
160 --sysconfdir='/etc' \
161 --includedir='/usr/include/ihttpd' \
162 --libexecdir='/usr/lib64/ihttpd/modules' \
163 --datadir='/usr/share/ihttpd' \
164 --with-ssl \
165 --with-mpm=prefork \
166 --with-cgi \
167 --with-program-name='%name' \
168 --disable-suexec \
169 --without-suexec \
170 --disable-distcache \
171 --enable-unixd \
172 --enable-auth-basic \
173 --enable-authn-core \
174 --enable-authn-file \
175 --enable-authz-core \
176 --enable-authz-host \
177 --enable-authz-user \
178 --enable-rewrite \
179 --enable-socache-shmcb \
180 --enable-mime \
181 --enable-dir \
182 --enable-ssl \
183 --enable-log-config \
184 --enable-cgi \
185 --enable-pie \
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'
188
189 # parallel build fails on the build host
190 %__make
191
192 export CFLAGS="$RPM_OPT_FLAGS"
193 gcc index.bin.c -o index.bin
194
195 %install
196
197 #IHttpd sbin
198 install -D -p -m 755 ihttpd %{buildroot}%{_sbindir}/ihttpd
199
200 #IHttpd dracut config
201 install -D -p -m 644 %{SOURCE18} %{buildroot}%{_sysconfdir}/dracut.conf.d/99-%{name}.conf
202
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
206
207 #Ihttpd files
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}/
214
215 %post
216 %_create_ssl_certificate %{name}
217
218 %files -n %name
219 %config(noreplace) %{_prefix}/lib/%{name}/%{name}.conf
220 %config(noreplace) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
221 %{_sbindir}/%{name}
222 %dir %{_prefix}/lib/dracut/modules.d/99ihttpd
223 %{_prefix}/lib/dracut/modules.d/99ihttpd/module-setup.sh
224 %dir %{_prefix}/lib/%{name}
225 %{_prefix}/lib/%{name}/%{name}.service
226 %{_prefix}/lib/%{name}/debug-sshd.service
227 %{_prefix}/lib/%{name}/index.bin
228 %{_prefix}/lib/%{name}/reboot.bin