git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112766 13f79535-47bb-0310-9956-ffa450edef68
104 lines
3.1 KiB
XML
104 lines
3.1 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:define="jelly:define"
|
|
xmlns:maven="jelly:maven">
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- S E L F C O N T A I N E D A R C H I V E -->
|
|
<!-- ================================================================== -->
|
|
<!-- Create a self contained archive for Unix systems which understand -->
|
|
<!-- the tar and gzip commands. -->
|
|
<!-- -->
|
|
<!-- NOTE: This is a first attempt so I'm sure some adjustments will -->
|
|
<!-- have to be made for other Unices. I only use Linux. -->
|
|
<!-- ================================================================== -->
|
|
|
|
<!--
|
|
|
|
|
| Usage:
|
|
|
|
|
| <sea:create
|
|
| sourceDirectory="/path/to/contents"
|
|
| seaName="foo"
|
|
| />
|
|
|
|
|
| This will produce a self extracting file called foo.sh in
|
|
| ${maven.build.dir} which contains the contents of ${sourceDirectory}.
|
|
|
|
|
-->
|
|
|
|
<define:taglib uri="sea">
|
|
<!--
|
|
|
|
|
| @sourceDirectory
|
|
| @seaName
|
|
| @workdir
|
|
| @notice
|
|
|
|
|
-->
|
|
<define:tag name="create">
|
|
|
|
<mkdir dir="${maven.build.dir}"/>
|
|
|
|
<tar
|
|
longfile="gnu"
|
|
tarfile="${maven.build.dir}/${seaName}.tar">
|
|
|
|
<tarfileset dir="${sourceDirectory}" mode="755">
|
|
<include name="**/*.sh"/>
|
|
</tarfileset>
|
|
<tarfileset dir="${sourceDirectory}">
|
|
<include name="**/**"/>
|
|
<exclude name="**/*.sh"/>
|
|
</tarfileset>
|
|
</tar>
|
|
|
|
<gzip
|
|
zipfile="${maven.build.dir}/${seaName}.tar.gz"
|
|
src="${maven.build.dir}/${seaName}.tar"
|
|
/>
|
|
|
|
<filter token="NOTICE" value="${pom.name} v${pom.currentVersion} - starting installation... please wait"/>
|
|
<filter token="WORK_DIR" value="${pom.artifactId}-${pom.currentVersion}"/>
|
|
|
|
<copy
|
|
file="${pom.getPluginContext('maven-sea-plugin').getVariable('plugin.resources')}/sea-header"
|
|
tofile="${maven.build.dir}/project-sea-header"
|
|
overwrite="true"
|
|
filtering="true"
|
|
/>
|
|
|
|
<!--
|
|
|
|
|
| Concatenate the sea-header with the tarball we just made.
|
|
|
|
|
-->
|
|
<maven:concat outputFile="${maven.build.dir}/${seaName}.sh">
|
|
<maven:input file="${maven.build.dir}/project-sea-header"/>
|
|
<maven:input file="${maven.build.dir}/${seaName}.tar.gz"/>
|
|
</maven:concat>
|
|
|
|
<!--
|
|
|
|
|
| Flip on the +x bit so all users have to do is run it!
|
|
|
|
|
-->
|
|
<chmod file="${maven.build.dir}/${seaName}.sh" perm="+x"/>
|
|
|
|
<!--
|
|
|
|
|
| The archive has been packaged up in a self-extracting ball
|
|
| so we don't need the originals anymore.
|
|
|
|
|
-->
|
|
<delete file="${maven.build.dir}/${seaName}.tar"/>
|
|
<delete file="${maven.build.dir}/${seaName}.tar.gz"/>
|
|
<delete file="${maven.build.dir}/project-sea-header"/>
|
|
|
|
</define:tag>
|
|
</define:taglib>
|
|
|
|
</project>
|