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