-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhttpd.spec
1757 lines (1350 loc) · 66.4 KB
/
httpd.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%define contentdir %{_datadir}/httpd
%define docroot /var/www
%define suexec_caller apache
%define mmn 20120211
%define mmnisa %{mmn}%{__isa_name}%{__isa_bits}
%define vstring %(source /etc/os-release; echo ${NAME})
%global mpm prefork
%global httpd_user apache
%global release_prefix 1001
Name: httpd
Version: 2.4.53
Release: %{release_prefix}%{?dist}
Summary: Apache HTTP Server
License: ASL 2.0
URL: https://httpd.apache.org
Source0: %{name}-%{version}.tar.xz
# Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
# GPG key file downloaded and verified by luhliarik.
# https://httpd.apache.org/dev/verification.html
# Source2: https://dist.apache.org/repos/dist/release/httpd/KEYS
Source3: httpd.logrotate
Source4: instance.conf
Source5: httpd-ssl-pass-dialog
Source6: httpd.tmpfiles
Source7: httpd.service
Source8: action-graceful.sh
Source9: action-configtest.sh
Source10: server-status.conf
Source11: httpd.conf
Source12: 00-base.conf
Source13: 00-mpm.conf
Source14: 00-lua.conf
Source15: 01-cgi.conf
Source16: 00-dav.conf
Source17: 00-proxy.conf
Source18: 00-ssl.conf
Source19: 01-ldap.conf
Source20: 00-proxyhtml.conf
Source21: userdir.conf
Source22: ssl.conf
Source23: welcome.conf
Source24: manual.conf
Source25: 00-systemd.conf
Source26: 01-session.conf
Source27: 10-listen443.conf
Source28: httpd.socket
Source29: 00-optional.conf
Source30: README.confd
Source31: README.confmod
Source32: httpd.service.xml
Source33: htcacheclean.service.xml
Source34: httpd.conf.xml
Source35: 00-brotli.conf
Source40: htcacheclean.service
Source41: htcacheclean.sysconf
Source42: httpd-init.service
Source43: httpd-ssl-gencerts
Source44: [email protected]
Source45: config.layout
Source46: apachectl.sh
Source47: apachectl.xml
Source48: apache-poweredby.png
# Listen port.
Source920: 10-listen8081.conf
# Build / scripts patches.
Patch2: %{name}-2.4.43-apxs.patch
Patch3: %{name}-2.4.43-deplibs.patch
# Needed for socket activation and mod_systemd patch.
Patch19: %{name}-2.4.53-detect-systemd.patch
# Features/functional changes.
Patch21: %{name}-2.4.48-r1842929+.patch
Patch22: %{name}-2.4.43-mod_systemd.patch
Patch23: %{name}-2.4.53-export.patch
Patch24: %{name}-2.4.43-corelimit.patch
Patch25: %{name}-2.4.43-selinux.patch
Patch26: %{name}-2.4.43-gettid.patch
Patch27: %{name}-2.4.43-icons.patch
Patch30: %{name}-2.4.43-cachehardmax.patch
Patch34: %{name}-2.4.43-socket-activation.patch
Patch38: %{name}-2.4.43-sslciphdefault.patch
Patch39: %{name}-2.4.43-sslprotdefault.patch
Patch40: %{name}-2.4.43-r1861269.patch
Patch41: %{name}-2.4.43-r1861793+.patch
Patch42: %{name}-2.4.48-r1828172+.patch
Patch45: %{name}-2.4.43-logjournal.patch
Patch46: %{name}-2.4.53-separate-systemd-fns.patch
# Bug fixes.
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
Patch60: %{name}-2.4.43-enable-sslv3.patch
Patch61: %{name}-2.4.48-r1878890.patch
Patch63: %{name}-2.4.46-htcacheclean-dont-break.patch
Patch65: %{name}-2.4.51-r1894152.patch
# Security fixes.
BuildRequires: gcc, autoconf, pkgconfig, findutils, xmlto
BuildRequires: perl-interpreter, perl-generators, systemd-devel
BuildRequires: zlib-devel, libselinux-devel, lua-devel, brotli-devel
BuildRequires: apr-devel >= 1.5.0, apr-util-devel >= 1.5.0, pcre-devel >= 5.0
BuildRequires: gnupg2
Requires: system-logos(httpd-logo-ng)
Provides: webserver
Requires: %{name}-core = 0:%{version}-%{release}
Recommends: mod_http2, mod_lua
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd-units
%description
The Apache HTTP Server is a powerful, efficient, and extensible
web server.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: core
# -------------------------------------------------------------------------------------------------------------------- #
%package core
Summary: %{name} minimal core
Provides: mod_dav = %{version}-%{release}, %{name}-suexec = %{version}-%{release}
Provides: %{name}-mmn = %{mmn}, %{name}-mmn = %{mmnisa}
Provides: mod_proxy_uwsgi = %{version}-%{release}
Requires: /etc/mime.types
Requires: %{name}-tools = %{version}-%{release}
Requires: %{name}-filesystem = %{version}-%{release}
Requires(pre): %{name}-filesystem
Conflicts: apr < 1.5.0-1
Obsoletes: mod_proxy_uwsgi < 2.0.17.1-2
%description core
The %{name}-core package contains essential %{name} binaries.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: devel
# -------------------------------------------------------------------------------------------------------------------- #
%package devel
Summary: Development interfaces for the Apache HTTP Server
Requires: apr-devel, apr-util-devel, pkgconfig, libtool
Requires: %{name} = %{version}-%{release}
%description devel
The %{name}-devel package contains the APXS binary and other files
that you need to build Dynamic Shared Objects (DSOs) for the
Apache HTTP Server.
If you are installing the Apache HTTP Server and you want to be
able to compile or develop additional modules for Apache, you need
to install this package.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: manual
# -------------------------------------------------------------------------------------------------------------------- #
%package manual
Summary: Documentation for the Apache HTTP Server
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description manual
The %{name}-manual package contains the complete manual and
reference guide for the Apache HTTP Server. The information can
also be found at https://httpd.apache.org/docs/2.4/.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: filesystem
# -------------------------------------------------------------------------------------------------------------------- #
%package filesystem
Summary: The basic directory layout for the Apache HTTP Server
BuildArch: noarch
Requires(pre): /usr/sbin/useradd
%description filesystem
The %{name}-filesystem package contains the basic directory layout
for the Apache HTTP Server including the correct permissions
for the directories.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: tools
# -------------------------------------------------------------------------------------------------------------------- #
%package tools
Summary: Tools for use with the Apache HTTP Server
%description tools
The %{name}-tools package contains tools which can be used with
the Apache HTTP Server.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: mod_ssl
# -------------------------------------------------------------------------------------------------------------------- #
%package -n mod_ssl
Summary: SSL/TLS module for the Apache HTTP Server
Epoch: 1
BuildRequires: openssl-devel
Requires(pre): %{name}-filesystem
Requires: %{name} = 0:%{version}-%{release}, %{name}-mmn = %{mmnisa}
Requires: sscg >= 2.2.0, /usr/bin/hostname
# Require an OpenSSL which supports PROFILE=SYSTEM.
Conflicts: openssl-libs < 1:1.0.1h-4
# mod_ssl/mod_nss cannot both be loaded simultaneously.
Conflicts: mod_nss
%description -n mod_ssl
The mod_ssl module provides strong cryptography for the Apache HTTP
server via the Secure Sockets Layer (SSL) and Transport Layer
Security (TLS) protocols.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: mod_proxy_html
# -------------------------------------------------------------------------------------------------------------------- #
%package -n mod_proxy_html
Summary: HTML and XML content filters for the Apache HTTP Server
Requires: %{name} = 0:%{version}-%{release}, %{name}-mmn = %{mmnisa}
BuildRequires: libxml2-devel
BuildRequires: make
Epoch: 1
Obsoletes: mod_proxy_html < 1:2.4.1-2
%description -n mod_proxy_html
The mod_proxy_html and mod_xml2enc modules provide filters which can
transform and modify HTML and XML content.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: mod_ldap
# -------------------------------------------------------------------------------------------------------------------- #
%package -n mod_ldap
Summary: LDAP authentication modules for the Apache HTTP Server
Requires: %{name} = 0:%{version}-%{release}, %{name}-mmn = %{mmnisa}
Requires: apr-util-ldap
%description -n mod_ldap
The mod_ldap and mod_authnz_ldap modules add support for LDAP
authentication to the Apache HTTP Server.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: mod_session
# -------------------------------------------------------------------------------------------------------------------- #
%package -n mod_session
Summary: Session interface for the Apache HTTP Server
Requires: %{name} = 0:%{version}-%{release}, %{name}-mmn = %{mmnisa}
%description -n mod_session
The mod_session module and associated backends provide an abstract
interface for storing and accessing per-user session data.
# -------------------------------------------------------------------------------------------------------------------- #
# Package: mod_lua
# -------------------------------------------------------------------------------------------------------------------- #
%package -n mod_lua
Summary: Lua scripting support for the Apache HTTP Server
Requires: %{name} = 0:%{version}-%{release}, %{name}-mmn = %{mmnisa}
%description -n mod_lua
The mod_lua module allows the server to be extended with scripts
written in the Lua programming language.
# -------------------------------------------------------------------------------------------------------------------- #
# -----------------------------------------------------< SCRIPT >----------------------------------------------------- #
# -------------------------------------------------------------------------------------------------------------------- #
%prep
%setup -q
%patch2 -p1 -b .apxs
%patch3 -p1 -b .deplibs
%patch19 -p1 -b .detectsystemd
%patch21 -p1 -b .r1842929+
%patch22 -p1 -b .mod_systemd
%patch23 -p1 -b .export
%patch24 -p1 -b .corelimit
%patch25 -p1 -b .selinux
%patch26 -p1 -b .gettid
%patch27 -p1 -b .icons
%patch30 -p1 -b .cachehardmax
%patch34 -p1 -b .socketactivation
%patch38 -p1 -b .sslciphdefault
%patch39 -p1 -b .sslprotdefault
%patch40 -p1 -b .r1861269
%patch41 -p1 -b .r1861793+
%patch42 -p1 -b .r1828172+
%patch45 -p1 -b .logjournal
%patch46 -p1 -b .separatesystemd
%patch60 -p1 -b .enable-sslv3
%patch61 -p1 -b .r1878890
%patch63 -p1 -b .htcacheclean-dont-break
%patch65 -p1 -b .r1894152
# Patch in the vendor string.
%{__sed} -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h
# Prevent use of setcap in "install-suexec-caps" target.
%{__sed} -i '/suexec/s,setcap ,echo Skipping setcap for ,' Makefile.in
# Example "*.conf" for instances.
%{__cp} %{_sourcedir}/instance.conf .
%{__sed} < %{_sourcedir}/httpd.conf >> instance.conf '
0,/^ServerRoot/d;
/# Supplemental configuration/,$d
/^ *CustomLog .logs/s,logs/,logs/${HTTPD_INSTANCE}_,
/^ *ErrorLog .logs/s,logs/,logs/${HTTPD_INSTANCE}_,
'
touch -r %{_sourcedir}/instance.conf instance.conf
%{__cp} -p %{_sourcedir}/server-status.conf server-status.conf
# Safety check: prevent build if defined MMN does not equal upstream MMN.
vmmn=$( echo MODULE_MAGIC_NUMBER_MAJOR | cpp -include include/ap_mmn.h | %{__sed} -n '/^2/p' )
if [[ "x${vmmn}" != "x%{mmn}" ]]; then
: Error: Upstream MMN is now ${vmmn}, packaged MMN is %{mmn}
: Update the mmn macro and rebuild.
exit 1
fi
# A new logo which comes together with a new test page.
%{__cp} %{SOURCE48} ./docs/icons/apache_pb3.png
# Provide default layout.
%{__cp} %{_sourcedir}/config.layout .
%{__sed} '
s,@MPM@,%{mpm},g
s,@DOCROOT@,%{docroot},g
s,@LOGDIR@,%{_localstatedir}/log/httpd,g
' < %{_sourcedir}/httpd.conf.xml \
> httpd.conf.xml
xmlto man ./httpd.conf.xml
xmlto man %{_sourcedir}/htcacheclean.service.xml
xmlto man %{_sourcedir}/httpd.service.xml
# apachectl.xml => apachectl.8
xmlto man %{SOURCE47}
: Building with MMN %{mmn}, MMN-ISA %{mmnisa}
: Default MPM is %{mpm}, vendor string is '%{vstring}'
%build
# Forcibly prevent use of bundled apr, apr-util, pcre.
%{__rm} -rf srclib/{apr,apr-util,pcre}
# Regenerate configure scripts.
autoheader && autoconf || exit 1
# Before configure; fix location of build dir in generated apxs.
%{__perl} -pi -e "s:\@exp_installbuilddir\@:%{_libdir}/httpd/build:g" \
support/apxs.in
export CFLAGS=${RPM_OPT_FLAGS}
export LDFLAGS="-Wl,-z,relro,-z,now"
# Hard-code path to links to avoid unnecessary builddep.
export LYNX_PATH=/usr/bin/links
# Build the daemon.
./configure \
--prefix=%{_sysconfdir}/httpd \
--exec-prefix=%{_prefix} \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--mandir=%{_mandir} \
--libdir=%{_libdir} \
--sysconfdir=%{_sysconfdir}/httpd/conf \
--includedir=%{_includedir}/httpd \
--libexecdir=%{_libdir}/httpd/modules \
--datadir=%{contentdir} \
--enable-layout=Fedora \
--with-installbuilddir=%{_libdir}/httpd/build \
--enable-mpms-shared=all \
--with-apr=%{_prefix} --with-apr-util=%{_prefix} \
--enable-suexec --with-suexec \
--enable-suexec-capabilities \
--with-suexec-caller=%{suexec_caller} \
--with-suexec-docroot=%{docroot} \
--without-suexec-logfile \
--with-suexec-syslog \
--with-suexec-bin=%{_sbindir}/suexec \
--with-suexec-uidmin=1000 --with-suexec-gidmin=1000 \
--with-brotli \
--enable-pie \
--with-pcre \
--enable-mods-shared=all \
--enable-ssl --with-ssl --disable-distcache \
--enable-proxy --enable-proxy-fdpass \
--enable-cache \
--enable-disk-cache \
--enable-ldap --enable-authnz-ldap \
--enable-cgid --enable-cgi \
--enable-cgid-fdpassing \
--enable-authn-anon --enable-authn-alias \
--enable-systemd \
--disable-imagemap --disable-file-cache \
--disable-http2 \
--disable-md \
$*
%{make_build}
%install
%{__rm} -rf %{buildroot}
%{make_install}
# Install systemd service files.
%{__mkdir_p} %{buildroot}%{_unitdir}
for s in httpd.service htcacheclean.service httpd.socket \
[email protected] httpd-init.service; do
%{__install} -p -m 644 %{_sourcedir}/${s} \
%{buildroot}%{_unitdir}/${s}
done
# Install conf file/directory.
%{__mkdir} %{buildroot}%{_sysconfdir}/httpd/conf.d \
%{buildroot}%{_sysconfdir}/httpd/conf.modules.d
%{__install} -m 644 %{_sourcedir}/README.confd \
%{buildroot}%{_sysconfdir}/httpd/conf.d/README
%{__install} -m 644 %{_sourcedir}/README.confmod \
%{buildroot}%{_sysconfdir}/httpd/conf.modules.d/README
for f in 00-base.conf 00-mpm.conf 00-lua.conf 01-cgi.conf 00-dav.conf \
00-proxy.conf 00-ssl.conf 01-ldap.conf 00-proxyhtml.conf \
01-ldap.conf 00-systemd.conf 01-session.conf 00-optional.conf \
00-brotli.conf; do
%{__install} -m 644 -p %{_sourcedir}/${f} \
%{buildroot}%{_sysconfdir}/httpd/conf.modules.d/${f}
done
# Create "vhosts.d" directory.
%{__mkdir} %{buildroot}%{_sysconfdir}/httpd/vhosts.d
%{__sed} -i '/^#LoadModule mpm_%{mpm}_module /s/^#//' \
%{buildroot}%{_sysconfdir}/httpd/conf.modules.d/00-mpm.conf
touch -r %{_sourcedir}/00-mpm.conf \
%{buildroot}%{_sysconfdir}/httpd/conf.modules.d/00-mpm.conf
# Install systemd override drop directory.
# Web application packages can drop snippets into this location if
# they need ExecStart[pre|post].
%{__mkdir} %{buildroot}%{_unitdir}/httpd.service.d
%{__mkdir} %{buildroot}%{_unitdir}/httpd.socket.d
%{__install} -m 644 -p %{_sourcedir}/10-listen443.conf \
%{buildroot}%{_unitdir}/httpd.socket.d/10-listen443.conf
# Install config for port 8081.
%{__install} -m 644 -p %{SOURCE920} \
%{buildroot}%{_unitdir}/httpd.socket.d/10-listen8081.conf
for f in welcome.conf ssl.conf manual.conf userdir.conf; do
%{__install} -m 644 -p %{_sourcedir}/${f} \
%{buildroot}%{_sysconfdir}/httpd/conf.d/${f}
done
# Split-out extra config shipped as default in "conf.d".
for f in autoindex; do
%{__install} -m 644 docs/conf/extra/httpd-${f}.conf \
%{buildroot}%{_sysconfdir}/httpd/conf.d/${f}.conf
done
# Extra config trimmed.
%{__rm} -v docs/conf/extra/httpd-{ssl,userdir}.conf
%{__rm} %{buildroot}%{_sysconfdir}/httpd/conf/*.conf
%{__install} -m 644 -p %{_sourcedir}/httpd.conf \
%{buildroot}%{_sysconfdir}/httpd/conf/httpd.conf
%{__mkdir} %{buildroot}%{_sysconfdir}/sysconfig
%{__install} -m 644 -p %{_sourcedir}/htcacheclean.sysconf \
%{buildroot}%{_sysconfdir}/sysconfig/htcacheclean
# "tmpfiles.d" configuration.
%{__mkdir_p} %{buildroot}%{_prefix}/lib/tmpfiles.d
%{__install} -m 644 -p %{_sourcedir}/httpd.tmpfiles \
%{buildroot}%{_prefix}/lib/tmpfiles.d/httpd.conf
# Other directories.
%{__mkdir_p} %{buildroot}%{_localstatedir}/lib/httpd \
%{buildroot}/run/httpd/htcacheclean
# Substitute in defaults which are usually done (badly) by "make install".
%{__sed} -i \
"/^DavLockDB/d;
s,@@ServerRoot@@/user.passwd,/etc/httpd/conf/user.passwd,;
s,@@ServerRoot@@/docs,%{docroot},;
s,@@ServerRoot@@,%{docroot},;
s,@@Port@@,80,;" \
docs/conf/extra/*.conf
# Set correct path for httpd binary in apachectl script.
%{__sed} 's,@HTTPDBIN@,%{_sbindir}/httpd,g' %{_sourcedir}/apachectl.sh \
> apachectl.sh
# Create cache directory.
%{__mkdir_p} %{buildroot}%{_localstatedir}/cache/httpd \
%{buildroot}%{_localstatedir}/cache/httpd/proxy \
%{buildroot}%{_localstatedir}/cache/httpd/ssl
# Make the MMN accessible to module packages.
echo %{mmnisa} > %{buildroot}%{_includedir}/httpd/.mmn
%{__mkdir_p} %{buildroot}%{_rpmconfigdir}/macros.d
cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.httpd <<EOF
%%_httpd_mmn %{mmnisa}
%%_httpd_apxs %%{_libdir}/httpd/build/vendor-apxs
%%_httpd_modconfdir %%{_sysconfdir}/httpd/conf.modules.d
%%_httpd_confdir %%{_sysconfdir}/httpd/conf.d
%%_httpd_contentdir %{contentdir}
%%_httpd_moddir %%{_libdir}/httpd/modules
%%_httpd_requires Requires: httpd-mmn = %%{_httpd_mmn}
EOF
# Handle contentdir.
%{__mkdir} %{buildroot}%{contentdir}/noindex \
%{buildroot}%{contentdir}/server-status
%{__ln_s} ../../testpage/index.html \
%{buildroot}%{contentdir}/noindex/index.html
%{__install} -m 644 -p docs/server-status/* \
%{buildroot}%{contentdir}/server-status
%{__rm} -rf %{contentdir}/htdocs
# Remove manual sources.
find %{buildroot}%{contentdir}/manual \( \
-name \*.xml -o -name \*.xml.* -o -name \*.ent -o -name \*.xsl -o -name \*.dtd \
\) -print0 | xargs -0 %{__rm} -f
# Strip the manual down just to English and replace the typemaps with flat files.
set +x
for f in $( find %{buildroot}%{contentdir}/manual -name \*.html -type f ); do
if [[ -f ${f}.en ]]; then
%{__cp} ${f}.en ${f}
%{__rm} ${f}.*
fi
done
set -x
# Clean Document Root.
%{__rm} -v %{buildroot}%{docroot}/html/*.html \
%{buildroot}%{docroot}/cgi-bin/*
# Symlink for the powered-by-${DISTRO} image.
%{__ln_s} ../../pixmaps/poweredby.png \
%{buildroot}%{contentdir}/icons/poweredby.png
# Symlink for the system logo
%if 0%{?rhel} >= 9
%{__ln_s} ../../pixmaps/system-noindex-logo.png \
%{buildroot}%{contentdir}/icons/system_noindex_logo.png
%endif
# Symlinks for /etc/httpd.
rmdir %{buildroot}/etc/httpd/{state,run}
%{__ln_s} ../..%{_localstatedir}/log/httpd %{buildroot}/etc/httpd/logs
%{__ln_s} ../..%{_localstatedir}/lib/httpd %{buildroot}/etc/httpd/state
%{__ln_s} /run/httpd %{buildroot}/etc/httpd/run
%{__ln_s} ../..%{_libdir}/httpd/modules %{buildroot}/etc/httpd/modules
# Install http-ssl-pass-dialog.
%{__mkdir_p} %{buildroot}%{_libexecdir}
%{__install} -m 755 %{_sourcedir}/httpd-ssl-pass-dialog \
%{buildroot}%{_libexecdir}/httpd-ssl-pass-dialog
# Install http-ssl-gencerts.
%{__install} -m 755 %{_sourcedir}/httpd-ssl-gencerts \
%{buildroot}%{_libexecdir}/httpd-ssl-gencerts
# Install scripts.
%{__install} -m 755 apachectl.sh %{buildroot}%{_sbindir}/apachectl
touch -r %{_sourcedir}/apachectl.sh %{buildroot}%{_sbindir}/apachectl
%{__mkdir_p} %{buildroot}%{_libexecdir}/initscripts/legacy-actions/httpd
for f in graceful configtest; do
%{__install} -p -m 755 %{_sourcedir}/action-${f}.sh \
%{buildroot}%{_libexecdir}/initscripts/legacy-actions/httpd/${f}
done
# Install logrotate config.
%{__mkdir_p} %{buildroot}/etc/logrotate.d
%{__install} -m 644 -p %{_sourcedir}/httpd.logrotate \
%{buildroot}/etc/logrotate.d/httpd
# Install man pages.
%{__install} -d %{buildroot}%{_mandir}/man8 %{buildroot}%{_mandir}/man5
%{__install} -m 644 -p httpd.service.8 httpd-init.service.8 httpd.socket.8 \
[email protected] htcacheclean.service.8 apachectl.8 \
%{buildroot}%{_mandir}/man8
%{__install} -m 644 -p httpd.conf.5 \
%{buildroot}%{_mandir}/man5
# Fix man page paths.
%{__sed} -e "s|/usr/local/apache2/conf/httpd.conf|/etc/httpd/conf/httpd.conf|" \
-e "s|/usr/local/apache2/conf/mime.types|/etc/mime.types|" \
-e "s|/usr/local/apache2/conf/magic|/etc/httpd/conf/magic|" \
-e "s|/usr/local/apache2/logs/error_log|/var/log/httpd/error_log|" \
-e "s|/usr/local/apache2/logs/access_log|/var/log/httpd/access_log|" \
-e "s|/usr/local/apache2/logs/httpd.pid|/run/httpd/httpd.pid|" \
-e "s|/usr/local/apache2|/etc/httpd|" < docs/man/httpd.8 \
> %{buildroot}%{_mandir}/man8/httpd.8
# Make "ap_config_layout.h" libdir-agnostic.
%{__sed} -i '/.*DEFAULT_..._LIBEXECDIR/d;/DEFAULT_..._INSTALLBUILDDIR/d' \
%{buildroot}%{_includedir}/httpd/ap_config_layout.h
# Fix path to instdso in "special.mk".
%{__sed} -i '/instdso/s,top_srcdir,top_builddir,' \
%{buildroot}%{_libdir}/httpd/build/special.mk
# Vendor-apxs uses an unsanitized "config_vars.mk" which may
# have dependencies on redhat-rpm-config. Apxs uses the
# "config_vars.mk" with a sanitized "config_vars.mk".
%{__cp} -p %{buildroot}%{_libdir}/httpd/build/config_vars.mk \
%{buildroot}%{_libdir}/httpd/build/vendor_config_vars.mk
# Sanitize CFLAGS & LIBTOOL in standard config_vars.mk
%{__sed} -e '/^CFLAGS/s,=.*$,= -O2 -g -Wall,' \
-e '/^LIBTOOL/s,/.*/libtool,%{_bindir}/libtool,' \
-i %{buildroot}%{_libdir}/httpd/build/config_vars.mk
diff -u %{buildroot}%{_libdir}/httpd/build/vendor_config_vars.mk \
%{buildroot}%{_libdir}/httpd/build/config_vars.mk || true
%{__sed} 's/config_vars.mk/vendor_config_vars.mk/' \
%{buildroot}%{_bindir}/apxs \
> %{buildroot}%{_libdir}/httpd/build/vendor-apxs
touch -r %{buildroot}%{_bindir}/apxs \
%{buildroot}%{_libdir}/httpd/build/vendor-apxs
chmod 755 %{buildroot}%{_libdir}/httpd/build/vendor-apxs
# Remove unpackaged files.
%{__rm} -vf \
%{buildroot}%{_libdir}/*.exp \
%{buildroot}/etc/httpd/conf/mime.types \
%{buildroot}%{_libdir}/httpd/modules/*.exp \
%{buildroot}%{_libdir}/httpd/build/config.nice \
%{buildroot}%{_bindir}/{ap?-config,dbmmanage} \
%{buildroot}%{_sbindir}/{checkgid,envvars*} \
%{buildroot}%{contentdir}/htdocs/* \
%{buildroot}%{_mandir}/man1/dbmmanage.* \
%{buildroot}%{contentdir}/cgi-bin/*
%{__rm} -rf %{buildroot}/etc/httpd/conf/{original,extra}
%pre filesystem
getent group %{httpd_user} >/dev/null || groupadd -g 48 -r %{httpd_user}
getent passwd %{httpd_user} >/dev/null || \
useradd -r -u 48 -g %{httpd_user} -s /sbin/nologin \
-d %{contentdir} -c "Apache" %{httpd_user}
exit 0
%post
%systemd_post httpd.service htcacheclean.service httpd.socket
%preun
%systemd_preun httpd.service htcacheclean.service httpd.socket
%postun
%systemd_postun httpd.service htcacheclean.service httpd.socket
%posttrans
test -f /etc/sysconfig/httpd-disable-posttrans || \
/bin/systemctl try-restart --no-block httpd.service htcacheclean.service >/dev/null 2>&1 || :
%check
%{__make} -C server exports.o
nm --defined httpd > exports-actual.list
set +x
rv=0
nm --defined-only server/exports.o | \
%{__sed} -n '/ap_hack_/{s/.* ap_hack_//;/^ap[ru]/d;p;}' | \
while read sym; do
if ! grep -q " "$sym\$ exports-actual.list; then
echo ERROR: Symbol ${sym} missing in httpd exports
rv=1
fi
done
if [[ ${rv} -eq 0 ]]; then
echo PASS: Symbol export list verified.
fi
# Check the built modules are all PIC.
if readelf -d %{buildroot}%{_libdir}/httpd/modules/*.so | grep TEXTREL; then
echo FAIL: Modules contain non-relocatable code
rv=1
else
echo PASS: No non-relocatable code in module builds
fi
# Ensure every mod_* that's built is loaded.
for f in %{buildroot}%{_libdir}/httpd/modules/*.so; do
m=${f##*/}
if ! grep -q ${m} %{buildroot}%{_sysconfdir}/httpd/conf.modules.d/*.conf; then
echo FAIL: Module ${m} not configured. Disable it, or load it.
rv=1
else
echo PASS: Module ${m} is configured and loaded.
fi
done
# Ensure every loaded "mod_*" is actually built.
mods=$( grep -h ^LoadModule %{buildroot}%{_sysconfdir}/httpd/conf.modules.d/*.conf | %{__sed} 's,.*modules/,,' )
for m in ${mods}; do
f=%{buildroot}%{_libdir}/httpd/modules/${m}
if [[ ! -x ${f} ]]; then
echo FAIL: Module ${m} is configured but not built.
rv=1
else
echo PASS: Loaded module ${m} is installed.
fi
done
set -x
exit ${rv}
%files
%{_mandir}/man8/*
%{_mandir}/man5/*
%exclude %{_mandir}/man8/httpd-init.*
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/00-brotli.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/00-systemd.conf
%{_libdir}/httpd/modules/mod_brotli.so
%{_libdir}/httpd/modules/mod_systemd.so
%{_unitdir}/httpd.service
%{_unitdir}/[email protected]
%{_unitdir}/htcacheclean.service
%{_unitdir}/*.socket
%files core
%doc ABOUT_APACHE README CHANGES LICENSE VERSIONING NOTICE
%doc docs/conf/extra/*.conf
%doc instance.conf server-status.conf
%{_sysconfdir}/httpd/modules
%{_sysconfdir}/httpd/logs
%{_sysconfdir}/httpd/state
%{_sysconfdir}/httpd/run
%dir %{_sysconfdir}/httpd/conf
%config(noreplace) %{_sysconfdir}/httpd/conf/httpd.conf
%config(noreplace) %{_sysconfdir}/httpd/conf/magic
%config(noreplace) %{_sysconfdir}/logrotate.d/httpd
%config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
%exclude %{_sysconfdir}/httpd/conf.d/ssl.conf
%exclude %{_sysconfdir}/httpd/conf.d/manual.conf
%dir %{_sysconfdir}/httpd/conf.modules.d
%{_sysconfdir}/httpd/conf.modules.d/README
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/*.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-brotli.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-systemd.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-ssl.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-proxyhtml.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/00-lua.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/01-ldap.conf
%exclude %{_sysconfdir}/httpd/conf.modules.d/01-session.conf
%config(noreplace) %{_sysconfdir}/sysconfig/htcacheclean
%{_prefix}/lib/tmpfiles.d/httpd.conf
%dir %{_libexecdir}/initscripts/legacy-actions/httpd
%{_libexecdir}/initscripts/legacy-actions/httpd/*
%{_sbindir}/ht*
%{_sbindir}/fcgistarter
%{_sbindir}/apachectl
%{_sbindir}/rotatelogs
%caps(cap_setuid,cap_setgid+pe) %attr(510,root,%{suexec_caller}) %{_sbindir}/suexec
%dir %{_libdir}/httpd
%dir %{_libdir}/httpd/modules
%{_libdir}/httpd/modules/mod*.so
%exclude %{_libdir}/httpd/modules/mod_brotli.so
%exclude %{_libdir}/httpd/modules/mod_systemd.so
%exclude %{_libdir}/httpd/modules/mod_auth_form.so
%exclude %{_libdir}/httpd/modules/mod_ssl.so
%exclude %{_libdir}/httpd/modules/mod_*ldap.so
%exclude %{_libdir}/httpd/modules/mod_proxy_html.so
%exclude %{_libdir}/httpd/modules/mod_xml2enc.so
%exclude %{_libdir}/httpd/modules/mod_session*.so
%exclude %{_libdir}/httpd/modules/mod_lua.so
%dir %{contentdir}/error
%dir %{contentdir}/error/include
%dir %{contentdir}/noindex
%dir %{contentdir}/server-status
%{contentdir}/icons/*
%{contentdir}/error/README
%{contentdir}/error/*.var
%{contentdir}/error/include/*.html
%{contentdir}/noindex/index.html
%{contentdir}/server-status/*
%attr(0710,root,%{httpd_user}) %dir /run/httpd
%attr(0700,%{httpd_user},%{httpd_user}) %dir /run/httpd/htcacheclean
%attr(0700,root,root) %dir %{_localstatedir}/log/httpd
%attr(0700,%{httpd_user},%{httpd_user}) %dir %{_localstatedir}/lib/httpd
%attr(0700,%{httpd_user},%{httpd_user}) %dir %{_localstatedir}/cache/httpd
%attr(0700,%{httpd_user},%{httpd_user}) %dir %{_localstatedir}/cache/httpd/proxy
%files filesystem
%dir %{_sysconfdir}/httpd
%dir %{_sysconfdir}/httpd/conf.d
%{_sysconfdir}/httpd/conf.d/README
%dir %{docroot}
%dir %{docroot}/cgi-bin
%dir %{docroot}/html
%dir %{contentdir}
%dir %{contentdir}/icons
%attr(755,root,root) %dir %{_unitdir}/httpd.service.d
%attr(755,root,root) %dir %{_unitdir}/httpd.socket.d
%dir %{_sysconfdir}/httpd/vhosts.d
%files tools
%{_bindir}/*
%{_mandir}/man1/*
%doc LICENSE NOTICE
%exclude %{_bindir}/apxs
%exclude %{_mandir}/man1/apxs.1*
%files manual
%{contentdir}/manual
%config(noreplace) %{_sysconfdir}/httpd/conf.d/manual.conf
%files -n mod_ssl
%{_libdir}/httpd/modules/mod_ssl.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/00-ssl.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/ssl.conf
%attr(0700,apache,root) %dir %{_localstatedir}/cache/httpd/ssl
%{_unitdir}/httpd-init.service
%{_libexecdir}/httpd-ssl-pass-dialog
%{_libexecdir}/httpd-ssl-gencerts
%{_unitdir}/httpd.socket.d/10-listen443.conf
%{_unitdir}/httpd.socket.d/10-listen8081.conf
%{_mandir}/man8/httpd-init.*
%files -n mod_proxy_html
%{_libdir}/httpd/modules/mod_proxy_html.so
%{_libdir}/httpd/modules/mod_xml2enc.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/00-proxyhtml.conf
%files -n mod_ldap
%{_libdir}/httpd/modules/mod_*ldap.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/01-ldap.conf
%files -n mod_session
%{_libdir}/httpd/modules/mod_session*.so
%{_libdir}/httpd/modules/mod_auth_form.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/01-session.conf
%files -n mod_lua
%{_libdir}/httpd/modules/mod_lua.so
%config(noreplace) %{_sysconfdir}/httpd/conf.modules.d/00-lua.conf
%files devel
%{_includedir}/httpd
%{_bindir}/apxs
%{_mandir}/man1/apxs.1*
%dir %{_libdir}/httpd/build
%{_libdir}/httpd/build/*.mk
%{_libdir}/httpd/build/*.sh
%{_libdir}/httpd/build/vendor-apxs
%{_rpmconfigdir}/macros.d/macros.httpd
%changelog
* Sun Apr 03 2022 Package Store <[email protected]> - 2.4.53-1001
- DEL: "mod_brotli.so" from "00-base.conf".
- DEL: "ci.fmf".
- DEL: "gating.yaml".
* Thu Mar 31 2022 Package Store <[email protected]> - 2.4.53-1000
- UPD: Rebuild by Package Store.
- UPD: File "httpd.spec".
* Wed Mar 30 2022 Luboš Uhliarik <[email protected]> - 2.4.53-2
- Resolves: #2070517 - Allow install httpd with smaller footprint
- try to minimize httpd dependencies (new httpd-core package)
- mod_systemd and mod_brotli are now in the main httpd package
* Thu Mar 17 2022 Luboš Uhliarik <[email protected]> - 2.4.53-1
- new version 2.4.53
- fixes CVE-2022-23943, CVE-2022-22721, CVE-2022-22720 and CVE-2022-22719
* Tue Feb 1 2022 Joe Orton <[email protected]> - 2.4.52-5
- rebuild for new OpenLDAP (#2032699)
* Mon Jan 31 2022 Joe Orton <[email protected]> - 2.4.52-4
- add libtool to Requires: for httpd-devel (#2048281)
* Fri Jan 28 2022 Joe Orton <[email protected]> - 2.4.52-3
- use LIBTOOL=/usr/bin/libtool in the non-vendor config_vars.mk
* Thu Jan 20 2022 Fedora Release Engineering <[email protected]> - 2.4.52-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Dec 22 2021 Joe Orton <[email protected]> - 2.4.52-1
- update to 2.4.52
* Mon Dec 06 2021 Neal Gompa <[email protected]> - 2.4.51-3
- Use NAME from os-release(5) for vendor string
Related: #2029071 - httpd on CentOS identifies as RHEL
* Tue Oct 12 2021 Joe Orton <[email protected]> - 2.4.51-2
- mod_ssl: updated patch for OpenSSL 3.0 compatibility (#2007178)
- mod_deflate/core: add two brigade handling correctness fixes
* Thu Oct 07 2021 Patrick Uiterwijk <[email protected]> - 2.4.51-1
- new version 2.4.51
* Tue Oct 05 2021 Luboš Uhliarik <[email protected]> - 2.4.50-1
- new version 2.4.50
* Wed Sep 22 2021 Luboš Uhliarik <[email protected]> - 2.4.49-3
- Rebuilt for CI testing
* Thu Sep 16 2021 Luboš Uhliarik <[email protected]> - 2.4.49-1
- new version 2.4.49 (#2004776)
* Tue Sep 14 2021 Sahana Prasad <[email protected]> - 2.4.48-8
- Rebuilt with OpenSSL 3.0.0
* Fri Aug 06 2021 Luboš Uhliarik <[email protected]> - 2.4.48-7
- add symlink to system logo for noindex test page
* Fri Aug 6 2021 Joe Orton <[email protected]> - 2.4.48-4
- add OpenSSL 3.x compatibility patch
* Thu Jul 22 2021 Fedora Release Engineering <[email protected]> - 2.4.48-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jul 16 2021 Joe Orton <[email protected]> - 2.4.48-2
- mod_cgi/mod_cgid: update to unification from trunk
- httpd.conf: add note on care with Listen and starting at boot
* Wed Jun 02 2021 Luboš Uhliarik <[email protected]> - 2.4.48-1
- new version 2.4.48
- Resolves: #1964746 - httpd-2.4.48 is available
* Mon May 03 2021 Lubos Uhliarik <[email protected]> - 2.4.46-13
- Related: #1934739 - Apache trademark update - new logo
* Fri Apr 9 2021 Joe Orton <[email protected]> - 2.4.46-12
- use OOMPolicy=continue in httpd.service, [email protected] (#1947475)
* Wed Mar 31 2021 Lubos Uhliarik <[email protected]> - 2.4.46-11
- Resolves: #1934739 - Apache trademark update - new logo
* Tue Feb 23 2021 Joe Orton <[email protected]> - 2.4.46-10
- add Conflicts: with mod_nss
- drop use of apr_ldap_rebind (r1878890, #1847585)
* Mon Feb 01 2021 Lubos Uhliarik <[email protected]> - 2.4.46-9
- Resolves: #1914182 - RFE: CustomLog should be able to use journald
* Tue Jan 26 2021 Fedora Release Engineering <[email protected]> - 2.4.46-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 20 2021 Artem Egorenkov <[email protected]> - 2.4.46-7
- prevent htcacheclean from while break when first file processed
* Thu Dec 17 2020 Joe Orton <[email protected]> - 2.4.46-6
- move mod_lua to a subpackage
- Recommends: both mod_lua and mod_http2
* Fri Nov 6 2020 Joe Orton <[email protected]> - 2.4.46-5
- add %%_httpd_requires to macros
* Thu Aug 27 2020 Joe Orton <[email protected]> - 2.4.46-4
- use make macros (Tom Stellard)
* Thu Aug 27 2020 Joe Orton <[email protected]> - 2.4.46-3
- strip /usr/bin/apxs CFLAGS further
* Thu Aug 27 2020 Joe Orton <[email protected]> - 2.4.46-2
- sanitize CFLAGS used by /usr/bin/apxs by default (#1873020)
- add $libdir/httpd/build/vendor-apxs which exposes full CFLAGS