net.sf.jpkgmk
Class PkgMk

java.lang.Object
  extended by net.sf.jpkgmk.PkgMk

public class PkgMk
extends java.lang.Object

Pure java implementation of the pkgmk command. Should be a 1:1 port so that it can be used as a drop-in replacement. For the code that was ported see: pkgmk of opensolaris and pkgbuild on sourceforge

This implementation should be useful if you want to create your solaris packages regardless on which platform you are currently developing. Additionally it has the advantage that it can be used with maven/ant without the need of native platform calls.

The original solaris package providing this functionality has the name SUNWpkgcmdsu.

Some further docs about packaging can be found at creating solaris packages and solaris pkgmk tools

Since:
1.0
Version:
$Revision: 2 $ $Date: 2008-08-20 21:14:19 +0200 (Mi, 20 Aug 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Constructor Summary
PkgMk(java.io.File baseSourceDir)
           
PkgMk(java.io.File baseSourceDir, java.io.File baseTargetDir)
           
PkgMk(java.io.File baseSourceDir, java.io.File baseTargetDir, PkgInfo packageInfo, Prototype prototype)
           
PkgMk(java.io.File baseSourceDir, java.io.File baseTargetDir, java.lang.String targetFileName, PkgInfo packageInfo, Prototype prototype)
           
 
Method Summary
 void create()
          Creates the whole package
 java.io.File getGzipFile()
           
 PkgInfo getPackageInfo()
           
 boolean isOverwriteIfExists()
           
static void main(java.lang.String[] args)
          Entry point for the application
 void setOverwriteIfExists(boolean overwriteIfExists)
          Whether or not to overwrite the files in the target directory if this directory already exists
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PkgMk

public PkgMk(java.io.File baseSourceDir)
Parameters:
baseSourceDir - The base source directory for searching all required packaging files

PkgMk

public PkgMk(java.io.File baseSourceDir,
             java.io.File baseTargetDir)
Parameters:
baseSourceDir - The base source directory for searching all required packaging files
baseTargetDir - The base directory in which the whole new package should be created. Can be null

PkgMk

public PkgMk(java.io.File baseSourceDir,
             java.io.File baseTargetDir,
             PkgInfo packageInfo,
             Prototype prototype)
Parameters:
baseSourceDir - The base source directory for searching all required packaging files
baseTargetDir - The base directory in which the whole new package should be created. Can be null
packageInfo - The pkginfo object. Can be null if the file exists in the given source dir
prototype - The prototype object. Can be null if the file exists in the given source dir

PkgMk

public PkgMk(java.io.File baseSourceDir,
             java.io.File baseTargetDir,
             java.lang.String targetFileName,
             PkgInfo packageInfo,
             Prototype prototype)
Parameters:
baseSourceDir - The base source directory for searching all required packaging files
baseTargetDir - The base directory in which the whole new package should be created. Can be null
targetFileName - The name to be used for the created tar.gz file. Can be null
packageInfo - The pkginfo object. Can be null if the file exists in the given source directory
prototype - The prototype object. Can be null if the file exists in the given source directory
Method Detail

getPackageInfo

public PkgInfo getPackageInfo()
Returns:
The pkginfo object of the created package

isOverwriteIfExists

public boolean isOverwriteIfExists()

setOverwriteIfExists

public void setOverwriteIfExists(boolean overwriteIfExists)
Whether or not to overwrite the files in the target directory if this directory already exists

Parameters:
overwriteIfExists -

getGzipFile

public java.io.File getGzipFile()

create

public void create()
            throws java.io.IOException
Creates the whole package

Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

main

public static void main(java.lang.String[] args)
Entry point for the application

Parameters:
args -


Copyright © 2007-2008. All Rights Reserved.