1d51159
Name: mod_nss
ab58f3b
Version: 1.0.8
0607911
Release: 12%{?dist}
1d51159
Summary: SSL/TLS module for the Apache HTTP server
1d51159
Group: System Environment/Daemons
eb30dfb
License: ASL 2.0
a3ec3c2
URL: http://directory.fedoraproject.org/wiki/Mod_nss
a3ec3c2
Source: http://directory.fedoraproject.org/sources/%{name}-%{version}.tar.gz
1d51159
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
6a017c9
BuildRequires: nspr-devel >= 4.6.3, nss-devel >= 3.12.6
6a017c9
BuildRequires: httpd-devel, apr-devel, apr-util-devel
1d51159
BuildRequires: pkgconfig
6a017c9
Requires(pre): httpd
6a017c9
Requires: nss >= 3.12.6
0607911
Requires(post): nss-tools
1d51159
Patch1: mod_nss-conf.patch
1d51159
Patch2: mod_nss-gencert.patch
ab58f3b
Patch3: mod_nss-wouldblock.patch
6a017c9
# Add options for tuning client negotiate in NSS
6a017c9
Patch4: mod_nss-negotiate.patch
37f57cd
Patch5: mod_nss-reverseproxy.patch
4658ec2
Patch6: mod_nss-pcachesignal.h
8e50d07
Patch7: mod_nss-reseterror.patch
0541c47
Patch8: mod_nss-overlapping_memcpy.patch
49307c8
Patch9: mod_nss-lockpcache.patch
1d51159
1d51159
%description
1d51159
The mod_nss module provides strong cryptography for the Apache Web
1d51159
server via the Secure Sockets Layer (SSL) and Transport Layer
1d51159
Security (TLS) protocols using the Network Security Services (NSS)
1d51159
security library.
1d51159
1d51159
%prep
1d51159
%setup -q
1d51159
%patch1 -p1 -b .conf
1d51159
%patch2 -p1 -b .gencert
ab58f3b
%patch3 -p1 -b .wouldblock
6a017c9
%patch4 -p1 -b .negotiate
37f57cd
%patch5 -p1 -b .reverseproxy
4658ec2
%patch6 -p1 -b .pcachesignal.h
8e50d07
%patch7 -p1 -b .reseterror
0541c47
%patch8 -p1 -b .overlapping
49307c8
%patch9 -p1 -b .lockpcache
1d51159
1d51159
# Touch expression parser sources to prevent regenerating it
1d51159
touch nss_expr_*.[chyl]
1d51159
1d51159
%build
1d51159
1d51159
CFLAGS="$RPM_OPT_FLAGS"
1d51159
export CFLAGS
1d51159
1d51159
NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nspr`
1d51159
NSPR_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nspr`
1d51159
1d51159
NSS_INCLUDE_DIR=`/usr/bin/pkg-config --variable=includedir nss`
1d51159
NSS_LIB_DIR=`/usr/bin/pkg-config --variable=libdir nss`
1d51159
1d51159
NSS_BIN=`/usr/bin/pkg-config --variable=exec_prefix nss`
1d51159
1d51159
%configure \
1d51159
    --with-nss-lib=$NSS_LIB_DIR \
1d51159
    --with-nss-inc=$NSS_INCLUDE_DIR \
1d51159
    --with-nspr-lib=$NSPR_LIB_DIR \
1d51159
    --with-nspr-inc=$NSPR_INCLUDE_DIR \
1150597
    --with-apr-config
1d51159
1d51159
make %{?_smp_mflags} all
1d51159
1d51159
%install
1d51159
# The install target of the Makefile isn't used because that uses apxs
1d51159
# which tries to enable the module in the build host httpd instead of in
1d51159
# the build root.
1d51159
rm -rf $RPM_BUILD_ROOT
1d51159
1d51159
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf
1d51159
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
1d51159
mkdir -p $RPM_BUILD_ROOT%{_libdir}/httpd/modules
1d51159
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
1d51159
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias
1d51159
1d51159
install -m 644 nss.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
1d51159
install -m 755 .libs/libmodnss.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/
1d51159
install -m 755 nss_pcache $RPM_BUILD_ROOT%{_sbindir}/
1d51159
install -m 755 gencert $RPM_BUILD_ROOT%{_sbindir}/
6a017c9
ln -s ../../../%{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/
450756e
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/secmod.db
450756e
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/cert8.db
450756e
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/key3.db
450756e
touch $RPM_BUILD_ROOT%{_sysconfdir}/httpd/alias/install.log
1d51159
1d51159
perl -pi -e "s:$NSS_LIB_DIR:$NSS_BIN:" $RPM_BUILD_ROOT%{_sbindir}/gencert
1d51159
1d51159
%clean
1d51159
rm -rf $RPM_BUILD_ROOT
1d51159
1d51159
%post
1d51159
umask 077
1d51159
1d51159
if [ "$1" -eq 1 ] ; then
450756e
    if [ ! -e %{_sysconfdir}/httpd/alias/key3.db ]; then
1d51159
        %{_sbindir}/gencert %{_sysconfdir}/httpd/alias > %{_sysconfdir}/httpd/alias/install.log 2>&1
1d51159
        echo ""
1d51159
        echo "%{name} certificate database generated."
1d51159
        echo ""
1d51159
    fi
e03f3fe
e03f3fe
    # Make sure that the database ownership is setup properly.
6a017c9
    /bin/find %{_sysconfdir}/httpd/alias -user root -name "*.db" -exec /bin/chgrp apache {} \;
6a017c9
    /bin/find %{_sysconfdir}/httpd/alias -user root -name "*.db" -exec /bin/chmod g+r {} \;
1d51159
fi
1d51159
1d51159
%files
1d51159
%defattr(-,root,root,-)
1d51159
%doc README LICENSE docs/mod_nss.html
1d51159
%config(noreplace) %{_sysconfdir}/httpd/conf.d/nss.conf
1d51159
%{_libdir}/httpd/modules/libmodnss.so
1d51159
%dir %{_sysconfdir}/httpd/alias/
e03f3fe
%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/secmod.db
e03f3fe
%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/cert8.db
e03f3fe
%ghost %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/httpd/alias/key3.db
450756e
%ghost %config(noreplace) %{_sysconfdir}/httpd/alias/install.log
1d51159
%{_sysconfdir}/httpd/alias/libnssckbi.so
1d51159
%{_sbindir}/nss_pcache
1d51159
%{_sbindir}/gencert
1d51159
1d51159
%changelog
0607911
* Wed Mar  7 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-12
0607911
- Add Requires(post) for nss-tools, gencert needs it (#652007)
0607911
49307c8
* Wed Mar  2 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-11
49307c8
- Lock around the pipe to nss_pcache for retrieving the token PIN
49307c8
  (#677701)
49307c8
0541c47
* Wed Jan 12 2011 Rob Crittenden <rcritten@redhat.com> - 1.0.8-10
0541c47
- Use memmove in place of memcpy since the buffers can overlap (#669118)
0541c47
Jesse Keating fc60066
* Wed Sep 29 2010 jkeating - 1.0.8-9.1
Jesse Keating fc60066
- Rebuilt for gcc bug 634757
Jesse Keating fc60066
8e50d07
* Thu Sep 23 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-9
8e50d07
- Revert mod_nss-wouldblock patch
8e50d07
- Reset NSPR error before calling PR_Read(). This should fix looping
8e50d07
  in #620856
8e50d07
de8be4f
* Fri Sep 17 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-8
de8be4f
- Fix hang when handling large POST under some conditions (#620856)
de8be4f
1563eb1
* Tue Jun 22 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-7
1563eb1
- Remove file Requires on libnssckbi.so (#601939)
1563eb1
4658ec2
* Fri May 14 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-6
4658ec2
- Ignore SIGHUP in nss_pcache (#591889).
4658ec2
37f57cd
* Thu May 13 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-5
37f57cd
- Use remote hostname set by mod_proxy to compare to CN in peer cert (#591224)
37f57cd
6a017c9
* Thu Mar 18 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-4
6a017c9
- Patch to add configuration options for new NSS negotiation API (#574187)
6a017c9
- Add (pre) for Requires on httpd so we can be sure the user and group are
6a017c9
  already available
6a017c9
- Add file Requires on libnssckbi.so so symlink can't fail
6a017c9
- Use _sysconfdir macro instead of /etc
6a017c9
- Set minimum level of NSS to 3.12.6
6a017c9
6a017c9
* Mon Jan 25 2010 Rob Crittenden <rcritten@redhat.com> - 1.0.8-3
6a017c9
- The location of libnssckbi moved from /lib[64] to /usr/lib[64] (556744)
6a017c9
83b11db
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.8-2
83b11db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
83b11db
ab58f3b
* Mon Mar  2 2009 Rob Crittenden <rcritten@redhat.com> - 1.0.8-1
ab58f3b
- Update to 1.0.8
ab58f3b
- Add patch that fixes NSPR layer bug
ab58f3b
27f1634
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.7-11
27f1634
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
27f1634
eb30dfb
* Mon Aug 11 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 1.0.7-10
eb30dfb
- fix license tag
eb30dfb
e821ee0
* Mon Jul 28 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-9
e821ee0
- rebuild to bump NVR
e821ee0
73247ca
* Mon Jul 14 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-8
73247ca
- Don't force module de-init during the configuration stage (453508)
73247ca
73247ca
* Thu Jul 10 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-7
73247ca
- Don't inherit the MP cache in multi-threaded mode (454701)
73247ca
- Don't initialize NSS in each child if SSL isn't configured
73247ca
541e194
* Wed Jul  2 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-6
541e194
- Update the patch for FIPS to include fixes for nss_pcache, enforce
541e194
  the security policy and properly initialize the FIPS token.
541e194
ba1b066
* Mon Jun 30 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-5
ba1b066
- Include patch to fix NSSFIPS (446851)
ba1b066
e03f3fe
* Mon Apr 28 2008 Rob Crittenden <rcritten@redhat.com> - 1.0.7-4
e03f3fe
- Apply patch so that mod_nss calls NSS_Init() after Apache forks a child
e03f3fe
  and not before. This is in response to a change in the NSS softtokn code
e03f3fe
  and should have always been done this way. (444348)
e03f3fe
- The location of libnssckbi moved from /usr/lib[64] to /lib[64]
e03f3fe
- The NSS database needs to be readable by apache since we need to use it
e03f3fe
  after the root priviledges are dropped.
e03f3fe
818134b
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.0.7-3
818134b
- Autorebuild for GCC 4.3
818134b
b0b7ced
* Thu Oct 18 2007 Rob Crittenden <rcritten@redhat.com> 1.0.7-2
b0b7ced
- Register functions needed by mod_proxy if mod_ssl is not loaded.
b0b7ced
a3ec3c2
* Fri Jun  1 2007 Rob Crittenden <rcritten@redhat.com> 1.0.7-1
a3ec3c2
- Update to 1.0.7
a3ec3c2
- Remove Requires for nss and nspr since those are handled automatically
a3ec3c2
  by versioned libraries
a3ec3c2
- Updated URL and Source to reference directory.fedoraproject.org
a3ec3c2
1150597
* Mon Apr  9 2007 Rob Crittenden <rcritten@redhat.com> 1.0.6-2
1150597
- Patch to properly detect the Apache model and set up NSS appropriately
1150597
- Patch to punt if a bad password is encountered
1150597
- Patch to fix crash when password.conf is malformatted
1150597
- Don't enable ECC support as NSS doesn't have it enabled (3.11.4-0.7)
1150597
c13df6e
* Mon Oct 23 2006 Rob Crittenden <rcritten@redhat.com> 1.0.6-1
c13df6e
- Update to 1.0.6
39a6bb3
450756e
* Fri Aug 04 2006 Rob Crittenden <rcritten@redhat.com> 1.0.3-4
450756e
- Include LogLevel warn in nss.conf and use separate log files
450756e
450756e
* Fri Aug 04 2006 Rob Crittenden <rcritten@redhat.com> 1.0.3-3
450756e
- Need to initialize ECC certificate and key variables
450756e
450756e
* Fri Aug 04 2006 Jarod Wilson <jwilson@redhat.com> 1.0.3-2
450756e
- Use %%ghost for db files and install.log
450756e
1d51159
* Tue Jun 20 2006 Rob Crittenden <rcritten@redhat.com> 1.0.3-1
1d51159
- Initial build