Changes of Revision 5

mod_nss.spec Added
x
 
1
@@ -0,0 +1,285 @@
2
+%{!?_httpd_apxs:       %{expand: %%global _httpd_apxs       %%{_sbindir}/apxs}}
3
+%{!?_httpd_mmn:        %{expand: %%global _httpd_mmn        %%(cat %{_includedir}/httpd/.mmn || echo missing-httpd-devel)}}
4
+%{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
5
+# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
6
+%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
7
+%{!?_httpd_moddir:    %{expand: %%global _httpd_moddir    %%{_libdir}/httpd/modules}}
8
+
9
+Name: mod_nss
10
+Version: 1.0.8
11
+Release: 19.1%{?dist}
12
+Summary: SSL/TLS module for the Apache HTTP server
13
+Group: System Environment/Daemons
14
+License: ASL 2.0
15
+URL: http://directory.fedoraproject.org/wiki/Mod_nss
16
+Source: http://directory.fedoraproject.org/sources/%{name}-%{version}.tar.gz
17
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
18
+BuildRequires: nspr-devel >= 4.6.3, nss-devel >= 3.12.6
19
+BuildRequires: httpd-devel, apr-devel, apr-util-devel
20
+BuildRequires: pkgconfig
21
+Requires: httpd-mmn = %{_httpd_mmn}
22
+Requires(post): httpd, nss-tools
23
+Requires: nss >= 3.12.6
24
+Patch1: mod_nss-conf.patch
25
+Patch2: mod_nss-gencert.patch
26
+Patch3: mod_nss-wouldblock.patch
27
+# Add options for tuning client negotiate in NSS
28
+Patch4: mod_nss-negotiate.patch
29
+Patch5: mod_nss-reverseproxy.patch
30
+Patch6: mod_nss-pcachesignal.h
31
+Patch7: mod_nss-reseterror.patch
32
+Patch8: mod_nss-lockpcache.patch
33
+Patch9: mod_nss-httpd24.patch
34
+Patch10: mod_nss-overlapping_memcpy.patch
35
+
36
+%description
37
+The mod_nss module provides strong cryptography for the Apache Web
38
+server via the Secure Sockets Layer (SSL) and Transport Layer
39
+Security (TLS) protocols using the Network Security Services (NSS)
40
+security library.
41
+
42
+%prep
43
+%setup -q
44
+%patch1 -p1 -b .conf
45
+%patch2 -p1 -b .gencert
46
+%patch3 -p1 -b .wouldblock
47
+%patch4 -p1 -b .negotiate
48
+%patch5 -p1 -b .reverseproxy
49
+%patch6 -p1 -b .pcachesignal.h
50
+%patch7 -p1 -b .reseterror
51
+%patch8 -p1 -b .lockpcache
52
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
53
+%patch9 -p1 -b .httpd24
54
+%endif
55
+%patch10 -p1 -b .overlap
56
+
57
+# Touch expression parser sources to prevent regenerating it
58
+touch nss_expr_*.[chyl]
59
+
60
+%build
61
+
62
+CFLAGS="$RPM_OPT_FLAGS"
63
+APXS=%{_httpd_apxs}
64
+
65
+export CFLAGS APXS
66
+
67
+NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nspr`
68
+NSPR_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nspr`
69
+
70
+NSS_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nss`
71
+NSS_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nss`
72
+
73
+NSS_BIN=`/usr/bin/pkg-config --variable=exec_prefix nss`
74
+
75
+%configure \
76
+    --with-nss-lib=$NSS_LIB_DIR \
77
+    --with-nss-inc=$NSS_INCLUDE_DIR \
78
+    --with-nspr-lib=$NSPR_LIB_DIR \
79
+    --with-nspr-inc=$NSPR_INCLUDE_DIR \
80
+    --with-apr-config
81
+
82
+make %{?_smp_mflags} all
83
+
84
+%install
85
+# The install target of the Makefile isn't used because that uses apxs
86
+# which tries to enable the module in the build host httpd instead of in
87
+# the build root.
88
+rm -rf $RPM_BUILD_ROOT
89
+
90
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf
91
+mkdir -p $RPM_BUILD_ROOT%{_httpd_confdir}
92
+mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
93
+mkdir -p $RPM_BUILD_ROOT%{_sbindir}
94
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias
95
+
96
+%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
97
+# httpd >= 2.4.x
98
+mkdir -p $RPM_BUILD_ROOT%{_httpd_modconfdir}
99
+sed -n /^LoadModule/p nss.conf > 10-nss.conf
100
+sed -i /^LoadModule/d nss.conf
101
+install -m 644 10-nss.conf $RPM_BUILD_ROOT%{_httpd_modconfdir}
102
+%endif
103
+
104
+install -m 644 nss.conf $RPM_BUILD_ROOT%{_httpd_confdir}
105
+
106
+install -m 755 .libs/libmodnss.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/
107
+install -m 755 nss_pcache $RPM_BUILD_ROOT%{_sbindir}/
108
+install -m 755 gencert $RPM_BUILD_ROOT%{_sbindir}/
109
+ln -s ../../../%{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/
110
+touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/secmod.db
111
+touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/cert8.db
112
+touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/key3.db
113
+touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/install.log
114
+
115
+perl -pi -e "s:$NSS_LIB_DIR:$NSS_BIN:" $RPM_BUILD_ROOT%{_sbindir}/gencert
116
+
117
+%clean
118
+rm -rf $RPM_BUILD_ROOT
119
+
120
+%post
121
+umask 077
122
+
123
+if [ "$1" -eq 1 ] ; then
124
+    if [ ! -e %{_sysconfdir}/httpd/alias/key3.db ]; then
125
+        %{_sbindir}/gencert %{_sysconfdir}/httpd/alias > %{_sysconfdir}/httpd/alias/install.log 2>&1
126
+        echo ""
127
+        echo "%{name} certificate database generated."
128
+        echo ""
129
+    fi
130
+
131
+    # Make sure that the database ownership is setup properly.
132
+    /bin/find %{_sysconfdir}/httpd/alias -user root -name "*.db" -exec /bin/chgrp apache {} \;
133
+    /bin/find %{_sysconfdir}/httpd/alias -user root -name "*.db" -exec /bin/chmod g+r {} \;
134
+fi
135
+
136
+%files
137
+%defattr(-,root,root,-)
138
+%doc README LICENSE docs/mod_nss.html
139
+%config(noreplace) %{_httpd_confdir}/nss.conf
140
+%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
141
+%config(noreplace) %{_httpd_modconfdir}/10-nss.conf
142
+%endif
143
+%{_libdir}/httpd/modules/libmodnss.so
144
+%dir %{_sysconfdir}/httpd/alias/
145
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/secmod.db
146
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/cert8.db
147
+%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/key3.db
148
+%ghost %config(noreplace) %{_sysconfdir}/httpd/alias/install.log
149
+%{_sysconfdir}/httpd/alias/libnssckbi.so
150
+%{_sbindir}/nss_pcache
151
+%{_sbindir}/gencert
152
+
153
+%changelog
154
+* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-19.1
155
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
156
+
157
+* Mon Jun 18 2012 Joe Orton <jorton@redhat.com> - 1.0.8-18.1
158
+- fix build for RHEL7
159
+
160
+* Fri Jun 15 2012 Rob Crittenden <rcritten@redhat.com> - 1.0.8-18
161
+- Actually apply the patch to use memmove in place of memcpy since the
162
+  buffers can overlap (#669118)
163
+
164
+* Tue Jun 12 2012 Nathan Kinder <nkinder@redhat.com> - 1.0.8-17
165
+- Port mod_nss to work with httpd 2.4
166
+
167
+* Mon Apr 23 2012 Joe Orton <jorton@redhat.com> - 1.0.8-16
168
+- packaging fixes/updates (#803072)
169
+
170
+* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-15
171
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
172
+
173
+* Wed Mar  7 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-14
174
+- Add Requires(post) for nss-tools, gencert needs it (#652007)
175
+
176
+* Wed Mar  2 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-13
177
+- Lock around the pipe to nss_pcache for retrieving the token PIN
178
+  (#677701)
179
+
180
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-12
181
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
182
+
183
+* Wed Jan 12 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-11
184
+- Use memmove in place of memcpy since the buffers can overlap (#669118)
185
+
186
+* Wed Sep 29 2010 jkeating - 1.0.8-10
187
+- Rebuilt for gcc bug 634757
188
+
189
+* Thu Sep 23 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-9
190
+- Revert mod_nss-wouldblock patch
191
+- Reset NSPR error before calling PR_Read(). This should fix looping
192
+  in #620856
193
+
194
+* Fri Sep 17 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-8
195
+- Fix hang when handling large POST under some conditions (#620856)
196
+
197
+* Tue Jun 22 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-7
198
+- Remove file Requires on libnssckbi.so (#601939)
199
+
200
+* Fri May 14 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-6
201