]> Raphaƫl G. Git Repositories - ihttpd/blob - SPECS/ihttpd.spec
0e1d74effdcc9256d04b773000a6a3537120cc53
[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.38
9 Release: %mkrel 5
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 Source15: ihttpd.service
18 Source16: debug-sshd.service
19 Source18: ihttpd.dracut
20 Source19: ihttpd.module-setup
21 Source20: ihttpd.conf
22 #Source21: ihttpd.modprobe
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.33-socket-activation.patch
40 #Patch35: httpd-2.4.33-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 BuildRequires: apr-devel apr-util-devel
57
58 %description
59 This package contains the main binary of apache, a powerful, full-featured,
60 efficient and freely-available Web server. Apache is also the most popular Web
61 server on the Internet.
62
63 This version of apache is fully static, and few modules are available built-in.
64
65 %prep
66 %setup -q -n httpd-%{version}
67
68 %patch1 -p1 -b .apctl
69 %patch2 -p1 -b .apxs
70 %patch3 -p1 -b .deplibs
71 %patch5 -p1 -b .layout
72 %patch6 -p1 -b .apctlsystemd
73 %patch7 -p1 -b .detectsystemd
74
75 #%patch23 -p1 -b .export
76 %patch24 -p1 -b .corelimit
77 #%patch26 -p1 -b .r1337344+
78 %patch27 -p1 -b .icons
79 %patch30 -p1 -b .cachehardmax
80 #%patch31 -p1 -b .sslmultiproxy
81 %patch34 -p1 -b .socketactivation
82 #%patch35 -p1 -b .sslciphdefault
83
84 #%patch55 -p1 -b .malformedhost
85 #%patch56 -p1 -b .uniqueid
86 #%patch57 -p1 -b .sigint
87
88 # Patch in vendor/release string
89 sed "s/@RELEASE@/%{product_distribution}/" < %{PATCH20} | patch -p1
90
91 # forcibly prevent use of bundled apr, apr-util, pcre
92 rm -rf srclib/{apr,apr-util,pcre}
93
94 # fix apxs
95 perl -pi \
96 -e 's|\@exp_installbuilddir\@|%{_libdir}/httpd/build|;' \
97 -e 's|get_vars\("prefix"\)|"%{_libdir}/httpd/build"|;' \
98 -e 's|get_vars\("sbindir"\) . "/envvars"|"\$installbuilddir/envvars"|;' \
99 support/apxs.in
100
101 # correct perl paths
102 find -type f -print0 | xargs -0 perl -pi \
103 -e 's|/usr/local/bin/perl|perl|g;' \
104 -e 's|/usr/local/bin/perl5|perl|g;' \
105 -e 's|/path/to/bin/perl|perl|g;'
106
107 # bump max modules
108 perl -pi \
109 -e 's/DYNAMIC_MODULE_LIMIT \d+/DYNAMIC_MODULE_LIMIT %{maxmodules}/;' \
110 include/httpd.h
111
112 # bump server limit
113 perl -pi \
114 -e 's/DEFAULT_SERVER_LIMIT \d+/DEFAULT_SERVER_LIMIT %{serverlimit}/' \
115 server/mpm/prefork/prefork.c \
116 server/mpm/worker/worker.c \
117 server/mpm/event/event.c
118
119 # don't try to touch srclib
120 perl -pi -e "s|^SUBDIRS = .*|SUBDIRS = os server modules support|g" Makefile.in
121
122 # this will only work if configured correctly in the config (FullOs)...
123 cp server/core.c server/core.c.untagged
124
125 # Install index.bin source
126 install -m 644 %{SOURCE1} index.bin.c
127
128 %build
129 %serverbuild
130 # regenerate configure scripts
131 autoheader && autoconf || exit 1
132
133 # Required to be able to run as root
134 export CFLAGS="$RPM_OPT_FLAGS -DBIG_SECURITY_HOLE"
135 export LDFLAGS="-Wl,-z,relro,-z,now"
136
137 # Hard-code path to links to avoid unnecessary builddep
138 export LYNX_PATH=/usr/bin/links
139
140 %configure2_5x \
141 --enable-layout=IHttpd \
142 --sysconfdir='/etc' \
143 --includedir='/usr/include/ihttpd' \
144 --libexecdir='/usr/lib64/ihttpd/modules' \
145 --datadir='/usr/share/ihttpd' \
146 --with-ssl \
147 --with-mpm=prefork \
148 --with-cgi \
149 --with-program-name='%name' \
150 --disable-suexec \
151 --without-suexec \
152 --disable-distcache \
153 --enable-unixd \
154 --enable-auth-basic \
155 --enable-authn-core \
156 --enable-authn-file \
157 --enable-authz-core \
158 --enable-authz-host \
159 --enable-authz-user \
160 --enable-rewrite \
161 --enable-socache-shmcb \
162 --enable-mime \
163 --enable-dir \
164 --enable-ssl \
165 --enable-log-config \
166 --enable-cgi \
167 --enable-pie \
168 --enable-modules=none \
169 --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'
170
171 %make
172
173 export CFLAGS="$RPM_OPT_FLAGS"
174 gcc index.bin.c -o index.bin
175
176 %install
177
178 #IHttpd sbin
179 install -D -p -m 755 ihttpd %{buildroot}%{_sbindir}/ihttpd
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 modprobe config
189 #install -D -p -m 644 %{SOURCE21} %{buildroot}%{_sysconfdir}/modprobe.d/%{name}.conf
190
191 #Ihttpd files
192 install -d -m 755 %{buildroot}%{_prefix}/lib/%{name}
193 install -D -p -m 755 index.bin %{buildroot}%{_prefix}/lib/%{name}/
194 install -D -p -m 755 %{SOURCE2} %{buildroot}%{_prefix}/lib/%{name}/reboot.bin
195 install -D -p -m 644 %{SOURCE20} %{buildroot}%{_prefix}/lib/%{name}/
196 install -D -p -m 644 %{SOURCE15} %{buildroot}%{_prefix}/lib/%{name}/
197 install -D -p -m 644 %{SOURCE16} %{buildroot}%{_prefix}/lib/%{name}/
198
199
200 #%find_lang %name
201
202 %post
203 %_create_ssl_certificate %{name}
204
205 %files -n %name
206 %config(noreplace) %{_prefix}/lib/%{name}/%{name}.conf
207 %config(noreplace) %{_sysconfdir}/dracut.conf.d/99-%{name}.conf
208 #%config(noreplace) %{_sysconfdir}/modprobe.d/%{name}.conf
209 %{_sbindir}/%{name}
210 %dir %{_prefix}/lib/dracut/modules.d/99ihttpd
211 %{_prefix}/lib/dracut/modules.d/99ihttpd/module-setup.sh
212 %dir %{_prefix}/lib/%{name}
213 %{_prefix}/lib/%{name}/%{name}.service
214 %{_prefix}/lib/%{name}/debug-sshd.service
215 %{_prefix}/lib/%{name}/index.bin
216 %{_prefix}/lib/%{name}/reboot.bin