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_PATHUTF_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)
DebianPackageBuilderSets 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 DebianPackageBuildercontrol - The control information.public void setInstalledSizeOverhead(Size installedSizeOverhead)
DebianPackageBuilderSets 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 DebianPackageBuilderinstalledSizeOverhead - The overhead.public void setPreInstall(Script preInstall)
DebianPackageBuilderSets the script which will be executed before the package is installed.
setPreInstall in interface DebianPackageBuilderpreInstall - The script or null, if the standard script should
be used.public void setPostInstall(Script postInstall)
DebianPackageBuilderSets the script which will be executed after the package is installed.
setPostInstall in interface DebianPackageBuilderpostInstall - The script or null, if the standard script should
be used.public void setPreRemove(Script preRemove)
DebianPackageBuilderSets the script which will be executed before the package is removed.
setPreRemove in interface DebianPackageBuilderpreRemove - The script or null, if the standard script should
be used.public void setPostRemove(Script postRemove)
DebianPackageBuilderSets the script which will be executed after the package is removed.
setPostRemove in interface DebianPackageBuilderpostRemove - The script or null, if the standard script should
be used.public void addDataDirectory(String path)
DebianPackageBuilderAdds 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 DebianPackageBuilderpath - The installation path.public void addDataDirectory(String path, FileOwner owner, FileMode mode)
DebianPackageBuilderAdds a directory to the data of the package.
addDataDirectory in interface DebianPackageBuilderpath - The installation path.owner - The owner.mode - The mode.public void addDataFile(DataSource source, String path)
DebianPackageBuilderAdds 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 DebianPackageBuildersource - The source for the context of the file.path - The installation path.public void addDataFile(DataSource source, String path, FileOwner owner, FileMode mode)
DebianPackageBuilderAdds a file to the data of the package.
addDataFile in interface DebianPackageBuildersource - 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)
DebianPackageBuilderAdds a symbolic link to the data of the package.
addDataSymLink in interface DebianPackageBuilderpath - The installation path.target - The target path.owner - The owner.mode - The mode.public void setCopyright(Copyright copyright)
DebianPackageBuilderSets the copyright.
setCopyright in interface DebianPackageBuildercopyright - The copyright.public void setChangeLog(ChangeLog changeLog)
DebianPackageBuilderSets the change log.
setChangeLog in interface DebianPackageBuilderchangeLog - The change log.public void buildDebianPackage(DataTarget target, Context context) throws IOException, BuildException
DebianPackageBuilderBuilds a Debian package by writing it to the specified target.
buildDebianPackage in interface DebianPackageBuildertarget - 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.