From a1728b4283090cfc0ebb7894e190860448c97106bde32ebc4240d02a1bcd95e0 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Sun, 8 Sep 2024 12:02:44 +0000 Subject: [PATCH] - Update to version 1.6.2 * Changes in the 1.6.2 release + GH 306 Infinite loop parsing invalid ID response + GH 307 StringIndexOutOfBoundsException when *.proxy.host contains a colon + GH 309 Multipart Content-Transfer-Encoding trailing space + GH 310 Android app fails to build with JavaMail 1.6.1 + GH 314 InternetAddress fails to detect illegal square brackets in local part + GH 315 empty Content-Transfer-Encoding header causes IOException + GH 316 starttls.enable documentation should reference starttls.required prop + GH 317 use System.lineSeparator() instead of System.getProperty(...) + GH 321 URLName.getURL() returns incorrect url. + GH 322 Dots in local part of emails not handled properly + GH 323 Support loading protocol providers using ServiceLoader + GH 326 Apply relaxed Content-Disposition parsing to Content-Disposition params + GH 330 Attachment filename is ignored + GH 332 http proxy support should support authenticating to the proxy server + GH 333 search with Unicode char throws BadCommandException with UTF8=ALLOW + GH 334 gimap set labels error with some non english characters * Changes in the 1.6.1 release + GH 262 Some IMAP servers send EXPUNGE responses for unknown messages + GH 278 BODYSTRUCTURE Parser fails on specific IMAP Server response + GH 283 clean up connections when closing IMAPStore + GH 287 Allow relaxed Content-Disposition parsing + GH 289 use a different IMAP tag prefix for each connection + GH 291 define JDK 9 module name for JavaMail + GH 296 HTTP proxy support needs to use HTTP/1.1 * Changes in the 1.6.0 release + GH 75 MimeMultipart should throw ParseException for parsing errors + GH 77 MimeMessage.updateHeaders should set the Date header if not already set + GH 93 Support addressing i18n via RFC 6530/6531/6532 + GH 104 The UIDFolder interface should have a getter for UIDNEXT + GH 135 MailHandler should choose a better default subject formatter. + GH 159 Store, Transport, and Folder should implement AutoCloseable + GH 174 MailDateFormat changes for version 1.6 + GH 183 Fix javac warnings + GH 209 fails to parse some fetch response that has space before final ')' + GH 214 IMAP doesn't handle illegal CAPABILITY response after LOGIN/AUTHENTICATE + GH 226 MailSessionDefinition should use the Repeatable annotation for Java EE 8 + GH 227 IdleManager fails on Android + GH 228 Test fails: javax.mail.internet.GetLocalAddressTest + GH 229 Tests fail: com.sun.mail.util.WriteTimeoutSocketTest + GH 230 MboxFolder.expunge can corrupt mailbox file + GH 231 CompactFormatter should handle overridden Throwable.toString methods + GH 232 Update public API to use generics + GH 233 Malformed IMAP FETCH response throws the wrong exception + GH 234 RFC822.SIZE > 2GB isn't handled + GH 237 Protocol#command method call readResponse after IOException is thrown + GH 238 Possible NPE in Status. line 96 + GH 239 MailHandler should support 'login' verify type. + GH 240 MailHandler support for non-multipart messages + GH 241 use of YoungerTerm/OlderTerm on server without WITHIN support fails + GH 244 The UIDFolder interface should have a MAXUID constant + GH 245 java.io.IOException: No content when reading msg with empty attachment + GH 247 look for resource files in /conf on JDK 1.9 + GH 248 MimeUtility should treat GB2312 as one of the supersets GBK or GB18030 + GH 249 Flags convenience methods + GH 250 SMTP support for the CHUNKING extension of RFC 3030 + GH 251 MimeUtility.unfold squashes multiple spaces + GH 252 JavaMail PLAIN authentication should implement RFC 4616 + GH 253 Support connecting through web proxy servers + GH 256 support UIDPLUS UIDNOTSTICKY response code + GH 257 SASL authentication should always allow UTF-8 username and password + GH 258 android-activation MANIFEST has empty Bundle-SymbolicName * Changes in the 1.5.6 release The following bugs have been fixed in the 1.5.6 release. + GH 199 Support LogRecord.setMillis being deprecated in JDK 9 + GH 200 Logging should support LogRecord.getInstant + GH 202 Create common super class for logging tests + GH 205 NPE by APOP detection when no greeting banner + GH 206 Make IMAPProtocol.handleLoginResult protected + GH 207 InternetAddress.parse fails for valid domain literal address + GH 210 unsolicited FETCH response *must* invalidate X-GM-LABELS in cache + GH 211 MimeBodyPart.isMimeType returns false if type header can't be parsed + GH 213 NPE in Tomcat ClassLoader causes Session.getInstance to fail + GH 215 Deadlock in IMAPFolder.doProtocolCommand() + GH 216 InternetAddress.getLocalAddress should use InetAddress.getCanonicalHostName + GH 217 Store finalizers should not talk to server + GH 219 MailHandler verify should load additional content handlers + GH 220 NullPointerException if SASL is enabled on Android + GH 221 write timeouts don't work with SSL on Android + GH 222 JavaMail allows injection of unwanted headers + GH 223 Message.setRecipient(type, null) should remove recipients * Changes in the 1.5.5 release + GH 168 add support for setting GMail labels on messages + GH 169 Add spam filter for use with MailHandler. + GH 170 Address MailDateFormat issues + GH 172 Typo in "mail.stmp.sendpartial" + GH 173 mail.mime.encodefilename property should override RFC 2231 encoding + GH 176 IMAP should support a mail.imap.auth.mechanisms property like SMTP + GH 177 setting mail..auth.mechanisms should override mail..auth..disable + GH 178 add support for OAuth 2.0 without SASL + GH 179 capability() command doesn't properly transform errors + GH 180 MailHandler needs better support for stateful filters. + GH 181 add support for IMAP login referrals (RFC 2221) + GH 182 whitespace line at beginning confuses InternetHeaders + GH 184 Eliminate legacy classes + GH 185 IndexOutOfBoundsException reading IMAP literal when connection fails + GH 186 IdleManager dies with CancelledKeyException + GH 187 IdleManager can deadlock when not busy + GH 188 IMAP Folder methods throw runtime exceptions when connection drops + GH 189 InternetAddress doesn't detect some illegal newlines + GH 190 Status class doesn't decode mailbox name + GH 191 add support for IMAP COMPRESS extension (RFC 4978) + GH 194 Empty Gmail X-GM-LABELS list is misparsed + GH 195 IMAPMessage.getReceivedDate should check if receivedDate is present before loading envelope + GH 196 CollectorFormatter descending order data race + GH 198 off-by-1 error in Response.readStringList causes early termination of parsing FETCH response + GH 201 INTERNALDATE FetchProfile Item + GH 203 Exchange returns NIL instead of "" for empty parameter, causing NPE * Changes in the 1.5.4 release + GH 149 Include elapsed time, thread id, and sequence for logging formatters. + GH 153 MailHandlerTest does not check field is static or final + GH 157 IdleManager can deadlock with frequent notifications + GH 158 IdleManager can deadlock when connection fails + GH 160 IMAP provider should support the MOVE extension (RFC 6851) + GH 162 MODSEQ should be stored in IMAPMessage if CONDSTORE is enabled + GH 163 Space character lost from end of quoted-printable body parts + GH 164 GmailMessage extensions are not cached after implicit FETCH + GH 165 IMAP message sets should be sorted in cases where order doesn't matter + GH 166 ID command shouldn't escape NIL value + GH 167 Make IMAPProtocol class extendable * Changes in the 1.5.3 release + GH 122 Make constructor of POP3Folder protected to allow subclassing + GH 123 calling IdleManager.watch twice on same folder fails + GH 124 NPE in IMAPFolder.copyUIDMessages when COPYUID not returned + GH 127 Message-Id leaks current user/hostname of the Java process (security) + GH 128 IMAP idle breaks interrupt flag + GH 129 Date search terms result in wrong greater-than SEARCH commands for IMAP + GH 131 address similar to (x)(z) will throw StringIndexOutOfBoundsException + GH 132 Update logging demos to use the new 1.5.2 features + GH 133 Use classloader ergonomics in the MailHandler + GH 137 ArrayIndexOutOfBoundsException in IMAPFolder.copyUIDMessages + GH 138 attachment filenames aren't being encoded by default + GH 139 Include javadoc example formats for logging. + GH 141 SharedFileInputStream has problems with 2GB+ files + GH 143 MimeBodyPart with copied DataHandler doesn't always set encoding + GH 144 skip unusable Store and Transport classes + GH 145 long parameter values should be split using RFC 2231 + GH 146 javax.mail.Authenticator thread safety + GH 148 Modify MailHandler to support Google App Engine. + GH 150 EXPUNGE response during UID FETCH breaks UID->seqnum mapping + GH 151 ArrayIndexOutOfBoundsException caused by out-of-range IMAP responses + GH 154 write timeouts don't work with a custom SSL socket factory + GH 155 SMTP SASL DIGEST-MD5 fails on postfix since the last reply sent is "*" OBS-URL: https://build.opensuse.org/package/show/Java:packages/javamail?expand=0&rev=29 --- .gitattributes | 23 ++++ .gitignore | 1 + JAVAMAIL-1_5_2.tar.gz | 3 + JAVAMAIL-1_6_2.tar.gz | 3 + javamail-javadoc.patch | 10 ++ javamail.changes | 252 +++++++++++++++++++++++++++++++++++++++++ javamail.spec | 145 ++++++++++++++++++++++++ 7 files changed, 437 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 JAVAMAIL-1_5_2.tar.gz create mode 100644 JAVAMAIL-1_6_2.tar.gz create mode 100644 javamail-javadoc.patch create mode 100644 javamail.changes create mode 100644 javamail.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/JAVAMAIL-1_5_2.tar.gz b/JAVAMAIL-1_5_2.tar.gz new file mode 100644 index 0000000..7b95623 --- /dev/null +++ b/JAVAMAIL-1_5_2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc8e6c9a440b87c0e8911c29e02dd22740dc85c6dc1f8e20c7a009dad72cbcca +size 893620 diff --git a/JAVAMAIL-1_6_2.tar.gz b/JAVAMAIL-1_6_2.tar.gz new file mode 100644 index 0000000..a00b482 --- /dev/null +++ b/JAVAMAIL-1_6_2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:870e17293628437a03ae03404f51105c1ab8f682594cb18e005cb99e15d01d24 +size 1107140 diff --git a/javamail-javadoc.patch b/javamail-javadoc.patch new file mode 100644 index 0000000..1eb3551 --- /dev/null +++ b/javamail-javadoc.patch @@ -0,0 +1,10 @@ +--- javamail-JAVAMAIL-1_5_2/build.xml 2014-05-03 00:52:03.000000000 +0200 ++++ javamail-JAVAMAIL-1_5_2/build.xml 2019-01-21 12:35:28.859613463 +0100 +@@ -573,6 +573,7 @@ + author="false" + version="false" + use="true" ++ source="${javac.source}" + overview="${release.dir}/javadoc/overview.html" + windowtitle="JavaMail API documentation" + doctitle="JavaMail API documentation"> diff --git a/javamail.changes b/javamail.changes new file mode 100644 index 0000000..5b494a7 --- /dev/null +++ b/javamail.changes @@ -0,0 +1,252 @@ +------------------------------------------------------------------- +Sat Sep 7 09:09:45 UTC 2024 - Anton Shvetz + +- Update to version 1.6.2 + * Changes in the 1.6.2 release + + GH 306 Infinite loop parsing invalid ID response + + GH 307 StringIndexOutOfBoundsException when *.proxy.host + contains a colon + + GH 309 Multipart Content-Transfer-Encoding trailing space + + GH 310 Android app fails to build with JavaMail 1.6.1 + + GH 314 InternetAddress fails to detect illegal square + brackets in local part + + GH 315 empty Content-Transfer-Encoding header causes + IOException + + GH 316 starttls.enable documentation should reference + starttls.required prop + + GH 317 use System.lineSeparator() instead of + System.getProperty(...) + + GH 321 URLName.getURL() returns incorrect url. + + GH 322 Dots in local part of emails not handled properly + + GH 323 Support loading protocol providers using ServiceLoader + + GH 326 Apply relaxed Content-Disposition parsing to + Content-Disposition params + + GH 330 Attachment filename is ignored + + GH 332 http proxy support should support authenticating to + the proxy server + + GH 333 search with Unicode char throws BadCommandException + with UTF8=ALLOW + + GH 334 gimap set labels error with some non english + characters + * Changes in the 1.6.1 release + + GH 262 Some IMAP servers send EXPUNGE responses for unknown + messages + + GH 278 BODYSTRUCTURE Parser fails on specific IMAP Server + response + + GH 283 clean up connections when closing IMAPStore + + GH 287 Allow relaxed Content-Disposition parsing + + GH 289 use a different IMAP tag prefix for each connection + + GH 291 define JDK 9 module name for JavaMail + + GH 296 HTTP proxy support needs to use HTTP/1.1 + * Changes in the 1.6.0 release + + GH 75 MimeMultipart should throw ParseException for parsing + errors + + GH 77 MimeMessage.updateHeaders should set the Date header + if not already set + + GH 93 Support addressing i18n via RFC 6530/6531/6532 + + GH 104 The UIDFolder interface should have a getter for + UIDNEXT + + GH 135 MailHandler should choose a better default subject + formatter. + + GH 159 Store, Transport, and Folder should implement + AutoCloseable + + GH 174 MailDateFormat changes for version 1.6 + + GH 183 Fix javac warnings + + GH 209 fails to parse some fetch response that has space + before final ')' + + GH 214 IMAP doesn't handle illegal CAPABILITY response after + LOGIN/AUTHENTICATE + + GH 226 MailSessionDefinition should use the Repeatable + annotation for Java EE 8 + + GH 227 IdleManager fails on Android + + GH 228 Test fails: javax.mail.internet.GetLocalAddressTest + + GH 229 Tests fail: com.sun.mail.util.WriteTimeoutSocketTest + + GH 230 MboxFolder.expunge can corrupt mailbox file + + GH 231 CompactFormatter should handle overridden + Throwable.toString methods + + GH 232 Update public API to use generics + + GH 233 Malformed IMAP FETCH response throws the wrong + exception + + GH 234 RFC822.SIZE > 2GB isn't handled + + GH 237 Protocol#command method call readResponse after + IOException is thrown + + GH 238 Possible NPE in Status. line 96 + + GH 239 MailHandler should support 'login' verify type. + + GH 240 MailHandler support for non-multipart messages + + GH 241 use of YoungerTerm/OlderTerm on server without WITHIN + support fails + + GH 244 The UIDFolder interface should have a MAXUID constant + + GH 245 java.io.IOException: No content when reading msg with + empty attachment + + GH 247 look for resource files in /conf on JDK 1.9 + + GH 248 MimeUtility should treat GB2312 as one of the + supersets GBK or GB18030 + + GH 249 Flags convenience methods + + GH 250 SMTP support for the CHUNKING extension of RFC 3030 + + GH 251 MimeUtility.unfold squashes multiple spaces + + GH 252 JavaMail PLAIN authentication should implement RFC 4616 + + GH 253 Support connecting through web proxy servers + + GH 256 support UIDPLUS UIDNOTSTICKY response code + + GH 257 SASL authentication should always allow UTF-8 username + and password + + GH 258 android-activation MANIFEST has empty + Bundle-SymbolicName + * Changes in the 1.5.6 release + The following bugs have been fixed in the 1.5.6 release. + + GH 199 Support LogRecord.setMillis being deprecated in JDK 9 + + GH 200 Logging should support LogRecord.getInstant + + GH 202 Create common super class for logging tests + + GH 205 NPE by APOP detection when no greeting banner + + GH 206 Make IMAPProtocol.handleLoginResult protected + + GH 207 InternetAddress.parse fails for valid domain literal + address + + GH 210 unsolicited FETCH response *must* invalidate + X-GM-LABELS in cache + + GH 211 MimeBodyPart.isMimeType returns false if type header + can't be parsed + + GH 213 NPE in Tomcat ClassLoader causes Session.getInstance + to fail + + GH 215 Deadlock in IMAPFolder.doProtocolCommand() + + GH 216 InternetAddress.getLocalAddress should use + InetAddress.getCanonicalHostName + + GH 217 Store finalizers should not talk to server + + GH 219 MailHandler verify should load additional content + handlers + + GH 220 NullPointerException if SASL is enabled on Android + + GH 221 write timeouts don't work with SSL on Android + + GH 222 JavaMail allows injection of unwanted headers + + GH 223 Message.setRecipient(type, null) should remove + recipients + * Changes in the 1.5.5 release + + GH 168 add support for setting GMail labels on messages + + GH 169 Add spam filter for use with MailHandler. + + GH 170 Address MailDateFormat issues + + GH 172 Typo in "mail.stmp.sendpartial" + + GH 173 mail.mime.encodefilename property should override RFC + 2231 encoding + + GH 176 IMAP should support a mail.imap.auth.mechanisms + property like SMTP + + GH 177 setting mail..auth.mechanisms should + override mail..auth..disable + + GH 178 add support for OAuth 2.0 without SASL + + GH 179 capability() command doesn't properly transform errors + + GH 180 MailHandler needs better support for stateful filters. + + GH 181 add support for IMAP login referrals (RFC 2221) + + GH 182 whitespace line at beginning confuses InternetHeaders + + GH 184 Eliminate legacy classes + + GH 185 IndexOutOfBoundsException reading IMAP literal when + connection fails + + GH 186 IdleManager dies with CancelledKeyException + + GH 187 IdleManager can deadlock when not busy + + GH 188 IMAP Folder methods throw runtime exceptions when + connection drops + + GH 189 InternetAddress doesn't detect some illegal newlines + + GH 190 Status class doesn't decode mailbox name + + GH 191 add support for IMAP COMPRESS extension (RFC 4978) + + GH 194 Empty Gmail X-GM-LABELS list is misparsed + + GH 195 IMAPMessage.getReceivedDate should check if + receivedDate is present before loading envelope + + GH 196 CollectorFormatter descending order data race + + GH 198 off-by-1 error in Response.readStringList causes early + termination of parsing FETCH response + + GH 201 INTERNALDATE FetchProfile Item + + GH 203 Exchange returns NIL instead of "" for empty + parameter, causing NPE + * Changes in the 1.5.4 release + + GH 149 Include elapsed time, thread id, and sequence for + logging formatters. + + GH 153 MailHandlerTest does not check field is static or + final + + GH 157 IdleManager can deadlock with frequent notifications + + GH 158 IdleManager can deadlock when connection fails + + GH 160 IMAP provider should support the MOVE extension (RFC 6851) + + GH 162 MODSEQ should be stored in IMAPMessage if CONDSTORE is + enabled + + GH 163 Space character lost from end of quoted-printable body + parts + + GH 164 GmailMessage extensions are not cached after implicit + FETCH + + GH 165 IMAP message sets should be sorted in cases where + order doesn't matter + + GH 166 ID command shouldn't escape NIL value + + GH 167 Make IMAPProtocol class extendable + * Changes in the 1.5.3 release + + GH 122 Make constructor of POP3Folder protected to allow + subclassing + + GH 123 calling IdleManager.watch twice on same folder fails + + GH 124 NPE in IMAPFolder.copyUIDMessages when COPYUID not + returned + + GH 127 Message-Id leaks current user/hostname of the Java + process (security) + + GH 128 IMAP idle breaks interrupt flag + + GH 129 Date search terms result in wrong greater-than SEARCH + commands for IMAP + + GH 131 address similar to (x)(z) will throw + StringIndexOutOfBoundsException + + GH 132 Update logging demos to use the new 1.5.2 features + + GH 133 Use classloader ergonomics in the MailHandler + + GH 137 ArrayIndexOutOfBoundsException in + IMAPFolder.copyUIDMessages + + GH 138 attachment filenames aren't being encoded by default + + GH 139 Include javadoc example formats for logging. + + GH 141 SharedFileInputStream has problems with 2GB+ files + + GH 143 MimeBodyPart with copied DataHandler doesn't always + set encoding + + GH 144 skip unusable Store and Transport classes + + GH 145 long parameter values should be split using RFC 2231 + + GH 146 javax.mail.Authenticator thread safety + + GH 148 Modify MailHandler to support Google App Engine. + + GH 150 EXPUNGE response during UID FETCH breaks UID->seqnum + mapping + + GH 151 ArrayIndexOutOfBoundsException caused by out-of-range + IMAP responses + + GH 154 write timeouts don't work with a custom SSL socket + factory + + GH 155 SMTP SASL DIGEST-MD5 fails on postfix since the last + reply sent is "*" + +------------------------------------------------------------------- +Wed Feb 21 10:45:55 UTC 2024 - Gus Kenion + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Fri Apr 29 12:22:31 UTC 2022 - Fridrich Strba + +- Add alias to com.sun.mail:jakarta.mail needed by ant-javamail + +------------------------------------------------------------------- +Sat Apr 9 14:24:08 UTC 2022 - Fridrich Strba + +- Remove all parents, since this package is not built with maven +- Assure that every dependency has a version, or at least "any" + * fixes use with gradle + +------------------------------------------------------------------- +Wed Mar 30 10:19:25 UTC 2022 - Fridrich Strba + +- Build against the standalone JavaEE modules unconditionally + +------------------------------------------------------------------- +Fri Mar 18 19:20:43 UTC 2022 - Fridrich Strba + +- Build with source/target levels 8 + +------------------------------------------------------------------- +Thu Mar 17 03:07:12 UTC 2022 - Fridrich Strba + +- Add glassfish-activation-api dependency for relevant distribution + versions to make buildable with JDK that does not contain the + JavaEE modules + +------------------------------------------------------------------- +Mon Apr 8 11:14:08 UTC 2019 - Fridrich Strba + +- Do not depend on the jvnet-parent pom since we are not building + with maven + +------------------------------------------------------------------- +Tue Jan 22 09:24:23 UTC 2019 - Fridrich Strba + +- Initial package of javamail 1.5.2 +- Install as maven artifacts diff --git a/javamail.spec b/javamail.spec new file mode 100644 index 0000000..d7b83a5 --- /dev/null +++ b/javamail.spec @@ -0,0 +1,145 @@ +# +# spec file for package javamail +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global git_tag JAVAMAIL-1_6_2 +Name: javamail +Version: 1.6.2 +Release: 0 +Summary: Java Mail API +License: CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +Group: Development/Libraries/Java +URL: https://www.oracle.com/technetwork/java/javamail +Source: https://github.com/javaee/javamail/archive/%{git_tag}.tar.gz +Patch0: %{name}-javadoc.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: glassfish-activation-api +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-local >= 6 +BuildRequires: perl-XML-XPath +# Adapted from the classpathx-mail (and JPackage glassfish-javamail) Provides. +Provides: javamail-monolithic = %{version}-%{release} +Provides: javax.mail +BuildArch: noarch + +%description +The JavaMail API provides a platform-independent and protocol-independent +framework to build mail and messaging applications. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +%{summary}. + +%prep +%setup -q -n %{name}-%{git_tag} +%patch -P 0 -p1 + +add_dep() { + %pom_xpath_inject pom:project "" ${2} + %pom_add_dep com.sun.mail:${1}:%{version}:provided ${2} +} + +add_dep smtp mailapi +add_dep javax.mail smtp +add_dep javax.mail pop3 +add_dep javax.mail imap +add_dep javax.mail mailapijar + +# 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 so we +# will set ${mail.osgiversion} explicitly. +%pom_remove_plugin org.glassfish.hk2:osgiversion-maven-plugin +%pom_xpath_inject /pom:project/pom:properties "%{version}" +%pom_xpath_inject /pom:project/pom:build/pom:plugins/pom:plugin/pom:configuration/pom:instructions "<_nouses>true" + +# Tests failing due to networking limitations +rm mail/src/test/java/com/sun/mail/imap/IMAPIdleUntaggedResponseTest.java +rm mail/src/test/java/com/sun/mail/smtp/SMTPWriteTimeoutTest.java + +%pom_remove_parent . + +%build +%{ant} -Djavac.source=1.8 -Djavac.target=1.8 \ + -Dactivation.jar=$(find-jar glassfish-activation-api) \ + jar jars docs + +%install +get_name() { +%if 0%{?suse_version} < 1320 + xpath ${1} '/project/artifactId/text()' 2>&1 | grep -vi node +%else + xpath -q -e '/project/artifactId/text()' ${1} +%endif +} + +# jars +install -dm 0755 %{buildroot}%{_javadir}/%{name} +install -pm 0644 target/release/mail.jar %{buildroot}%{_javadir}/%{name}/$(get_name mail/pom.xml).jar +for i in mailapi smtp imap gimap pop3 dsn; do + install -pm 0644 target/release/lib/${i}.jar %{buildroot}%{_javadir}/%{name}/$(get_name ${i}/pom.xml).jar +done +install -pm 0644 target/release/lib/mailapi.jar %{buildroot}%{_javadir}/%{name}/$(get_name mailapijar/pom.xml).jar +ln -sf javax.mail.jar %{buildroot}%{_javadir}/%{name}/mail.jar +ln -sf %{name}/javax.mail.jar %{buildroot}%{_javadir}/javax.mail.jar +install -d -m 755 %{buildroot}%{_javadir}/javax.mail/ +ln -sf ../%{name}/javax.mail.jar %{buildroot}%{_javadir}/javax.mail/ + +# poms +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} +%mvn_install_pom pom.xml %{buildroot}%{_mavenpomdir}/%{name}/$(get_name pom.xml).pom +pompart=%{name}/$(get_name pom.xml).pom +%add_maven_depmap ${pompart} +for i in mailapijar smtp imap gimap pop3 dsn; do + %mvn_install_pom ${i}/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/$(get_name ${i}/pom.xml).pom + pompart=%{name}/$(get_name ${i}/pom.xml).pom + jarpart=%{name}/$(get_name ${i}/pom.xml).jar + %add_maven_depmap ${pompart} ${jarpart} +done +%mvn_install_pom mail/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/$(get_name mail/pom.xml).pom +pompart=%{name}/$(get_name mail/pom.xml).pom +jarpart=%{name}/$(get_name mail/pom.xml).jar +%add_maven_depmap ${pompart} ${jarpart} -a javax.mail:mail,org.eclipse.jetty.orbit:javax.mail.glassfish,com.sun.mail:jakarta.mail +%mvn_install_pom mailapi/pom.xml %{buildroot}%{_mavenpomdir}/%{name}/$(get_name mailapi/pom.xml).pom +pompart=%{name}/$(get_name mailapi/pom.xml).pom +jarpart=%{name}/$(get_name mailapi/pom.xml).jar +%add_maven_depmap ${pompart} ${jarpart} -a javax.mail:mailapi + +# javadoc +mkdir -p %{buildroot}%{_javadocdir} +cp -pr target/release/docs %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%doc mail/src/main/java/overview.html +%license mail/src/main/resources/META-INF/LICENSE.txt +%{_javadir}/javax.mail +%{_javadir}/javax.mail.jar +%{_javadir}/%{name}/mail.jar + +%files javadoc +%{_javadocdir}/%{name} +%license mail/src/main/resources/META-INF/LICENSE.txt + +%changelog