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