<!--
     This is a "makerelease" script.  The tool to load and run it can be 
     found at http://github.com/hardaker/makerelease .   To invoke it, use
     makerelease -c dist/makerelease.xml
-->
<makerelease>
  <steps>

    <step type="system" title="Setup Checck">
      <text>
	The following svn command shouldn't generate any locally
	modified files.

	The VERSION grep should show the last release version number created.
      </text>
      <commands>
	<command>git status -uno</command>
	<command>grep 'DNSSEC-Tools Version:' tools/scripts/zonesigner</command>
      </commands>
    </step>

    <step type="prompt" prompt="Enter the new version number:"
      title="Pick A Version Number"
      parameter="VERSION" values="^[\.\d]+(rc\d+|pre\d+|)$"
      />

    <step type="modify" title="Changing Version Numbers">
      <modifications>
	<modify
	  find="(DNSSEC-Tools Version:\s*) [\.0-9]+(rc\d+|pre\d+|)"
	  replace="$1 {VERSION}">
	  <files>
	    <file>tools/scripts/*</file>
	    <file>tools/demos/demo-tools/*</file>
	    <file>tools/mapper/mapper</file>
	    <file>tools/donuts/donuts</file>
	    <file>tools/drawvalmap/drawvalmap</file>
	    <file>tools/maketestzone/maketestzone</file>
	    <file>tools/dnspktflow/dnspktflow</file>
	    <file>tools/convertar/convertar</file>
	    <file>apps/nagios/dtnagobj</file>
	    <file>validator/apps/dnssec-system-tray/dnssec-system-tray.cpp</file>
	    <file>validator/apps/dnssec-nodes/graphwidget.cpp</file>
	    <file>validator/apps/dnssec-check/mainwindow.cpp</file>
	  </files>
	</modify>
	<modify
	  find='(DNSSEC_CHECK_VERSION ")[\.0-9]+(rc\d+|pre\d+|)'
	  replace='$1{VERSION}'>
	  <files>
	    <file>validator/apps/dnssec-check/DnssecCheckVersion.h</file>
	  </files>
	</modify>
	<modify
	  find='(DNSSECToolsVersion",\s*)[\.0-9]+(rc\d+|pre\d+|)'
	  replace='$1{VERSION}'>
	  <files>
	    <file>validator/apps/dnssec-check/TestManager.cpp</file>
	  </files>
	</modify>
      </modifications>
    </step>

    <step type="system" title="Check the version number changes">
      <commands>
	<command ignoreerror="1">git diff | egrep '^[-\+]'</command>
      </commands>
    </step>

    <step type="system" title="SVN Commit the changes"
    interactive="1">
      <commands>
	<command>git commit -a -m "Update Version Number: {VERSION}"</command>
      </commands>
    </step>

    <step type="section" title="Update Net::DNS::ZoneFile::Fast" interactive="1"
	  prompt="1">
      <text>
	If the Net::DNS::ZoneFile::Fast module needs updating this
	will let you do it...
      </text>
      <steps>
	<step type="system">
	  <text>Previous version:</text>
	  <commands>
	    <command>grep VERSION tools/modules/ZoneFile-Fast/Fast.pm</command>
	  </commands>
	</step>

	<step type="prompt" prompt="Enter the new Fast.pm VERSION number:"
	  title="Pick A Fast.pm Version Number"
	  parameter="FASTVERSION" values="^[\.\d]+$"/>
	
	<step type="modify" title="Modify the Fast module">
	  <modifications>
	    <modify
	      find="(VERSION = ')[\.\d]+"
	      replace="${1}{FASTVERSION}">
	      <files>
		<file>tools/modules/ZoneFile-Fast/Fast.pm</file>
	      </files>
	    </modify>
	  </modifications>
	</step>

	<step type="system" title="Check the version number changes">
	  <commands>
	    <command ignoreerror="1">git diff tools/modules/ZoneFile-Fast/Fast.pm</command>
	  </commands>
	</step>

	<step type="system" title="SVN Commit the changes" interactive="1">
	  <commands>
	    <command>git commit -m "Update Fast.pm Version Number: {FASTVERSION}" tools/modules/ZoneFile-Fast/Fast.pm</command>
	  </commands>
	</step>

	<step type="system" title="Make Test">
	  <commands>
	    <command>cd tools/modules/ZoneFile-Fast ; perl Makefile.PL</command>
	    <command>cd tools/modules/ZoneFile-Fast ; make test</command>
	  </commands>
	</step>

	<step type="system" title="make dist">
	  <commands>
	    <command>cd tools/modules/ZoneFile-Fast ; make dist</command>
	  </commands>
	</step>

	<step type="system" title="upload to cpan">
	  <commands>
	    <command>cpan-upload -mailto wjhns117@hardakers.net -user hardaker -verbose tools/modules/ZoneFile-Fast/Net-DNS-ZoneFile-Fast-{FASTVERSION}.tar.gz</command>
	  </commands>
	</step>
      </steps>
    </step>

    <step type="system" title="Create the ChangeLog">
      <commands>
	<command>git log -v > ChangeLog</command>
      </commands>
    </step>

    <step type="system" title="Commit the ChangeLog">
      <commands>
	<command>git commit -m "Update for verison {VERSION}" ChangeLog</command>
      </commands>
    </step>

    <step type="system" title="Update the NEWS file" interactive="1">
      <text>Please update the NEWS file with new details and we'll commit it</text>
      <commands>
	<command>git commit -m "Update for verison {VERSION}" NEWS</command>
      </commands>
    </step>


    <step type="system" title="git tag the release">
      <commands>
	<command>git tag -a dnssec-tools-{VERSION}</command>
      </commands>
    </step>

    <step type="system" title="export the release">
      <commands>
        <command>git clone dt-git:git.dnssec-tools.org/dnssec-tools dnssec-tools-{VERSION}</command>
        <command>rm -rf dnssec-tools-{VERSION}/.git</command>
	<command>cp -pr dnssec-tools-{VERSION}/validator dnsval-{VERSION}</command>
	<command>cp -pr dnssec-tools-{VERSION}/validator/apps/dnssec-check dnssec-check-{VERSION}</command>
	<command>cp -pr dnssec-tools-{VERSION}/validator/apps/dnssec-nodes dnssec-nodes-{VERSION}</command>
	<command>cp -pr dnssec-tools-{VERSION}/validator/apps/dnssec-system-tray dnssec-system-tray-{VERSION}</command>
	<command>cp -pr dnssec-tools-{VERSION}/validator/apps/lookup lookup-{VERSION}</command>

	<command>cp -pr dnssec-tools-{VERSION}/apps/owl-monitor owl-monitor-{VERSION}</command>

	<command>cp -pr dnssec-tools-{VERSION}/apps/owl-monitor owl-sensor-{VERSION}</command>
	<command>rm -rf owl-sensor-{VERSION}/manager</command>

	<command>cp -pr dnssec-tools-{VERSION}/apps/owl-monitor owl-manager-{VERSION}</command>
	<command>rm -rf owl-manager-{VERSION}/sensor</command>
      </commands>
    </step>

    <step type="system" title="copy in the COPYING file">
	    <commands>
		    <command>cp -p COPYING dnsval-{VERSION}</command>
		</commands>
    </step>

    <step type="system" title="create the tar file">
      <commands>
	<command>tar czf dnssec-tools-{VERSION}.tar.gz dnssec-tools-{VERSION}</command>
	<command>tar czf dnsval-{VERSION}.tar.gz dnsval-{VERSION}</command>
	<command>tar czf dnssec-nodes-{VERSION}.tar.gz dnssec-nodes-{VERSION}</command>
	<command>tar czf dnssec-check-{VERSION}.tar.gz dnssec-check-{VERSION}</command>
	<command>tar czf dnssec-system-tray-{VERSION}.tar.gz dnssec-system-tray-{VERSION}</command>
	<command>tar czf lookup-{VERSION}.tar.gz lookup-{VERSION}</command>
	<command>tar czf owl-sensor-{VERSION}.tar.gz owl-sensor-{VERSION}</command>
	<command>tar czf owl-manager-{VERSION}.tar.gz owl-manager-{VERSION}</command>
	<command>tar czf owl-monitor-{VERSION}.tar.gz owl-monitor-{VERSION}</command>
      </commands>
    </step>

    <step type="system" title="sign the files">
      <commands>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 dnssec-tools-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 dnsval-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 dnssec-nodes-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 dnssec-check-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 dnssec-system-tray-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 lookup-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 owl-sensor-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 owl-manager-{VERSION}.tar.gz</command>
	<command>gpg --use-agent -a --detach-sign -u 04B34006 owl-monitor-{VERSION}.tar.gz</command>
      </commands>
    </step>

    <step type="system" title="upload the results to the web system" interactive="1">
      <commands>
	<command>echo send the files to the server:</command>
      </commands>
    </step>

    <step type="system" title="create the html docs" interactive="1">
      <commands>
	<command>cd ../htdocs &amp;&amp; git pull</command>
	<command>dist/update-web-docs</command>
	<command>cd ../htdocs &amp;&amp; git commit -m "Updated online docs from latest release" .</command>
      </commands>
    </step>

    <step type="Informational" name="webpage" title="Change the web page News"
	  pause="1" mandatory="1">
      <text>
	Change the web page to mention version {VERSION}
      </text>
    </step>


    <step type="informational" title="Advertising">
      <text>
	Advertise like crazy (freshmeat, etc)!
      </text>
    </step>
    <step type="informational" title="Website Update">
      <text>
	Update the various aspects of the website, which includes: the
	CLI help, man pages, ...
      </text>
    </step>
    <step type="informational" title="Website Update">
      <text>
	Publish binaries
      </text>
    </step>
  </steps>
</makerelease>
