#!/bin/bash

full_name=$(date "+%H/%M/%S/%d/%m/%Y")
releasedate=$(date "+%Y/%m/%d")
target_nbm=$1
build_number=$2
version_number=$3

file_size_kb=`du -b "$target_nbm" | cut -f1`

cat > updates.xml << EOF
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Catalog 2.6//EN" "http://www.netbeans.org/dtds/autoupdate-catalog-2_6.dtd">
<module_updates timestamp="$full_name">

<module_group name="Look &amp; Feel">

<module codenamebase="org.twopm.laf"
		distribution="$target_nbm" 
		downloadsize="$file_size_kb" 
		homepage="http://forge.2pm.tech/nb/update.xml" 
		license="AD9FBBC9" 
		moduleauthor="5inner &lt;sinner@2pm.tech&gt;" 
		needsrestart="true" 
		releasedate="$releasedate">
		<manifest AutoUpdate-Show-In-Client="true" 
				  OpenIDE-Module="org.twopm.laf/1"
				  OpenIDE-Module-Display-Category="Base IDE" 
				  OpenIDE-Module-Implementation-Version="$build_number" 
				  OpenIDE-Module-Java-Dependencies="Java &gt; 1.6" 
				  OpenIDE-Module-Long-Description="This plugin was designed only to compose well readable and enoght radk theme for Netbeans, But day by day it was enlarging - and now it is what it is." 
				  OpenIDE-Module-Module-Dependencies="org.netbeans.modules.settings/1 &gt; 1.45.1, org.netbeans.swing.plaf &gt; 1.37.1, org.netbeans.swing.tabcontrol &gt; 1.51.1, org.openide.awt &gt; 7.62.1, org.openide.explorer &gt; 6.57.1, org.openide.modules &gt; 7.43.1, org.openide.util &gt; 8.39.1, org.openide.util.lookup &gt; 8.25.1, org.openide.windows &gt; 6.71.1" 
				  OpenIDE-Module-Name="2pm.look" 
				  OpenIDE-Module-Requires="org.openide.windows.WindowManager, org.openide.modules.ModuleFormat1" 
				  OpenIDE-Module-Short-Description="Editor for Netbeans Metal Look and Feel" 
				  OpenIDE-Module-Specification-Version="$version_number"/>  
</module>
   
</module_group>

<license name="AD9FBBC9" url="licenses/AD9FBBC9.license"/>
</module_updates>		
		
EOF
