ApproveBlazeDS.xml: updated approval script
diff --git a/ApproveBlazeDS.xml b/ApproveBlazeDS.xml
index b11276f..b7c16d3 100644
--- a/ApproveBlazeDS.xml
+++ b/ApproveBlazeDS.xml
@@ -52,10 +52,12 @@
     </condition>
     <property name="package.suffix" value="tar.gz"/>
 
-    <property name="rat.report" value="${basedir}/rat-report.txt"/>
-    <property name="apache.rat.jar" value="apache-rat-0.8.jar"/>
-    <property name="apache.rat.tasks.jar" value="apache-rat-tasks-0.8.jar"/>
-    <property name="apache.rat.url" value="http://people.apache.org/~aharui/rat"/>
+    <property name="src.rat.report" value="${basedir}/rat-report-src.txt"/>
+    <property name="bin.rat.report" value="${basedir}/rat-report-bin.txt"/>
+    <property name="apache.rat.jar" value="apache-rat-0.11.jar" />
+    <property name="apache.rat.tasks.jar" value="apache-rat-tasks-0.11.jar" />
+    <property name="apache.rat.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat/0.11" />
+    <property name="apache.rat.tasks.url" value="https://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat-tasks/0.11" />
 
     <property name="mac.text.display" value="cat"/>
     <property name="win.text.display" value="type"/>
@@ -65,6 +67,11 @@
     <property environment="env"/>
 
     <property name="build.target" value="main"/>
+    
+    <condition property="mvn" value="mvn.cmd">
+        <isset property="isWindows" />
+    </condition>
+    <property name="mvn" value="mvn" />
 
     <condition property="do.copy.downloads">
         <isset property="download.cache.dir"/>
@@ -73,20 +80,6 @@
     <fail message="The ANT_HOME environment variable is not set."
           unless="env.ANT_HOME"/>
 
-    <available file="${env.FLEX_HOME}"
-               type="dir"
-               property="FLEX_HOME" value="${env.FLEX_HOME}"/>
-
-    <fail message="The FLEX_HOME property is not set in environment or command-line."
-          unless="FLEX_HOME"/>
-
-    <available file="${env.AIR_HOME}"
-               type="dir"
-               property="AIR_HOME" value="${env.AIR_HOME}"/>
-
-    <fail message="The AIR_HOME property is not set in environment or command-line."
-          unless="AIR_HOME"/>
-
     <available file="${env.ANT_HOME}/lib/${apache.rat.jar}"
                type="file"
                property="apache.rat.found"/>
@@ -97,13 +90,13 @@
     <fail message="The release version is not set.  Specify -Drelease.version=&lt;release version (e.g. 3.1, 3.2, etc)&gt;"
           unless="release.version"/>
 
-    <fail message="The folder number is not set.  Specify -Dfolder.number=&lt;folder number (e.g. 1001, 1002, etc)&gt;"
-          unless="folder.number"/>
+    <fail message="The rc is not set.  Specify -Drc=&lt;release candidate number (e.g. 1, 2, etc)&gt;"
+          unless="rc"/>
 
-    <property name="package.url.base"
-              value="://repository.apache.org/content/repositories/orgapacheflex-${folder.number}/org/apache/flex/blazeds"/>
-    <property name="package.url.path" value="https${package.url.base}/blazeds/${release.version}"/>
+    <property name="package.url.path" value="https://dist.apache.org/repos/dist/dev/flex/BlazeDS/${release.version}/rc${rc}"/>
     <property name="package.url.name" value="blazeds-${release.version}-source-release"/>
+    <property name="bin.package.url.path" value="${package.url.path}/binaries" />
+    <property name="bin.package.url.name" value="blazeds-${release.version}-binary-release" />
 
     <condition property="zip.compressed">
         <equals arg1="zip" arg2="${package.suffix}"/>
@@ -141,7 +134,7 @@
         <get src="${apache.rat.url}/${apache.rat.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.jar}"/>
     </target>
     <target name="install-rat.tasks.jar" unless="apache.rat.tasks.found">
-        <get src="${apache.rat.url}/${apache.rat.tasks.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}"/>
+        <get src="${apache.rat.tasks.url}/${apache.rat.tasks.jar}" dest="${env.ANT_HOME}/lib/${apache.rat.tasks.jar}"/>
     </target>
 
     <target name="rat-taskdef" description="Rat taskdef">
@@ -151,20 +144,15 @@
     </target>
 
     <target name="main"
-            depends="install-rat,download,check-sigs,uncompress,rat-check,check-notices,binaries,build,approve"
+            depends="write-out-jars-list,install-rat,download,check-sigs,uncompress,rat-check,binary-rat,check-notices,examine-jars,build,approve"
             description="Perform required release approval steps">
     </target>
 
     <target name="main-no-download"
-            depends="install-rat,check-sigs,uncompress,rat-check,check-notices,binaries,build,approve"
+            depends="write-out-jars-list,install-rat,uncompress,rat-check,binary-rat,check-notices,examine-jars,build,approve"
             description="Perform required release approval steps">
     </target>
 
-    <target name="test">
-        <echo>${rat.report}.bin.txt</echo>
-        <replaceregexp file="${rat.report}.bin.txt" match="..AL.*" replace="" byline="true"/>
-    </target>
-
     <target name="display-text">
         <antcall target="display-text-mac"/>
         <antcall target="display-text-win"/>
@@ -177,32 +165,44 @@
         </antcall>
     </target>
 
-    <target name="download" depends="download-asc" description="download the release package">
+    <target name="download" depends="download-sigs" description="download the release package">
         <get src="${package.url.path}/${package.url.name}.${package.suffix}"
              dest="${basedir}/${package.url.name}.${package.suffix}"/>
-        <get src="${package.url.path}/${package.url.name}.${package.suffix}.md5"
-             dest="${basedir}/${package.url.name}.${package.suffix}.md5"/>
+        <get src="${bin.package.url.path}/${bin.package.url.name}.${package.suffix}"
+             dest="${basedir}/${bin.package.url.name}.${package.suffix}"/>
     </target>
 
-    <target name="download-asc" unless="no.asc" description="download the release package">
+    <target name="download-sigs" unless="no.sigs" description="download the release package signatures">
         <get src="${package.url.path}/${package.url.name}.${package.suffix}.asc"
              dest="${basedir}/${package.url.name}.${package.suffix}.asc"/>
+        <get src="${package.url.path}/${package.url.name}.${package.suffix}.sha512"
+             dest="${basedir}/${package.url.name}.${package.suffix}.sha512"/>
+        <get src="${bin.package.url.path}/${bin.package.url.name}.${package.suffix}.asc"
+             dest="${basedir}/${bin.package.url.name}.${package.suffix}.asc"/>
+        <get src="${bin.package.url.path}/${bin.package.url.name}.${package.suffix}.sha512"
+             dest="${basedir}/${bin.package.url.name}.${package.suffix}.sha512"/>
     </target>
 
-    <target name="check-md5" description="check md5">
-        <echo message="Checking MD5..."/>
-        <replace file="${basedir}/${package.url.name}.${package.suffix}.md5"
-                 token=" "/>
-        <checksum file="${basedir}/${package.url.name}.${package.suffix}" algorithm="md5" verifyproperty="md5.ok"/>
-        <condition property="MD5Invalid">
+    <target name="check-sigs" unless="no.sigs" description="check sha512 and gpg signatures">
+
+        <replace file="${basedir}/${package.url.name}.${package.suffix}.sha512"
+            token=" " />
+        <checksum file="${basedir}/${package.url.name}.${package.suffix}" algorithm="SHA-512" verifyproperty="SHA-512.ok" fileext=".sha512"/>
+        <condition property="SHA-512Invalid">
             <not>
-                <equals arg1="${md5.ok}" arg2="true"/>
+                <equals arg1="${SHA-512.ok}" arg2="true" />
             </not>
         </condition>
-        <fail message="MD5 checksum did not match" if="MD5Invalid"/>
-    </target>
-
-    <target name="check-sigs" depends="check-md5" unless="no.asc" description="check md5 and gpg sigs">
+        <fail message="SHA-512 checksum did not match" if="SHA-512Invalid" />
+        <replace file="${basedir}/${bin.package.url.name}.${package.suffix}.sha512"
+        token=" " />
+        <checksum file="${basedir}/${bin.package.url.name}.${package.suffix}" algorithm="SHA-512" verifyproperty="bin.SHA-512.ok" fileext=".sha512"/>
+        <condition property="BinarySHA-512Invalid">
+            <not>
+                <equals arg1="${bin.SHA-512.ok}" arg2="true" />
+            </not>
+        </condition>
+        <fail message="Binary Package SHA-512 checksum did not match" if="BinarySHA-512Invalid" />
         <exec executable="gpg" failonerror="true">
             <arg value="--verify"/>
             <arg value="${basedir}/${package.url.name}.${package.suffix}.asc"/>
@@ -215,59 +215,37 @@
 
     <target name="pre-clean" description="remove old uncompressed package">
         <delete dir="${basedir}/${package.url.name}" failonerror="false"/>
+        <delete dir="${basedir}/${bin.package.url.name}" failonerror="false"/>
     </target>
 
     <target name="untar-file" unless="zip.compressed" description="Untars zipFile">
         <untar src="${basedir}/${package.url.name}.${package.suffix}"
                dest="${basedir}/${package.url.name}" compression="gzip"/>
+        <untar src="${basedir}/${bin.package.url.name}.${package.suffix}"
+               dest="${basedir}/${bin.package.url.name}" compression="gzip"/>
     </target>
 
     <target name="unzip-file" if="zip.compressed" description="Unzips zipFile">
         <unzip src="${basedir}/${package.url.name}.${package.suffix}"
                dest="${basedir}/${package.url.name}"/>
+        <unzip src="${basedir}/${bin.package.url.name}.${package.suffix}"
+               dest="${basedir}/${bin.package.url.name}"/>
     </target>
-
-    <target name="binaries" if="isMac">
-        <get src="http${package.url.base}/"
-             dest="${basedir}/folderlist.txt"/>
-        <!-- remove everything up to 'Parent Directory' -->
-        <replaceregexp file="${basedir}/folderlist.txt" match=".*Parent Directory" replace=""
-                       flags="s" byline="false"/>
-        <!-- remove everything except the text after an href -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="(.*)href=(.*)&gt;(.*)&lt;/a" replace="\3"
-                       flags="g" byline="false"/>
-        <!-- remove everything inside single line td's -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="&lt;td.*&lt;/td&gt;" replace=""
-                       flags="g" byline="false"/>
-        <!-- remove everything all other html tags -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="&lt;.*&gt;" replace=""
-                       flags="g" byline="false"/>
-        <!-- remove everything up to &nbsp; -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="&amp;nbsp;" replace=""
-                       flags="g" byline="false"/>
-        <!-- remove all whitespace -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="\s" replace=""
-                       flags="g" byline="false"/>
-        <!-- remove blazeds folder -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="blazeds/&gt;" replace=""
-                       flags="g" byline="false"/>
-        <!-- remove opt folder -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="flex-messaging-opt/&gt;" replace=""
-                       flags="g" byline="false"/>
-        <!-- replace trailing /> with commas -->
-        <replaceregexp file="${basedir}/folderlist.txt" match="/&gt;" replace=","
-                       flags="g" byline="false"/>
-        <!-- remove trailing comma -->
-        <replaceregexp file="${basedir}/folderlist.txt" match=",$" replace=""
-                       flags="m" byline="false"/>
-
-        <antcall target="examine-jars"/>
+    
+    <target name="write-out-jars-list" >
+        <delete file="jars.txt" />
+        <!-- this is a comma-delimited, no spaces, no-line-breaks list used to decide which jars
+         to skip in the rat-check of the binaries and which jars to examine before approval -->
+        <property name="jars-list" value="lib/flex-messaging-common-${release.version}.jar,lib/flex-messaging-core-${release.version}.jar,lib/flex-messaging-opt-tomcat-base-${release.version}.jar,lib/flex-messaging-proxy-${release.version}.jar,lib/flex-messaging-remoting-${release.version}.jar"/>
+        <echo file="${basedir}/jars.txt" message="${jars-list}"/>
+        <echo file="${basedir}/jarexcludes.txt" message="${jars-list}"/>
+        <replaceregexp file="${basedir}/jarexcludes.txt" match="," flags="g" replace="${line.separator}" />
     </target>
 
     <!-- how to do tar and sort on Windows? -->
     <target name="examine-jars" if="isMac">
         <!-- comma delimited list, no spaces, not one file per line -->
-        <copy file="folderlist.txt" tofile="loop.txt"/>
+        <copy file="jars.txt" tofile="loop.txt"/>
         <ant antfile="ApproveBlazeDS.xml" target="loopOnce" inheritAll="false"/>
     </target>
     <target name="loopOnce">
@@ -300,87 +278,65 @@
     </target>
 
     <target name="jar-check">
-        <delete dir="${basedir}/jar" failonerror="false"/>
-        <delete dir="${basedir}/${thisFile}.jar" failonerror="false"/>
-        <mkdir dir="${basedir}/jar"/>
-        <get src="https${package.url.base}/${thisFile}/${release.version}/${thisFile}-${release.version}.jar"
-             dest="${basedir}/${thisFile}.jar"/>
-        <get src="https${package.url.base}/${thisFile}/${release.version}/${thisFile}-${release.version}.jar.asc"
-             dest="${basedir}/${thisFile}.jar.asc"/>
-        <get src="https${package.url.base}/${thisFile}/${release.version}/${thisFile}-${release.version}.jar.md5"
-             dest="${basedir}/${thisFile}.jar.md5"/>
-        <echo message="Checking MD5..."/>
-        <replace file="${basedir}/${thisFile}.jar.md5"
-                 token=" "/>
-        <checksum file="${basedir}/${thisFile}.jar" algorithm="md5" verifyproperty="jar.md5.ok"/>
-        <condition property="JARMD5Invalid">
-            <not>
-                <equals arg1="${jar.md5.ok}" arg2="true"/>
-            </not>
-        </condition>
-        <fail message="MD5 checksum did not match" if="JARMD5Invalid"/>
-        <exec executable="gpg" failonerror="true">
-            <arg value="--verify"/>
-            <arg value="${basedir}/${thisFile}.jar.asc"/>
-            <arg value="${basedir}/${thisFile}.jar"/>
-        </exec>
-        <unjar src="${basedir}/${thisFile}.jar" dest="${basedir}/jar"/>
+        <delete dir="${basedir}/jar" failonerror="false" />
+        <mkdir dir="${basedir}/jar" />
+        <unjar src="${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile}" dest="${basedir}/jar" />
         <exec executable="tar" output="${basedir}/jarclasses.txt">
-            <arg value="tf"/>
-            <arg value="${basedir}/${thisFile}.jar"/>
+            <arg value="tf" />
+            <arg value="${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile}" />
         </exec>
         <replaceregexp file="${basedir}/jarclasses.txt" match="(.*)/(.*)" replace="\1" flags="m" byline="true"/>
         <exec executable="sort" output="${basedir}/jarpaths.txt">
-            <arg value="-u"/>
-            <arg value="${basedir}/jarclasses.txt"/>
+            <arg value="-u" />
+            <arg value="${basedir}/jarclasses.txt" />
         </exec>
-        <antcall target="display-text">
-            <param name="file" value="${basedir}/jarpaths.txt"/>
+        <antcall target="display-text" >
+            <param name="file" value="${basedir}/jarpaths.txt" />
         </antcall>
         <input
-                message="Above is the list of folders in this ${thisFile}.&#xA;Folder names can sometimes indicate presence of third-party content that needs to be in LICENSE and/or NOTICE files.&#xA;Press the Enter key to see the LICENSE for this jar."/>
-
-        <fail message="LICENSE not in ${basedir}/${thisFile}.jar">
+        message="Above is the list of folders in this ${thisFile}.&#xA;Folder names can sometimes indicate presence of third-party content that needs to be in LICENSE and/or NOTICE files.&#xA;Press the Enter key to see the LICENSE for this jar."/>
+        
+        <fail message="LICENSE not in ${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile}">
             <condition>
                 <not>
-                    <available file="${basedir}/jar/META-INF/LICENSE"/>
+                    <available file="${basedir}/jar/META-INF/LICENSE" />
                 </not>
             </condition>
         </fail>
-        <fail message="NOTICE not in ${basedir}/${thisFile}.jar">
+        <fail message="NOTICE not in ${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile}">
             <condition>
                 <not>
-                    <available file="${basedir}/jar/META-INF/NOTICE"/>
+                    <available file="${basedir}/jar/META-INF/NOTICE" />
                 </not>
             </condition>
         </fail>
-        <antcall target="display-text">
-            <param name="file" value="${basedir}/jar/META-INF/LICENSE"/>
+        <antcall target="display-text" >
+            <param name="file" value="${basedir}/jar/META-INF/LICENSE" />
         </antcall>
         <input
-                message="Check the LICENSE for the Apache License and third-party licenses. Is it ok?"
-                validargs="y,n"
-                defaultvalue="y"
-                addproperty="jar.license.ok"/>
-        <fail message="LICENSE for ${basedir}/${thisFile}.jar not correct">
+        message="Check the LICENSE for the Apache License and third-party licenses. Is it ok?"
+        validargs="y,n"
+        defaultvalue="y"
+        addproperty="jar.license.ok"/>
+        <fail message="LICENSE for ${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile} not correct">
             <condition>
                 <not>
-                    <equals arg1="${jar.license.ok}" arg2="y"/>
+                    <equals arg1="${jar.license.ok}" arg2="y" />
                 </not>
             </condition>
         </fail>
-        <antcall target="display-text">
-            <param name="file" value="${basedir}/jar/META-INF/NOTICE"/>
+        <antcall target="display-text" >
+            <param name="file" value="${basedir}/jar/META-INF/NOTICE" />
         </antcall>
         <input
-                message="Check the NOTICE for required notices from third-parties. Is it ok?"
-                validargs="y,n"
-                defaultvalue="y"
-                addproperty="jar.notice.ok"/>
-        <fail message="NOTICE for ${basedir}/${thisFile}.jar not correct">
+        message="Check the NOTICE for required notices from third-parties. Is it ok?"
+        validargs="y,n"
+        defaultvalue="y"
+        addproperty="jar.notice.ok"/>
+        <fail message="NOTICE for ${basedir}/${bin.package.url.name}/blazeds-${release.version}/${thisFile} not correct">
             <condition>
                 <not>
-                    <equals arg1="${jar.notice.ok}" arg2="y"/>
+                    <equals arg1="${jar.notice.ok}" arg2="y" />
                 </not>
             </condition>
         </fail>
@@ -389,11 +345,13 @@
 
     <target name="rat-check">
 
-        <echo message="Checking files at ${basedir}/${package.url.name}, report is ${rat.report}"/>
+        <echo message="Checking files at ${basedir}/${package.url.name}, report is ${src.rat.report}"/>
 
         <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
-                    reportFile="${rat.report}">
+                    reportFile="${src.rat.report}">
             <fileset dir="${basedir}/${package.url.name}">
+                <!--          JSON doesn't really have a comment format     -->
+                <exclude name="**/*.json"/>
                 <!-- exclude media (png, gif, jpg, mp3, flv) -->
                 <exclude name="**/*.png"/>
                 <exclude name="**/*.gif"/>
@@ -405,10 +363,11 @@
                 <exclude name="**/DoNotDeleteUntilFile.txt"/>
                 <exclude name="CONTRIBUTORS"/>
                 <exclude name="CONTRIBUTING"/>
+                <exclude name="**/README.*"/>
             </fileset>
         </rat:report>
         <antcall target="display-text">
-            <param name="file" value="${rat.report}"/>
+            <param name="file" value="${src.rat.report}"/>
         </antcall>
         <input
                 message="Check that there are no unknown or unapproved licenses or archives. Is it ok?"
@@ -416,11 +375,11 @@
                 defaultvalue="y"
                 addproperty="rat.license.ok"/>
         <echo>filtering out AL files to make it easier to see binary files</echo>
-        <copy file="${rat.report}" tofile="${rat.report}.bin.txt"/>
-        <replaceregexp file="${rat.report}.bin.txt" match="..AL.*" replace="__AL" byline="true"/>
-        <replaceregexp file="${rat.report}.bin.txt" flags="gs" match="__AL." replace="" byline="false"/>
+        <copy file="${src.rat.report}" tofile="${src.rat.report}.bin.txt"/>
+        <replaceregexp file="${src.rat.report}.bin.txt" match="..AL.*" replace="__AL" byline="true"/>
+        <replaceregexp file="${src.rat.report}.bin.txt" flags="gs" match="__AL." replace="" byline="false"/>
         <antcall target="display-text">
-            <param name="file" value="${rat.report}.bin.txt"/>
+            <param name="file" value="${src.rat.report}.bin.txt"/>
         </antcall>
         <input
                 message="Check that there are no unexpected binaries.  Is it ok?"
@@ -429,6 +388,51 @@
                 addproperty="rat.binaries.ok"/>
     </target>
 
+    <target name="binary-rat">
+
+        <echo message="Checking files at ${basedir}/${bin.package.url.name}, report is ${bin.rat.report}"/>
+        <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"
+            reportFile="${bin.rat.report}">
+            <fileset dir="${basedir}/${bin.package.url.name}">
+                <!--          JSON doesn't really have a comment format     -->
+                <exclude name="**/*.json"/>
+                <!-- exclude media (png, gif, jpg, mp3, flv) -->
+                <exclude name="**/*.png"/>
+                <exclude name="**/*.gif"/>
+                <exclude name="**/*.jpg"/>
+                <exclude name="**/*.mp3"/>
+                <exclude name="**/*.flv"/>
+                <exclude name="installer/build.number"/>
+                <exclude name="**/swfobject.js"/>
+                <exclude name="**/DoNotDeleteUntilFile.txt"/>
+                <exclude name="CONTRIBUTORS"/>
+                <exclude name="CONTRIBUTING"/>
+                <exclude name="**/README.*"/>
+            </fileset>
+        </rat:report>
+        <antcall target="display-text">
+            <param name="file" value="${bin.rat.report}"/>
+        </antcall>
+        <input
+            message="Check that there are no unknown or unapproved licenses or archives. Is it ok?"
+            validargs="y,n"
+            defaultvalue="y"
+            addproperty="rat.bin.license.ok"/>
+        <echo>filtering out AL files to make it easier to see binary files</echo>
+        <copy file="${bin.rat.report}" tofile="${bin.rat.report}.bin.txt" />
+        <replaceregexp file="${bin.rat.report}.bin.txt" match="..AL.*" replace="__AL" byline="true"/>
+        <replaceregexp file="${bin.rat.report}.bin.txt" flags="gs" match="__AL." replace="" byline="false"/>
+        <antcall target="display-text" >
+            <param name="file" value="${bin.rat.report}.bin.txt" />
+        </antcall>
+        <input
+            message="Check that there are no unexpected binaries.  Is it ok?"
+            validargs="y,n"
+            defaultvalue="n"
+            addproperty="rat.bin.binaries.ok"/>
+
+    </target>
+
     <target name="check-notices" description="open each notice file for review, grep for a few things">
         <fail message="README not in package">
             <condition>
@@ -493,6 +497,72 @@
                 validargs="y,n"
                 defaultvalue="y"
                 addproperty="license.ok"/>
+
+        <!-- binary -->
+
+        <fail message="README not in package">
+            <condition>
+                <not>
+                    <available file="${basedir}/${bin.package.url.name}/blazeds-${release.version}/README"/>
+                </not>
+            </condition>
+        </fail>
+        <fail message="RELEASE_NOTES not in package">
+            <condition>
+                <not>
+                    <available file="${basedir}/${bin.package.url.name}/blazeds-${release.version}/RELEASE_NOTES"/>
+                </not>
+            </condition>
+        </fail>
+        <fail message="NOTICE not in package">
+            <condition>
+                <not>
+                    <available file="${basedir}/${bin.package.url.name}/blazeds-${release.version}/NOTICE"/>
+                </not>
+            </condition>
+        </fail>
+        <fail message="LICENSE not in package">
+            <condition>
+                <not>
+                    <available file="${basedir}/${bin.package.url.name}/blazeds-${release.version}/LICENSE"/>
+                </not>
+            </condition>
+        </fail>
+        <antcall target="display-text">
+            <param name="file" value="${basedir}/${bin.package.url.name}/blazeds-${release.version}/README"/>
+        </antcall>
+        <input
+                message="Check the README for version numbers, spelling, grammar, accuracy.  Is it ok?"
+                validargs="y,n"
+                defaultvalue="y"
+                addproperty="bin.readme.ok"/>
+
+        <antcall target="display-text">
+            <param name="file" value="${basedir}/${bin.package.url.name}/blazeds-${release.version}/RELEASE_NOTES"/>
+        </antcall>
+        <input
+                message="Check the RELEASE_NOTES for copyright years, spelling, grammar, accuracy. Is it ok?"
+                validargs="y,n"
+                defaultvalue="y"
+                addproperty="bin.releasenotes.ok"/>
+
+        <antcall target="display-text">
+            <param name="file" value="${basedir}/${bin.package.url.name}/blazeds-${release.version}/NOTICE"/>
+        </antcall>
+        <input
+                message="Check the NOTICE for required notices from third-parties. Is it ok?"
+                validargs="y,n"
+                defaultvalue="y"
+                addproperty="bin.notice.ok"/>
+
+        <antcall target="display-text">
+            <param name="file" value="${basedir}/${bin.package.url.name}/blazeds-${release.version}/LICENSE"/>
+        </antcall>
+        <input
+                message="Check the LICENSE for the Apache License and third-party licenses. Is it ok?"
+                validargs="y,n"
+                defaultvalue="y"
+                addproperty="bin.license.ok"/>
     </target>
 
     <target name="build" depends="copy.downloads">
@@ -500,8 +570,25 @@
                 message="The final step is to run the build and any tests the build script runs.  This can take several minutes.  Press y to start the build."
                 validargs="y"
                 defaultvalue="y"/>
-        <exec dir="${basedir}/${package.url.name}/blazeds-${release.version}" executable="mvn">
+        <antcall target="build-windows"/>
+        <antcall target="build-unix"/>
+    </target>
+
+    <target name="build-windows" if="isWindows">
+        <exec executable="cmd.exe" dir="${basedir}/${package.url.name}/blazeds-${release.version}" failonerror="true">
+            <arg value="/C"/>
+            <arg value="${mvn}"/>
+            <arg value="clean"/>
             <arg value="install"/>
+            <arg value="-Pwith-owasp,with-samples,with-distribution"/>
+        </exec>
+    </target>
+
+    <target name="build-unix" unless="isWindows">
+        <exec executable="${mvn}" dir="${basedir}/${package.url.name}/blazeds-${release.version}" failonerror="true">
+            <arg value="clean"/>
+            <arg value="install"/>
+            <arg value="-Pwith-owasp,with-samples,with-distribution"/>
         </exec>
     </target>
 
@@ -518,37 +605,51 @@
             <and>
                 <equals arg1="${rat.license.ok}" arg2="y"/>
                 <equals arg1="${rat.binaries.ok}" arg2="y"/>
+                <equals arg1="${rat.bin.license.ok}" arg2="y"/>
+                <equals arg1="${rat.bin.binaries.ok}" arg2="y"/>
                 <equals arg1="${readme.ok}" arg2="y"/>
                 <equals arg1="${releasenotes.ok}" arg2="y"/>
                 <equals arg1="${notice.ok}" arg2="y"/>
                 <equals arg1="${license.ok}" arg2="y"/>
+                <equals arg1="${bin.readme.ok}" arg2="y"/>
+                <equals arg1="${bin.releasenotes.ok}" arg2="y"/>
+                <equals arg1="${bin.notice.ok}" arg2="y"/>
+                <equals arg1="${bin.license.ok}" arg2="y"/>
             </and>
         </condition>
         <property name="vote" value="-1"/>
         <echo>
-            ${vote}
-            Package ${package.url.path}/${package.url.name}.${package.suffix}
-            Java ${ant.java.version}
-            OS: ${os.name} ${os.arch} ${os.version}
-            Source kit signatures match: y
-            Source kit builds: y
-            README is ok: ${readme.ok}
-            RELEASE_NOTES is ok: ${releasenotes.ok}
-            NOTICE is ok: ${notice.ok}
-            LICENSE is ok: ${license.ok}
-            No unapproved licenses or files in jars: y
-            No unapproved licenses or archives: ${rat.license.ok}
-            No unapproved binaries: ${rat.binaries.ok}
+${vote}
+Package ${package.url.path}/${package.url.name}.${package.suffix}
+Java ${ant.java.version}
+OS: ${os.name} ${os.arch} ${os.version}
+Source kit signatures match: y
+Source kit builds: y
+README is ok: ${readme.ok}
+RELEASE_NOTES is ok: ${releasenotes.ok}
+NOTICE is ok: ${notice.ok}
+LICENSE is ok: ${license.ok}
+No unapproved licenses or archives: ${rat.license.ok}
+No unapproved binaries: ${rat.binaries.ok}
+
+Package ${bin.package.url.path}/${bin.package.url.name}.${package.suffix}
+Binary kit signatures match: y
+README is ok: ${bin.readme.ok}
+RELEASE_NOTES is ok: ${bin.releasenotes.ok}
+NOTICE is ok: ${bin.notice.ok}
+LICENSE is ok: ${bin.license.ok}
+No unapproved licenses or archives in binary package: ${rat.bin.license.ok}
+No unapproved binaries in binary package: ${rat.bin.binaries.ok}
         </echo>
         <fail>
             <condition>
                 <equals arg1="-1" arg2="${vote}"/>
             </condition>
         </fail>
-        <antcall target="no-asc"/>
+        <antcall target="no-sigs"/>
     </target>
 
-    <target name="no-asc" if="no.asc">
-        <echo>PGP signature not checked</echo>
+    <target name="no-sigs" if="no.sigs">
+        <echo>PGP and sha512 signatures not checked</echo>
     </target>
 </project>