import sources
This commit is contained in:
commit
c2b58703c9
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/javamail-1.6.2.tar.gz
|
||||
40
0000-Disable-tests-that-use-networking.patch
Normal file
40
0000-Disable-tests-that-use-networking.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From 158e5fdcc7cbe38067a8e83d975cfe32999e650d Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Wed, 23 Oct 2019 12:55:51 +0200
|
||||
Subject: [PATCH] Disable tests that use networking
|
||||
|
||||
---
|
||||
.../test/java/com/sun/mail/util/WriteTimeoutSocketTest.java | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java b/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
|
||||
index b1d80d3..b04c827 100644
|
||||
--- a/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
|
||||
+++ b/mail/src/test/java/com/sun/mail/util/WriteTimeoutSocketTest.java
|
||||
@@ -62,6 +62,7 @@ import com.sun.mail.test.TestSocketFactory;
|
||||
import com.sun.mail.test.TestSSLSocketFactory;
|
||||
|
||||
import org.junit.Test;
|
||||
+import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.Timeout;
|
||||
import static org.junit.Assert.fail;
|
||||
@@ -111,6 +112,7 @@ public final class WriteTimeoutSocketTest {
|
||||
* Test write timeouts with SSL sockets.
|
||||
*/
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testSSL() {
|
||||
final Properties properties = new Properties();
|
||||
properties.setProperty("mail.imap.host", "localhost");
|
||||
@@ -127,6 +129,7 @@ public final class WriteTimeoutSocketTest {
|
||||
* Test write timeouts with a custom SSL socket factory.
|
||||
*/
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testSSLSocketFactory() throws Exception {
|
||||
final Properties properties = new Properties();
|
||||
properties.setProperty("mail.imap.host", "localhost");
|
||||
--
|
||||
2.21.0
|
||||
|
||||
123
0001-Fix-NPE-in-MailHandler-JDK-8216363.patch
Normal file
123
0001-Fix-NPE-in-MailHandler-JDK-8216363.patch
Normal file
@ -0,0 +1,123 @@
|
||||
From 7e1c46bc8521540627e9a9d870743f282c87becb Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Thu, 2 Jul 2020 12:01:38 +0200
|
||||
Subject: [PATCH] Fix NPE in MailHandler-JDK-8216363
|
||||
|
||||
---
|
||||
.../sun/mail/util/logging/MailHandler.java | 11 +++-
|
||||
.../mail/util/logging/MailHandlerTest.java | 59 +++++++++++--------
|
||||
2 files changed, 44 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java b/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java
|
||||
index e6879ba..2021c99 100644
|
||||
--- a/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java
|
||||
+++ b/mail/src/main/java/com/sun/mail/util/logging/MailHandler.java
|
||||
@@ -594,6 +594,9 @@ public class MailHandler extends Handler {
|
||||
*/
|
||||
@Override
|
||||
public boolean isLoggable(final LogRecord record) {
|
||||
+ if (record == null) { //JDK-8233979
|
||||
+ return false;
|
||||
+ }
|
||||
int levelValue = getLevel().intValue();
|
||||
if (record.getLevel().intValue() < levelValue || levelValue == offValue) {
|
||||
return false;
|
||||
@@ -634,8 +637,12 @@ public class MailHandler extends Handler {
|
||||
if (tryMutex()) {
|
||||
try {
|
||||
if (isLoggable(record)) {
|
||||
- record.getSourceMethodName(); //Infer caller.
|
||||
- publish0(record);
|
||||
+ if (record != null) {
|
||||
+ record.getSourceMethodName(); //Infer caller.
|
||||
+ publish0(record);
|
||||
+ } else { //Override of isLoggable is broken.
|
||||
+ reportNullError(ErrorManager.WRITE_FAILURE);
|
||||
+ }
|
||||
}
|
||||
} catch (final LinkageError JDK8152515) {
|
||||
reportLinkageError(JDK8152515, ErrorManager.WRITE_FAILURE);
|
||||
diff --git a/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java b/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
|
||||
index 506b3d6..19541b7 100644
|
||||
--- a/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
|
||||
+++ b/mail/src/test/java/com/sun/mail/util/logging/MailHandlerTest.java
|
||||
@@ -474,34 +474,15 @@ public class MailHandlerTest extends AbstractLogging {
|
||||
instance.setErrorManager(em);
|
||||
|
||||
instance.setLevel(lvl);
|
||||
- MemoryHandler mem = null;
|
||||
boolean result = false;
|
||||
boolean expect = true;
|
||||
- try {
|
||||
- result = instance.isLoggable(record);
|
||||
- mem = new MemoryHandler(new ConsoleHandler(), 100, Level.OFF);
|
||||
- mem.setErrorManager(em);
|
||||
- mem.setLevel(lvl);
|
||||
- expect = mem.isLoggable(record);
|
||||
- } catch (RuntimeException mailEx) {
|
||||
- try {
|
||||
- if (mem != null) {
|
||||
- fail("MemoryHandler threw and exception: " + mailEx);
|
||||
- } else {
|
||||
- mem = new MemoryHandler(new ConsoleHandler(), 100, Level.OFF);
|
||||
- mem.setErrorManager(em);
|
||||
- mem.setLevel(lvl);
|
||||
- expect = mem.isLoggable(record);
|
||||
- fail("MailHandler threw and exception: " + mailEx);
|
||||
- }
|
||||
- } catch (RuntimeException memEx) {
|
||||
- assertEquals(memEx.getClass(), mailEx.getClass());
|
||||
- result = false;
|
||||
- expect = false;
|
||||
- }
|
||||
+ if (record == null || record.getLevel().intValue() < lvl.intValue()
|
||||
+ || Level.OFF.intValue() == lvl.intValue()) {
|
||||
+ expect = false;
|
||||
}
|
||||
- assertEquals(expect, result);
|
||||
|
||||
+ result = instance.isLoggable(record);
|
||||
+ assertEquals(lvl.getName(), expect, result);
|
||||
instance.setLevel(Level.INFO);
|
||||
instance.setFilter(BooleanFilter.FALSE);
|
||||
instance.setAttachmentFormatters(
|
||||
@@ -643,6 +624,36 @@ public class MailHandlerTest extends AbstractLogging {
|
||||
instance.close();
|
||||
}
|
||||
|
||||
+ @Test
|
||||
+ public void testPublishNull() {
|
||||
+ MailHandler instance = new MailHandler();
|
||||
+ InternalErrorManager em = new InternalErrorManager();
|
||||
+ instance.setErrorManager(em);
|
||||
+ instance.setLevel(Level.ALL);
|
||||
+ instance.publish((LogRecord) null);
|
||||
+ instance.close();
|
||||
+ for (Throwable t : em.exceptions) {
|
||||
+ dump(t);
|
||||
+ }
|
||||
+ assertTrue(em.exceptions.isEmpty());
|
||||
+ }
|
||||
+
|
||||
+ @Test
|
||||
+ public void testPublishNullAsTrue() {
|
||||
+ MailHandler instance = new MailHandler() {
|
||||
+ public boolean isLoggable(LogRecord r) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ };
|
||||
+ InternalErrorManager em = new InternalErrorManager();
|
||||
+ instance.setErrorManager(em);
|
||||
+ instance.setLevel(Level.ALL);
|
||||
+ instance.publish((LogRecord) null);
|
||||
+ instance.close();
|
||||
+ assertEquals(true, em.exceptions.get(0) instanceof NullPointerException);
|
||||
+ assertEquals(1, em.exceptions.size());
|
||||
+ }
|
||||
+
|
||||
@Test
|
||||
public void testPublishLinkageError() throws Exception {
|
||||
testLinkageErrorWithStack("publish");
|
||||
--
|
||||
2.25.4
|
||||
|
||||
228
javamail.spec
Normal file
228
javamail.spec
Normal file
@ -0,0 +1,228 @@
|
||||
Name: javamail
|
||||
Version: 1.6.2
|
||||
Release: 2%{?dist}
|
||||
Summary: Java Mail API
|
||||
License: CDDL-1.0 or GPLv2 with exceptions
|
||||
URL: http://www.oracle.com/technetwork/java/javamail
|
||||
BuildArch: noarch
|
||||
|
||||
Source: https://github.com/javaee/javamail/archive/JAVAMAIL-1_6_2.tar.gz#/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: 0000-Disable-tests-that-use-networking.patch
|
||||
Patch1: 0001-Fix-NPE-in-MailHandler-JDK-8216363.patch
|
||||
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(junit:junit)
|
||||
BuildRequires: mvn(net.java:jvnet-parent:pom:)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
|
||||
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
|
||||
|
||||
# Adapted from the classpathx-mail (and JPackage glassfish-javamail) Provides.
|
||||
Provides: javamail-monolithic = %{version}-%{release}
|
||||
|
||||
Provides: javax.mail
|
||||
|
||||
%description
|
||||
The JavaMail API provides a platform-independent and protocol-independent
|
||||
framework to build mail and messaging applications.
|
||||
|
||||
%package javadoc
|
||||
Summary: Javadoc for %{name}
|
||||
|
||||
%description javadoc
|
||||
%{summary}.
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
pushd javamail-JAVAMAIL-1_6_2
|
||||
find -name module-info.java -delete
|
||||
mv * ..
|
||||
popd
|
||||
rm -rf javamail-JAVAMAIL-1_6_2
|
||||
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
|
||||
# -Werror is harmful - harmless compiler warnings cause build failure
|
||||
%pom_xpath_remove "pom:arg[text()='-Werror']" mail
|
||||
|
||||
# Use bundled fork of JAF which is not available in OpenJDK 11
|
||||
%pom_change_dep javax.activation:activation com.sun.mail:android-activation:\${mail.version} mail
|
||||
cp -p {android/,}mail/src/main/java/com/sun/mail/handlers/handler_base.java
|
||||
|
||||
# Test requires full JAF and does not work with bundled JAF
|
||||
rm -f mail/src/test/java/com/sun/mail/handlers/TextXmlTest.java
|
||||
|
||||
# Disable unneeded modules
|
||||
%pom_disable_module mail android
|
||||
%pom_disable_module dsn
|
||||
|
||||
# Unneeded plugin
|
||||
%pom_remove_plugin :animal-sniffer-maven-plugin android
|
||||
|
||||
# Remove profiles containing demos and other stuff that is not
|
||||
# supposed to be deployable.
|
||||
%pom_xpath_remove /pom:project/pom:profiles
|
||||
|
||||
# osgiversion-maven-plugin is used to set ${mail.osgiversion} property
|
||||
# based on ${project.version}. We don't have osgiversion plugin in
|
||||
# Fedora so we'll set ${mail.osgiversion} explicitly.
|
||||
%pom_remove_plugin -r org.glassfish.hk2:osgiversion-maven-plugin
|
||||
%pom_xpath_inject /pom:project/pom:properties "<mail.osgiversion>%{version}</mail.osgiversion>"
|
||||
%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true</_nouses>"
|
||||
|
||||
# Alternative names for super JAR containing API and implementation.
|
||||
%mvn_alias com.sun.mail:mailapi javax.mail:mailapi
|
||||
%mvn_alias com.sun.mail:javax.mail javax.mail:mail \
|
||||
org.eclipse.jetty.orbit:javax.mail.glassfish
|
||||
%mvn_file "com.sun.mail:{javax.mail}" %{name}/@1 %{name}/mail
|
||||
|
||||
%build
|
||||
%mvn_build
|
||||
|
||||
%install
|
||||
%mvn_install
|
||||
|
||||
install -d -m 755 %{buildroot}%{_javadir}/javax.mail/
|
||||
ln -sf ../%{name}/javax.mail.jar %{buildroot}%{_javadir}/javax.mail/
|
||||
|
||||
%files -f .mfiles
|
||||
%doc mail/src/main/java/overview.html
|
||||
%doc mail/src/main/resources/META-INF/LICENSE.txt
|
||||
%{_javadir}/javax.mail/
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%doc mail/src/main/resources/META-INF/LICENSE.txt
|
||||
|
||||
%changelog
|
||||
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.6.2-2
|
||||
- Mass rebuild for javapackages-tools 201902
|
||||
|
||||
* Wed Oct 23 2019 Marian Koncek <mkoncek@redhat.com> - 1.6.2-1
|
||||
- Update to upstream version 1.6.2
|
||||
|
||||
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.2-8
|
||||
- Mass rebuild for javapackages-tools 201901
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Nov 09 2017 Michael Simacek <msimacek@redhat.com> - 1.5.2-6
|
||||
- Specify CDDL license version
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Fri Mar 6 2015 Alexander Kurtakov <akurtako@redhat.com> 1.5.2-1
|
||||
- Update to upstream 1.5.2 using upstream tarball.
|
||||
|
||||
* Fri Mar 6 2015 Alexander Kurtakov <akurtako@redhat.com> 1.5.1-5
|
||||
- Remove javax.activation:activation dependency.
|
||||
|
||||
* Mon Aug 4 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-4
|
||||
- Fix build-requires on jvnet-parent
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Mon Mar 31 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-2
|
||||
- Regenerate build-requires
|
||||
|
||||
* Mon Mar 31 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.1-1
|
||||
- Update to upstream version 1.5.1
|
||||
|
||||
* Mon Mar 31 2014 Alexander Kurtakov <akurtako@redhat.com> 1.5.0-8
|
||||
- Do not generate uses clauses for osgi -too strict linking.
|
||||
|
||||
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-7
|
||||
- Use Requires: java-headless rebuild (#1067528)
|
||||
|
||||
* Mon Aug 12 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-6
|
||||
- Add forgotten provides
|
||||
|
||||
* Mon Aug 12 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.5.0-5
|
||||
- Add javax.mail provides and directory
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-3
|
||||
- Add compat symlink for javax.mail:mail
|
||||
|
||||
* Mon Jun 24 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-2
|
||||
- Add Maven alias for javax.mail:mail
|
||||
|
||||
* Mon Jun 24 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.5.0-1
|
||||
- Update to upstream version 1.5.0
|
||||
|
||||
* Thu Mar 7 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.6-1
|
||||
- Update to upstream version 1.4.6
|
||||
|
||||
* Mon Mar 4 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-16
|
||||
- Add depmap for org.eclipse.jetty.orbit
|
||||
- Resolves: rhbz#917624
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 1.4.3-14
|
||||
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
|
||||
- Replace maven BuildRequires with maven-local
|
||||
|
||||
* Thu Oct 11 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-13
|
||||
- Fix URL
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Mon Jun 11 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.4.3-11
|
||||
- Update OSGi manifest patch
|
||||
|
||||
* Tue May 29 2012 Gerard Ryan <galileo@fedoraproject.org> - 1.4.3-10
|
||||
- Add extra information to OSGi manifest
|
||||
- Fix rpmlint error about mavendepmapfragdir
|
||||
|
||||
* Wed Mar 21 2012 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-9
|
||||
- Drop tomcat6-jsp-api requires - it's dependency management not dependency, hence not needed.
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Nov 29 2011 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-7
|
||||
- Build with maven3.
|
||||
- Adapt to current guidelines.
|
||||
|
||||
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.3-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Wed Dec 8 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.4.3-5
|
||||
- Fix pom filenames (#655806)
|
||||
- Versionless jars/javadocs (new guidelines)
|
||||
- Migrate to tomcat6 (#652004)
|
||||
- Other cleanups
|
||||
|
||||
* Wed Sep 8 2010 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-4
|
||||
- Add surefire provider BR.
|
||||
|
||||
* Wed Sep 8 2010 Alexander Kurtakov <akurtako@redhat.com> 1.4.3-3
|
||||
- Drop gcj_support.
|
||||
- Use javadoc:aggregate.
|
||||
|
||||
* Fri Jan 8 2010 Mary Ellen Foster <mefoster at gmail.com> 1.4.3-2
|
||||
- Remove unnecessary (build)requirement tomcat5-servlet-2.4-api
|
||||
- Move jar files into subdirectory
|
||||
|
||||
* Wed Dec 2 2009 Mary Ellen Foster <mefoster at gmail.com> 1.4.3-1
|
||||
- Initial package
|
||||
Loading…
Reference in New Issue
Block a user