8de26162b99b2a3061fea321f5df87d25d39aa2a
[ihttpd] / SPECS / ihttpd.spec
1 %define contentdir %{_datadir}/httpd
2 %define docroot /var/www
3
4 %{?!maxmodules:%global maxmodules 128}
5 %{?!serverlimit:%global serverlimit 1024}
6
7 Name: ihttpd
8 Version: 2.4.20
9 Release: %mkrel 1
10 Summary: The most widely used Web server on the Internet
11 License: Apache License
12 Group: System/Servers
13 URL: http://httpd.apache.org/
14 Source0: http://www.apache.org/dist/httpd/httpd-%version.tar.bz2
15 Source1: index.bin.c
16 Source2: reboot.sh
17 Source14: ihttpd.tmpfiles
18 Source15: ihttpd.service
19 Source17: ihttpd.path
20 Source18: ihttpd.dracut
21 Source19: ihttpd.module-setup
22 Source20: ihttpd.conf
23 # build/scripts patches
24 Patch1: httpd-2.4.1-apctl.patch
25 Patch2: httpd-2.4.9-apxs.patch
26 Patch3: httpd-2.4.1-deplibs.patch
27 Patch5: ihttpd-2.4.20-layout.patch
28 Patch6: httpd-2.4.3-apctl-systemd.patch
29 Patch7: httpd-2.4.10-detect-systemd.patch
30 # Features/functional changes
31 Patch20: httpd-2.4.3-release.patch
32 Patch23: httpd-2.4.4-export.patch
33 Patch24: httpd-2.4.1-corelimit.patch
34 Patch26: httpd-2.4.4-r1337344+.patch
35 Patch27: httpd-2.4.2-icons.patch
36 Patch28: httpd-2.4.4-r1332643+.patch
37 Patch30: httpd-2.4.4-cachehardmax.patch
38 Patch31: httpd-2.4.18-sslmultiproxy.patch
39 Patch34: httpd-2.4.17-socket-activation.patch
40 Patch35: httpd-2.4.17-sslciphdefault.patch
41 # Bug fixes
42 Patch55: httpd-2.4.4-malformed-host.patch
43 Patch56: httpd-2.4.4-mod_unique_id.patch
44 Patch57: httpd-2.4.10-sigint.patch
45
46 # For /var/www/html
47 Requires: webserver-base
48 # For /etc/mime.types
49 Requires: mailcap
50
51 Requires(post): systemd >= %{systemd_required_version}
52 Requires(post): rpm-helper >= 0.24.8-1
53 Requires(post): openssl makedev
54 Requires(preun): rpm-helper >= 0.24.8-1
55
56 %description
57 This package contains the main binary of apache, a powerful, full-featured,
58 efficient and freely-available Web server. Apache is also the most popular Web
59 server on the Internet.
60
61 This version of apache is fully static, and few modules are available built-in.
62
63 %prep
64 %setup -q -n httpd-%{version}
65
66 %patch1 -p1 -b .apctl
67 %patch2 -p1 -b .apxs
68 %patch3 -p1 -b .deplibs
69 %patch5 -p1 -b .layout
70 %patch6 -p1 -b .apctlsystemd
71 %patch7 -p1 -b .detectsystemd
72
73 %patch23 -p1 -b .export
74 %patch24 -p1 -b .corelimit
75 %patch26 -p1 -b .r1337344+
76 %patch27 -p1 -b .icons
77 %patch30 -p1 -b .cachehardmax
78 %patch31 -p1 -b .sslmultiproxy
79 %patch34 -p1 -b .socketactivation
80 %patch35 -p1 -b .sslciphdefault
81
82 %patch55 -p1 -b .malformedhost
83 %patch56 -p1 -b .uniqueid
84 %patch57 -p1 -b .sigint
85
86 # Patch in vendor/release string
87 sed "s/@RELEASE@/%{product_distribution}/" < %{PATCH20} | patch -p1
88
89 # forcibly prevent use of bundled apr, apr-util, pcre
90 rm -rf srclib/{apr,apr-util,pcre}
91
92 # fix apxs
93 perl -pi \
94 -e 's|\@exp_installbuilddir\@|%{_libdir}/httpd/build|;' \
95 -e 's|get_vars\("prefix"\)|"%{_libdir}/httpd/build"|;' \
96 -e 's|get_vars\("sbindir"\) . "/envvars"|"\$installbuilddir/envvars"|;' \
97 support/apxs.in
98
99 # correct perl paths
100 find -type f -print0 | xargs -0 perl -pi \
101 -e 's|/usr/local/bin/perl|perl|g;' \
102 -e 's|/usr/local/bin/perl5|perl|g;' \
103 -e 's|/path/to/bin/perl|perl|g;'
104
105 # bump max modules
106 perl -pi \
107 -e 's/DYNAMIC_MODULE_LIMIT \d+/DYNAMIC_MODULE_LIMIT %{maxmodules}/;' \
108 include/httpd.h
109
110 # bump server limit
111 perl -pi \
112 -e 's/DEFAULT_SERVER_LIMIT \d+/DEFAULT_SERVER_LIMIT %{serverlimit}/' \
113 server/mpm/prefork/prefork.c \
114 server/mpm/worker/worker.c \
115 server/mpm/event/event.c
116
117 # don't try to touch srclib
118 perl -pi -e "s|^SUBDIRS = .*|SUBDIRS = os server modules support|g" Makefile.in
119
120 # this will only work if configured correctly in the config (FullOs)...
121 cp server/core.c server/core.c.untagged
122
123 # Install index.bin source
124 install -m 644 %{SOURCE1} index.bin.c
125
126 %build
127 %serverbuild
128 # regenerate configure scripts
129 autoheader && autoconf || exit 1
130
131 export CFLAGS="$RPM_OPT_FLAGS -DBIG_SECURITY_HOLE"
132 export LDFLAGS="-Wl,-z,relro,-z,now"
133
134 # Hard-code path to links to avoid unnecessary builddep
135 export LYNX_PATH=/usr/bin/links
136
137 %configure2_5x \
138 --enable-layout=IHttpd \
139 --sysconfdir='/etc' \
140 --includedir='/usr/include/ihttpd' \
141 --libexecdir='/usr/lib64/ihttpd/modules' \
142 --datadir='/usr/share/ihttpd' \
143 --with-ssl \
144 --with-mpm=prefork \
145 --with-cgi \
146 --with-program-name='%name' \
147 --disable-suexec \
148 --without-suexec \
149 --disable-distcache \
150 --enable-unixd \
151 --enable-auth-basic \
152 --enable-authn-core \
153 --enable-authn-file \
154 --enable-authz-core \
155 --enable-authz-host \
156 --enable-authz-user \
157 --enable-rewrite \
158 --enable-socache-shmcb \
159 --enable-mime \
160 --enable-dir \
161 --enable-ssl \
162 --enable-log-config \
163 --enable-cgi \
164 --enable-pie \
165 --enable-modules=none \
166 --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'
167
168 %make
169
170 export CFLAGS="$RPM_OPT_FLAGS"
171 # -m64 -std=c99 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
172 gcc index.bin.c -o index.bin
173
174 %install
175
176 #IHttpd sbin
177 install -D -p -m 755 ihttpd %{buildroot}%{_sbindir}/ihttpd
178
179 #IHttpd config
180 install -D -p -m 644 %{SOURCE20} %{buildroot}%{_sysconfdir}/ihttpd.conf
181
182 #Tmpfiles.d config
183 install -D -p -m 644 %{SOURCE14} %{buildroot}%{_tmpfilesdir}/ihttpd.conf
184
185 #IHttpd service
186 install -D -p -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/ihttpd.service
187
188 #IHttpd path
189 install -D -p -m 644 %{SOURCE17} %{buildroot}%{_unitdir}/ihttpd.path
190
191 #IHttpd dracut config
192 install -D -p -m 644 %{SOURCE18} %{buildroot}%{_sysconfdir}/dracut.conf.d/99-%{name}.conf
193
194 #IHttpd dracut module
195 install -d -m 755 %{buildroot}%{_prefix}/lib/dracut/modules.d/99ihttpd
196 install -D -p -m 755 %{SOURCE19} %{buildroot}%{_prefix}/lib/dracut/modules.d/99ihttpd/module-setup.sh
197
198 #Ihttpd index.bin
199 install -d -m 755 %{buildroot}%{_prefix}/lib/%{name}
200 install -D -p -m 755 index.bin %{buildroot}%{_prefix}/lib/%{name}/index.bin
201 install -D -p -m 755 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{name}/reboot.bin
202
203 %find_lang %name
204
205 %post
206 %_tmpfilescreate %{name}
207 %_post_service %{name}
208 %_create_ssl_certificate %{name}
209
210 %preun
211 %_preun_service %{name}
212
213 %files -n %name
214 %config(noreplace) %{_sysconfdir}/%{name}.conf
215 %config(noreplace) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
216 %{_sbindir}/%{name}
217 %{_tmpfilesdir}/%{name}.conf
218 %{_unitdir}/%{name}.path
219 %dir %{_prefix}/lib/dracut/modules.d/99ihttpd
220 %{_prefix}/lib/dracut/modules.d/99ihttpd/module-setup.sh
221 %{_unitdir}/%{name}.service
222 %{_prefix}/lib/%{name}/index.bin
223 %{_prefix}/lib/%{name}/reboot.bin