]> Raphaƫl G. Git Repositories - ihttpd/blob - SPECS/ihttpd.spec
72deabb22e89cf0dc80bc7db7e20e140741d051e
[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.48
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: apr-devel apr-util-devel
61
62 %description
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.
66
67 This version of apache is fully static, and few modules are available built-in.
68
69 %prep
70 %setup -q -n httpd-%{version}
71
72 %patch1 -p1 -b .apctl
73 %patch2 -p1 -b .apxs
74 %patch3 -p1 -b .deplibs
75 %patch5 -p1 -b .layout
76 %patch6 -p1 -b .apctlsystemd
77 %patch7 -p1 -b .detectsystemd
78
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
86 # No longer applies
87 #%patch31 -p1 -b .sslmultiproxy
88 %patch34 -p1 -b .socketactivation
89 #%patch35 -p1 -b .sslciphdefault
90 #patch44 -p1 -b .luaresume
91
92 %patch100 -p1 -b .ab_source_address.droplet
93 %patch101 -p0 -b .PR45994.droplet
94
95 # Patch in vendor/release string
96 sed "s/@RELEASE@/%{product_distribution}/" < %{PATCH20} | patch -p1
97
98 # forcibly prevent use of bundled apr, apr-util, pcre
99 rm -rf srclib/{apr,apr-util,pcre}
100
101 # fix apxs
102 perl -pi \
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"|;' \
106 support/apxs.in
107
108 # correct perl paths
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;'
113
114 # bump max modules
115 perl -pi \
116 -e 's/DYNAMIC_MODULE_LIMIT \d+/DYNAMIC_MODULE_LIMIT %{maxmodules}/;' \
117 include/httpd.h
118
119 # bump server limit
120 perl -pi \
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
125
126 # don't try to touch srclib
127 perl -pi -e "s|^SUBDIRS = .*|SUBDIRS = os server modules support|g" Makefile.in
128
129 # this will only work if configured correctly in the config (FullOs)...
130 cp server/core.c server/core.c.untagged
131
132 # Install index.bin source
133 install -m 644 %{SOURCE1} index.bin.c
134
135 %build
136 %serverbuild
137 # regenerate configure scripts
138 autoheader && autoconf || exit 1
139
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"
144
145 # Hard-code path to links to avoid unnecessary builddep
146 export LYNX_PATH=/usr/bin/links
147
148 %configure \
149 --enable-layout=IHttpd \
150 --sysconfdir='/etc' \
151 --includedir='/usr/include/ihttpd' \
152 --libexecdir='/usr/lib64/ihttpd/modules' \
153 --datadir='/usr/share/ihttpd' \
154 --with-ssl \
155 --with-mpm=prefork \
156 --with-cgi \
157 --with-program-name='%name' \
158 --disable-suexec \
159 --without-suexec \
160 --disable-distcache \
161 --enable-unixd \
162 --enable-auth-basic \
163 --enable-authn-core \
164 --enable-authn-file \
165 --enable-authz-core \
166 --enable-authz-host \
167 --enable-authz-user \
168 --enable-rewrite \
169 --enable-socache-shmcb \
170 --enable-mime \
171 --enable-dir \
172 --enable-ssl \
173 --enable-log-config \
174 --enable-cgi \
175 --enable-pie \
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'
178
179 # parallel build fails on the build host
180 %__make
181
182 export CFLAGS="$RPM_OPT_FLAGS"
183 gcc index.bin.c -o index.bin
184
185 %install
186
187 #IHttpd sbin
188 install -D -p -m 755 ihttpd %{buildroot}%{_sbindir}/ihttpd
189
190 #IHttpd dracut config
191 install -D -p -m 644 %{SOURCE18} %{buildroot}%{_sysconfdir}/dracut.conf.d/99-%{name}.conf
192
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
196
197 #Ihttpd files
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}/
204
205
206 #%find_lang %name
207
208 %post
209 %_create_ssl_certificate %{name}
210
211 %files -n %name
212 %config(noreplace) %{_prefix}/lib/%{name}/%{name}.conf
213 %config(noreplace) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
214 %{_sbindir}/%{name}
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