public interface DebianPackageBuilder
A builder for Debian packages.
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.
|
void setControl(Control control)
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.
control
- The control information.void setInstalledSizeOverhead(Size installedSizeOverhead)
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
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".
installedSizeOverhead
- The overhead.void setPreInstall(Script preInstall)
Sets the script which will be executed before the package is installed.
preInstall
- The script or null
, if the standard script should
be used.void setPostInstall(Script postInstall)
Sets the script which will be executed after the package is installed.
postInstall
- The script or null
, if the standard script should
be used.void setPreRemove(Script preRemove)
Sets the script which will be executed before the package is removed.
preRemove
- The script or null
, if the standard script should
be used.void setPostRemove(Script postRemove)
Sets the script which will be executed after the package is removed.
postRemove
- The script or null
, if the standard script should
be used.void addDataDirectory(String path)
Adds a directory to the data of the package.
This method is equal to the method
addDataDirectory(String, FileOwner, FileMode)
using the
following values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0755 |
path
- The installation path.IllegalArgumentException
- If the installation path is null
.IllegalStateException
- If the parent directory wasn't added before. Only exception
is the root "/" directory which always exists.void addDataDirectory(String path, FileOwner owner, FileMode mode)
Adds a directory to the data of the package.
path
- The installation path.owner
- The owner.mode
- The mode.IllegalArgumentException
- If any of the parameters are null
.IllegalStateException
- If the parent directory wasn't added before. Only exception
is the root "/" directory which always exists.void addDataFile(DataSource source, String path)
Adds a file to the data of the package.
This method is equal to the method
addDataFile(DataSource, String, FileOwner, FileMode)
using the
following values:
group ID | group name | user ID | user name | mode (octal) |
---|---|---|---|---|
0 | root | 0 | root | 0644 |
source
- The source for the context of the file.path
- The installation path.IllegalArgumentException
- If any of the parameters are null
.IllegalStateException
- If the parent directory wasn't added before. Only exception
is the root "/" directory which always exists.void addDataFile(DataSource source, String path, FileOwner owner, FileMode mode)
Adds a file to the data of the package.
source
- The source for the context of the file.path
- The installation path.owner
- The owner.mode
- The mode.IllegalArgumentException
- If any of the parameters are null
.IllegalStateException
- If the parent directory wasn't added before. Only exception
is the root "/" directory which always exists.void addDataSymLink(String path, String target, FileOwner owner, FileMode mode)
Adds a symbolic link to the data of the package.
path
- The installation path.target
- The target path.owner
- The owner.mode
- The mode.IllegalArgumentException
- If any of the parameters are null
.IllegalStateException
- If the parent directory wasn't added before. Only exception
is the root "/" directory which always exists.void setCopyright(Copyright copyright)
Sets the copyright.
copyright
- The copyright.void setChangeLog(ChangeLog changeLog)
Sets the change log.
changeLog
- The change log.void buildDebianPackage(DataTarget target, Context context) throws IOException, BuildException
Builds a Debian package by writing it to the specified target.
target
- The targetcontext
- The context.IllegalArgumentException
- If any of the parameters are null
.IllegalStateException
- If no control information, no copyright and/or no change log
is set.IOException
- If an I/O error occurs while writing the file.BuildException
- If an error occurs during the building.setControl(Control)
Copyright © 2015–2019. All rights reserved.