public class DebianPackageBuilderImpl extends Object implements DebianPackageBuilder, DebianPackageConstants
A DebianPackageBuilder
implementation.
CONFFILES_ENTRY, CONFIG_ENTRY, CONTROL_ENTRY, CONTROL_NAME, CONTROL_TAR_PREFIX, DATA_NAME, DATA_TAR_PREFIX, DEBIAN_BINARY, DIRECTORY_MODE, DOC_BASE_PATH, FILE_MODE, MD5SUMS_ENTRY, POSTINST_ENTRY, POSTRM_ENTRY, PREINST_ENTRY, PRERM_ENTRY, ROOT_GROUP_ID, ROOT_GROUP_NAME, ROOT_USER_ID, ROOT_USER_NAME, SCRIPT_MODE, SHLIBS_ENTRY, SYMBOLS_ENTRY, TAR_BZIP2_SUFFIX, TAR_GZIP_SUFFIX, TAR_XZ_SUFFIX, TEMPLATES_ENTRY, TRIGGERS_ENTRY, USR_PATH, USR_SHARE_PATH
UTF_8, UTF_8_CHARSET
Modifier | Constructor and Description |
---|---|
protected |
DebianPackageBuilderImpl(Script defaultPreInstall,
Script defaultPostInstall,
Script defaultPreRemove,
Script defaultPostRemove)
Creates a builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataDirectory(String path)
Adds a directory to the data of the package.
|
void |
addDataDirectory(String path,
FileOwner owner,
FileMode mode)
Adds a directory to the data of the package.
|
void |
addDataFile(DataSource source,
String path)
Adds a file to the data of the package.
|
void |
addDataFile(DataSource source,
String path,
FileOwner owner,
FileMode mode)
Adds a file to the data of the package.
|
void |
addDataSymLink(String path,
String target,
FileOwner owner,
FileMode mode)
Adds a symbolic link to the data of the package.
|
void |
buildDebianPackage(DataTarget target,
Context context)
Builds a Debian package by writing it to the specified target.
|
void |
setChangeLog(ChangeLog changeLog)
Sets the change log.
|
void |
setControl(Control control)
Sets the control information.
|
void |
setCopyright(Copyright copyright)
Sets the copyright.
|
void |
setInstalledSizeOverhead(Size installedSizeOverhead)
Sets the overhead which will be added to the specified installed size.
|
void |
setPostInstall(Script postInstall)
Sets the script which will be executed after the package is installed.
|
void |
setPostRemove(Script postRemove)
Sets the script which will be executed after the package is removed.
|
void |
setPreInstall(Script preInstall)
Sets the script which will be executed before the package is installed.
|
void |
setPreRemove(Script preRemove)
Sets the script which will be executed before the package is removed.
|
protected DebianPackageBuilderImpl(Script defaultPreInstall, Script defaultPostInstall, Script defaultPreRemove, Script defaultPostRemove)
Creates a builder.
defaultPreInstall
- The default script which will be executed before the package
is installed.defaultPostInstall
- The default script which will be executed after the package is
installed.defaultPreRemove
- The default script which will be executed before the package
is removed.defaultPostRemove
- The default script which will be executed after the package is
removed.IllegalArgumentException
- If any of the parameters are null
.public void setControl(Control control)
DebianPackageBuilder
Sets the control information.
If no installed size is specified in the control information the builder will sum up the sizes of the specified files and use that value as installed size.
setControl
in interface DebianPackageBuilder
control
- The control information.public void setInstalledSizeOverhead(Size installedSizeOverhead)
DebianPackageBuilder
Sets the overhead which will be added to the specified installed size.
If a installed size is specified in the control information passed to the
DebianPackageBuilder.setControl(Control)
method this size will be added. If no
installed size is specified the builder will sum up the sizes of the
specified files and add the overhead.
The overhead can be used for files which will be created after the installation. This way space can be "reserved".
setInstalledSizeOverhead
in interface DebianPackageBuilder
installedSizeOverhead
- The overhead.public void setPreInstall(Script preInstall)
DebianPackageBuilder
Sets the script which will be executed before the package is installed.
setPreInstall
in interface DebianPackageBuilder
preInstall
- The script or null
, if the standard script should
be used.public void setPostInstall(Script postInstall)
DebianPackageBuilder
Sets the script which will be executed after the package is installed.
setPostInstall
in interface DebianPackageBuilder
postInstall
- The script or null
, if the standard script should
be used.public void setPreRemove(Script preRemove)
DebianPackageBuilder
Sets the script which will be executed before the package is removed.
setPreRemove
in interface DebianPackageBuilder
preRemove
- The script or null
, if the standard script should
be used.public void setPostRemove(Script postRemove)
DebianPackageBuilder
Sets the script which will be executed after the package is removed.
setPostRemove
in interface DebianPackageBuilder
postRemove
- The script or null
, if the standard script should
be used.public void addDataDirectory(String path)
DebianPackageBuilder
Adds a directory to the data of the package.
This method is equal to the method
DebianPackageBuilder.addDataDirectory(String, FileOwner, FileMode)
using the
following values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0755 |
addDataDirectory
in interface DebianPackageBuilder
path
- The installation path.public void addDataDirectory(String path, FileOwner owner, FileMode mode)
DebianPackageBuilder
Adds a directory to the data of the package.
addDataDirectory
in interface DebianPackageBuilder
path
- The installation path.owner
- The owner.mode
- The mode.public void addDataFile(DataSource source, String path)
DebianPackageBuilder
Adds a file to the data of the package.
This method is equal to the method
DebianPackageBuilder.addDataFile(DataSource, String, FileOwner, FileMode)
using the
following values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0644 |
addDataFile
in interface DebianPackageBuilder
source
- The source for the context of the file.path
- The installation path.public void addDataFile(DataSource source, String path, FileOwner owner, FileMode mode)
DebianPackageBuilder
Adds a file to the data of the package.
addDataFile
in interface DebianPackageBuilder
source
- The source for the context of the file.path
- The installation path.owner
- The owner.mode
- The mode.public void addDataSymLink(String path, String target, FileOwner owner, FileMode mode)
DebianPackageBuilder
Adds a symbolic link to the data of the package.
addDataSymLink
in interface DebianPackageBuilder
path
- The installation path.target
- The target path.owner
- The owner.mode
- The mode.public void setCopyright(Copyright copyright)
DebianPackageBuilder
Sets the copyright.
setCopyright
in interface DebianPackageBuilder
copyright
- The copyright.public void setChangeLog(ChangeLog changeLog)
DebianPackageBuilder
Sets the change log.
setChangeLog
in interface DebianPackageBuilder
changeLog
- The change log.public void buildDebianPackage(DataTarget target, Context context) throws IOException, BuildException
DebianPackageBuilder
Builds a Debian package by writing it to the specified target.
buildDebianPackage
in interface DebianPackageBuilder
target
- The targetcontext
- The context.IOException
- If an I/O error occurs while writing the file.BuildException
- If an error occurs during the building.DebianPackageBuilder.setControl(Control)
Copyright © 2015–2019. All rights reserved.