Blob Blame History Raw
%global majorrel `uname -r | cut -f1 -d.`
%global minorrel `uname -r | cut -f2 -d.`

Name:           jss
Version:        4.4.0
Release:        0.1%{?dist}.test.1
Summary:        Java Security Services (JSS)

Group:          System Environment/Libraries
License:        MPLv1.1 or GPLv2+ or LGPLv2+
URL:            http://www.mozilla.org/projects/security/pki/jss/
# The source for this package was pulled from upstream's hg. Use the
# following commands to generate the tarball:
# hg clone --rev JSS_4_4_0_RTM https://hg.mozilla.org/projects/jss jss-4.4.0/jss
# rm -rf jss-4.4.0/jss/.hg
# tar -czvf jss-4.4.0.tar.gz jss-4.4.0
#
# For now util the JSS_4_4_0_RTM tag is created I actually used: 
# hg clone --rev 8eef3835a3c7 https://hg.mozilla.org/projects/jss jss-4.4.0/jss
# This is from upstream tip
#
Source0:        http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}-%{release}/%{name}-%{version}.tar.gz
Source1:        http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}-%{release}/MPL-1.1.txt
Source2:        http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}-%{release}/gpl.txt
Source3:        http://pki.fedoraproject.org/pki/sources/%{name}/%{name}-%{version}-%{release}/lgpl.txt
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  nss-devel >= 3.21.0
BuildRequires:  nspr-devel >= 4.11.0
BuildRequires:  java-devel
%if 0%{?fedora} >= 25
BuildRequires:     perl
%endif
Requires:       java-headless
Requires:       nss >= 3.21.0

%description
Java Security Services (JSS) is a java native interface which provides a bridge
for java-based applications to use native Network Security Services (NSS).
This only works with gcj. Other JREs require that JCE providers be signed.

%package javadoc
Summary:        Java Security Services (JSS) Javadocs
Group:          Documentation
Requires:       jss = %{version}-%{release}

%description javadoc
This package contains the API documentation for JSS.

%prep
%setup -q -n %{name}-%{version}

%build
[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java
[ -z "$USE_INSTALLED_NSPR" ] && export USE_INSTALLED_NSPR=1
[ -z "$USE_INSTALLED_NSS" ] && export USE_INSTALLED_NSS=1

# Enable compiler optimizations and disable debugging code
# NOTE: If you ever need to create a debug build with optimizations disabled
# just comment out this line and change in the %%install section below the
# line that copies jars xpclass.jar to be xpclass_dbg.jar
export BUILD_OPT=1

# Generate symbolic info for debuggers
XCFLAGS="-g $RPM_OPT_FLAGS"
export XCFLAGS

PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1

export PKG_CONFIG_ALLOW_SYSTEM_LIBS
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS

NSPR_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nspr | sed 's/-I//'`
NSPR_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nspr | sed 's/-L//'`

NSS_INCLUDE_DIR=`/usr/bin/pkg-config --cflags-only-I nss | sed 's/-I//'`
NSS_LIB_DIR=`/usr/bin/pkg-config --libs-only-L nss | sed 's/-L//'`

export NSPR_INCLUDE_DIR
export NSPR_LIB_DIR
export NSS_INCLUDE_DIR
export NSS_LIB_DIR

%if 0%{?__isa_bits} == 64
USE_64=1
export USE_64
%endif

cp -p jss/coreconf/Linux.mk jss/coreconf/Linux%{majorrel}.%{minorrel}.mk
sed -i -e 's;LINUX2_1;LINUX%{majorrel}_%{minorrel};' jss/coreconf/Linux%{majorrel}.%{minorrel}.mk

# The Makefile is not thread-safe
make -C jss/coreconf
make -C jss
make -C jss javadoc

%check


%install
rm -rf $RPM_BUILD_ROOT docdir

# Copy the license files here so we can include them in %%doc
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .

# There is no install target so we'll do it by hand

# jars
install -d -m 0755 $RPM_BUILD_ROOT%{_jnidir}
# NOTE: if doing a debug no opt build change xpclass.jar to xpclass_debug.jar
install -m 644 dist/xpclass_debug.jar ${RPM_BUILD_ROOT}%{_jnidir}/jss4.jar

# We have to use the name libjss4.so because this is dynamically
# loaded by the jar file.
install -d -m 0755 $RPM_BUILD_ROOT%{_libdir}/jss
install -m 0755 dist/Linux*.OBJ/lib/libjss4.so ${RPM_BUILD_ROOT}%{_libdir}/jss/
pushd  ${RPM_BUILD_ROOT}%{_libdir}/jss
    ln -fs %{_jnidir}/jss4.jar jss4.jar
popd

# javadoc
install -d -m 0755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -rp dist/jssdoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p jss/jss.html $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -p *.txt $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

# No ldconfig is required since this library is loaded by Java itself.
%files
%defattr(-,root,root,-)
%doc jss/jss.html MPL-1.1.txt gpl.txt lgpl.txt
%{_libdir}/jss/*
%{_jnidir}/*
%{_libdir}/jss/lib*.so

%files javadoc
%defattr(-,root,root,-)
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*


%changelog
* Sat Mar 11 2017 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.1.test.1
- Experimental debug no-opt build to rebase to jss-4.4.0
- Remove unused patches

* Mon Feb 13 2017 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.11
- rebuilt with experimental patches
- add patch to use installed nspr and nss
- add patch to add missing files

* Thu Feb 09 2017 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.10
- Update the sources, won't build yet
- Pushing to the branch so we can investigate

* Thu Feb 09 2017 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.9
- Remove the method for testing in %%check phase

* Thu Jan 19 2017 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.8
- Use a cleaner method for testing in %%check phase
- see https://bugzilla.mozilla.org/show_bug.cgi?id=1322364

* Mon Dec 19 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.7
- Use majorrel and minorrel when copying in %%check phase

* Mon Dec 19 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.6
- Provide option to test a specified revision from the upstream
- Usage export REV=somerev; fedpkg --release master local

* Fri Dec 16 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.5
- Made %%check testing slighty less hackish but still a work in progress

* Tue Dec 13 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.4
- Changed commands to %%check to run tests and using a debug build

* Tue Dec 13 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.0-0.3
- Fix and enable patch 9 for bad error string pointer 

* Sat Dec 10 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.4-0.2
- Check for failures and fail the build if any are found

* Sat Dec 10 2016 Elio Maldonado <emaldona@redhat.com> - 4.4.4-0.1
- Rebuilt with new sources based on BUG13078_BRANCH
- Disable a patch on account of a commit on that branch
- Add commands to %%check to run tests like upstream does 

* Fri Oct 07 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.15
- Add URLs for bugs filed upstream to the the list of patches 

* Thu Sep 29 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.14
- Add missing URLS to downstream bugs
- Update various comments and the TODO list
- Update last two patches to refer to a jss 4.4.0 release

* Wed Sep 28 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.13
- Match remaining patches to bug fixes and provide author info

* Tue Sep 20 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.12
- Additional adjustments for upstream integration effort
- Add uptream bug URL for Patch3 per fedora package guidelines
- Add downstream bug URL for Patch21 and Patch26 as no upstream bugs are filed
- Remove unused patches rendered obsolete by rebase
- Not all patches have been matched to bug fixes

* Sun Sep 11 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.11
- Add a patch and modify another based on feedback from ongoing upstream review
- Add jss-def-adjust-release-of-new-apis.patch to add new apis like upstream
- Add jss-update-patch-version.patch with additional files that need to be changed
- Add TODO comments on needed adjustments for the upstream integration release

* Thu Sep 08 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.10
- Add reference to upstream bug for jss-4.3.3

* Tue Sep 06 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.9
- Cleanup of spec file and existing patch
- Remove temporary comments from the jss-support-TLS1_1-TLS1_2.patch
- Add TODO comments regarding JSS_PATCH_VERSION patch to be removed
- Enable compiler optimizations and disable debugging code 

* Sat Sep 03 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.8
- Bump the SSLVersionRange range constants by seven

* Fri Sep 02 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.7
- Update the JSS_PATCH_VERSION patch version to 3

* Thu Sep 01 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.6
- Integrate two patches needed by the pkispawn script for pki-tomcat
- Reenable and integrate jss-ocspSettings.patch
- Reenable and integrate jss-loadlibrary.patch
- Reduce the changes to the spec file

* Thu Aug 18 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.5
- 

* Mon Aug 15 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.4.elio.1
- Experimental build for rebasing to jss-3.4.3
- Add reminder note to file upstream bugs for the enabled patches
- Add explanatory notes on how one can do a debug no-opt build

* Sat Aug 13 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.3.elio.1
- Remove unused patches rendered obsolete by rebase

* Sat Aug 13 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.2.elio.1
- Fix additional javadoc errors and restore javadoc generation

* Fri Aug 12 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.1.elio.1
- Enable the remainaing patches updated for latest sources and update others
- Restore generation of javadoc 

* Thu Aug 11 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.1.nojavadoc.2
- Enable additional patches that have been updated for latest sources and update others
- Temporarily add -b backup info to patch application to help resolving update issues
- Restore in spec file old style to reduce the changes needed to review

* Wed Aug 10 2016 Elio Maldonado <emaldona@redhat.com> - 4.3.3-0.1.nojavadoc.1
- Experimental build for rebasing to jss-3.4.3
- Not generating javadoc

* Tue Aug 9 2016 Christina Fu <cfu@redhat.com> - 4.2.6-42
- Sync up patches from both Fedora and RHEL; adding two patches
  (cfu, edewata, mharmsen) from RHEL:
- Bugzilla Bug #1238450 - UnsatisfiedLinkError on Windows (cfu)
- make it compile on Windows platforms (cfu for nhosoi)

* Fri Jun 24 2016 Christina Fu <cfu@redhat.com> - 4.2.6-41
- Bugzilla 1221295 jss fails to decode EncryptedKey >> EnvelopedData
  (cfu for roysjosh@gmail.com)

* Thu May 19 2016 Christina Fu <cfu@redhat.com> - 4.2.6-40
- Bugzilla 1074208 - pass up exact JSS certificate validation errors from NSS
  (edewata)
- Bugzilla 1331596 - Key archival fails when KRA is configured with lunasa.
  (cfu)
- PKI ticket 801 - Merge pki-symkey into jss (phase 1)
  (jmagne)

* Wed Dec 09 2015 Endi Dewata <edewata@redhat.com> - 4.2.6-38
- Bugzilla Bug #1289799 - JSS build failure on F23 and Rawhide (edewata)

* Thu Apr 09 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 4.2.6-37
- Fix use of __isa_bits macro so it does not fail during srpm generation on koji

* Thu Apr 09 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 4.2.6-36
- Use __isa_bits macro to check for 64-bit arch. Unblocks aarch64 and ppc64le.

* Tue Sep 30 2014 Christina Fu <cfu@redhat.com> - 4.2.6-35
- Bugzilla Bug #1040640 - Incorrect OIDs for SHA2 algorithms
  (cfu for jnimeh@gmail.com)
- Bugzilla Bug #1133718 - Key strength validation is not performed for RC4
  algorithm (nkinder)
- Bugzilla Bug #816396 - Provide Tomcat support for TLS v1.1 and
  TLS v1.2 via NSS through JSS (cfu)

* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-33
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 4.2.6-32
- Use Requires: java-headless rebuild (#1067528)

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Jul 17 2013 Nathan Kinder <nkinder@redhat.com> - 4.2.6-30
- Bugzilla Bug #847120 - Unable to build JSS on F17 or newer

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Dec 19 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 4.2.6-28
- revbump after jnidir change

* Wed Dec 12 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 4.2.6-27
- Simple rebuild

* Mon Nov 19 2012 Christina Fu <cfu@redhat.com> - 4.2.6-26
- added source URLs in spec file to pass Package Wrangler

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Mar 30 2012 Matthew Harmsen <mharmsen@redhat.com> - 4.2.6-24
- Bugzilla Bug #783007 - Un-deprecate previously deprecated methods in
  JSS 4.2.6 . . . BadPaddingException (mharmsen)

* Tue Mar 20 2012 Christina Fu <cfu@redhat.com> - 4.2.6-23
- Bugzilla Bug #797351 - JSS - HSM token name was mistaken for manufacturer
  identifier (cfu)
- Bugzilla Bug #804840 - [RFE] ECC encryption keys cannot be archived
  ECC phase2 work - support for ECC encryption key archival and recovery (cfu)
- Bugzilla Bug #783007 - Un-deprecate previously deprecated methods in
  JSS 4.2.6 . . . (mharmsen)
- Dogtag TRAC Task #109 (https://fedorahosted.org/pki/ticket/109) - add
  benign JNI jar file symbolic link from JNI libdir to JNI jar file (mharmsen)

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Oct 19 2011 Christina Fu <cfu@redhat.com> - 4.2.6-21
- Bugzilla Bug #737122 - DRM: during archiving and recovering, wrapping
  unwrapping keys should be done in the token
- support for PKCS5v2; support for secure PKCS12
- Bugzilla Bug #744797 - KRA key recovery (retrieve pkcs#12) fails after the
  in-place upgrade( CS 8.0->8.1)

* Mon Sep 19 2011 Matthew Harmsen <mharmsen@redhat.com> - 4.2.6-20
- Bugzilla Bug #715621 - Defects revealed by Coverity scan

* Wed Aug 31 2011 Matthew Harmsen <mharmsen@redhat.com> - 4.2.6-19.1
- Bugzilla Bug #734590 - Refactor JNI libraries for Fedora 16+ . . .

* Mon Aug 15 2011 Christina Fu <cfu@redhat.com> - 4.2.6-19
- Bugzilla Bug 733550 - DRM failed to recovery keys when in FIPS mode
  (HSM + NSS)

* Fri Aug 12 2011 Matthew Harmsen <mharmsen@redhat.com> - 4.2.6-18
- Bugzilla Bug #660436 - Warnings should be cleaned up in JSS build
  (jdennis, mharmsen)

* Wed May 18 2011 Christina Fu <cfu@redhat.com> - 4.2.6-17
- Bug 670980 - Cannot create system certs when using LunaSA HSM in FIPS Mode
  and ECC algorithms (support tokens that don't do ECDH)

* Fri Apr 08 2011 Jack Magne <jmagne@redhat.com> - 4.2.6-15.99
- bug 694661 - TKS instance crash during token enrollment.
  Back out of previous patch for #676083.

* Thu Feb 24 2011 Andrew Wnuk <awnuk@redhat.com> - 4.2.6-15
- bug 676083 - JSS: slots not freed

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Jan 31 2011 John Dennis <jdennis@redhat.com> - 4.2.6-13
- remove misleading comment in spec file concerning jar signing

* Tue Jan 11 2011 Kevin Wright <kwright@redhat.com> - 4.2.6-12
- added missing patch line

* Tue Dec 21 2010 Christina Fu <cfu@redhat.com> - 4.2.6-11
- bug 654657 - <jdennis@redhat.com>
  Incorrect socket accept error message due to bad pointer arithmetic
- bug 661142 - <cfu@redhat.com>
  Verification should fail when a revoked certificate is added

* Thu Dec 16 2010 John Dennis <jdennis@redhat.com> - 4.2.6-10
- Resolves: bug 656094 - <jdennis@redhat.com>
  Rebase jss to at least jss-4.2.6-9
- <jdennis@redhat.com>
  merge in updates from Fedora
  move jar location to %%{_libdir}/jss and provide symlinks, on 32bit looks like this:
    /usr/lib/java/jss4.jar -> /usr/lib/jss/jss4.jar
    /usr/lib/jss/jss4-<version>.jar
    /usr/lib/jss/jss4.jar -> jss4-<version>.jar
    /usr/lib/jss/libjss4.so
- bug 654657 - <jdennis@redhat.com>
  Incorrect socket accept error message due to bad pointer arithmetic
- bug 647364 - <cfu@redhat.com>
  Expose updated certificate verification function in JSS
- bug 529945 - <cfu@redhat.com>
  expose NSS calls for OCSP settings
- bug 638833 - <cfu@redhat.com>
  rfe ecc - add ec curve name support in JSS and CS
- <rcritten@redhat.com>
  Need to explicitly catch UnsatisfiedLinkError exception for System.load()
- bug 533304 - <rcritten@redhat.com>
  Move location of libjss4.so to subdirectory and use System.load() to
  load it instead of System.loadLibrary() for Fedora packaging compliance

* Mon Nov 30 2009 Dennis Gregorovic <dgregor@redhat.com> - 4.2.6-4.1
- Rebuilt for RHEL 6

* Fri Jul 31 2009 Rob Crittenden <rcritten@redhat.com> 4.2.6-4
- Resolves: bug 224688 - <cfu@redhat.com>
  Support ECC POP on the server
- Resolves: bug 469456 - <jmagne@redhat.com>
  Server Sockets are hard coded to IPV4
- Resolves: bug 509183 - <mharmsen@redhat.com>
  Set NSS dependency >= 3.12.3.99

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri Jun  5 2009 Rob Crittenden <rcritten@redhat.com> 4.2.6-2
- Include patch to fix missing @param so javadocs will build

* Fri Jun  5 2009 Rob Crittenden <rcritten@redhat.com> 4.2.6-1
- Resolves: bug 455305 - <cfu@redhat.com>
  CA ECC Signing Key Failure
- Resolves: bug 502111 - <cfu@redhat.com>
  Need JSS interface for NSS's PK11_GenerateKeyPairWithOpFlags() function
- Resolves: bug 503809 - <mharmsen@redhat.com>
  Update JSS version to 4.2.6
- Resolves: bug 503817 - <mharmsen@redhat.com>
  Create JSS Javadocs as their own RPM

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Aug  5 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 4.2.5-3
- fix license tag

* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 4.2.5-2
- Autorebuild for GCC 4.3

* Fri Aug  3 2007 Rob Crittenden <rcritten@redhat.com> 4.2.5-1
- update to 4.2.5

* Thu May 24 2007 Rob Crittenden <rcritten@redhat.com> 4.2.4-6
- Use _jnidir macro instead of _javadir for the jar files. This will break
  multilib installs but adheres to the jpackage spec.

* Wed May 16 2007 Rob Crittenden <rcritten@redhat.com> 4.2.4-5
- Include the 3 license files
- Remove Requires for nss and nspr. These libraries have versioned symbols
  so BuildRequires is enough to set the minimum.
- Add sparc64 for the 64-bit list

* Mon May 14 2007 Rob Crittenden <rcritten@redhat.com> 4.2.4-4
- Included additional comments on jar signing and why ldconfig is not
  required.

* Thu May 10 2007 Rob Crittenden <rcritten@redhat.com> 4.2.4-3
- Added information on how to pull the source into a tar.gz

* Thu Mar 15 2007  Rob Crittenden <rcritten@redhat.com> 4.2.4-2
- Added RPM_OPT_FLAGS to XCFLAGS
- Added link to Sun JCE information

* Tue Feb 27 2007 Rob Crittenden <rcritten@redhat.com> 4.2.4-1
- Initial build