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