#!/bin/bash

mkdir -p ../../dists/dev/2.11.0.M5-rc2/binaries/portable
mkdir -p ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
mkdir -p ../../dists/dev/2.11.0.M5-rc2/source
mkdir -p ../../dists/dev/2.11.0.M5-rc2/wikipages
find ./jspwiki-wikipages -name "jspwiki-wikipages-*-2.11.0.M5.zip" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/wikipages \;
find ./jspwiki-wikipages -name "jspwiki-wikipages-*-2.11.0.M5.zip.asc" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/wikipages \;
find ./jspwiki-wikipages -name "jspwiki-wikipages-*-2.11.0.M5.zip.sha512" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/wikipages \;
find . -name "jspwiki-*-2.11.0.M5.jar" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5.jar.asc" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5.jar.sha512" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-javadoc.jar" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-javadoc.jar.asc" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-javadoc.jar.sha512" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-sources.jar" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-sources.jar.asc" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-sources.jar.sha512" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-tests.jar" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-tests.jar.asc" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find . -name "jspwiki-*-2.11.0.M5-tests.jar.sha512" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/webapp \;
find ./jspwiki-portable/target -name "jspwiki-portable-2.11.0.M5-woas*" -exec cp {} ../../dists/dev/2.11.0.M5-rc2/binaries/portable \;
find ../../dists/dev/2.11.0.M5-rc2/binaries/portable -name "*asc.sha512" -exec rm {} \;
find ../../dists/dev/2.11.0.M5-rc2/binaries/webapp -name "jspwiki-wikipages-*" -exec rm {} \;
cp ./target/jspwiki-builder-2.11.0.M5-source-release.zip ../../dists/dev/2.11.0.M5-rc2/source
cp ./target/jspwiki-builder-2.11.0.M5-source-release.zip.asc ../../dists/dev/2.11.0.M5-rc2/source
cp ./target/jspwiki-builder-2.11.0.M5-source-release.zip.sha512 ../../dists/dev/2.11.0.M5-rc2/source
cp ./jspwiki-war/target/JSPWiki.war ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
cp ./jspwiki-war/target/JSPWiki.war.asc ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
cp ./jspwiki-war/target/JSPWiki.war.sha512 ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
cp ./jspwiki-war/target/JSPWiki-sources.jar ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
cp ./jspwiki-war/target/JSPWiki-sources.jar.asc ../../dists/dev/2.11.0.M5-rc2/binaries/webapp
cp ./jspwiki-war/target/JSPWiki-sources.jar.sha512 ../../dists/dev/2.11.0.M5-rc2/binaries/webapp