Documentation
¶
Overview ¶
Package packer provides unified package building interface for multiple formats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrossDepsExtractor ¶
type CrossDepsExtractor interface {
DownloadAndExtractCrossDeps(deps []string, targetArch string) error
}
CrossDepsExtractor is implemented by builders that support downloading and extracting cross-build runtime dependencies without registering them in the package database. This avoids circular dependency conflicts between arch-all meta-packages and their arch-specific transitive dependencies.
type InstallOrExtractor ¶
type InstallOrExtractor interface {
InstallOrExtract(artifactsPath, buildDir, targetArch string) error
}
InstallOrExtractor is implemented by package builders that extract built artifacts to the root filesystem (/) so that dependent packages can resolve headers and libraries.
type Packer ¶
type Packer interface {
// BuildPackage starts the package building process and writes the final artifact
// to the specified output path. It returns the path to the built artifact and an error
// if any issues occur during the build.
BuildPackage(output string, targetArch string) (string, error)
// Prepare appends the dependencies required to build all the projects. It
// returns any error if encountered.
Prepare(depends []string, targetArch string) error
// PrepareEnvironment reads a flag to install golang tools on request, on the
// build machine. It returns any error if encountered.
PrepareEnvironment(flag bool, targetArch string) error
// PrepareFakeroot sets up the environment for building the final artifact in a fakeroot context.
// It takes an output path where the artifact will be written and returns an error if any issues
// occur.
PrepareFakeroot(output string, targetArch string) error
// Update performs a package manager update operation. It returns any error if
// encountered.
Update() error
}
Packer is the common interface implemented by all package managers.
func GetPackageManager ¶
func GetPackageManager( pkgBuild *pkgbuild.PKGBUILD, distro string, compressionDeb string, compressionRpm string, ) (Packer, error)
GetPackageManager returns a Packer interface based on the given package build and distribution.
pkgBuild: A pointer to a pkgbuild.PKGBUILD struct. distro: A string representing the distribution. compressionDeb: Compression algorithm for DEB packages (empty string uses default). compressionRpm: Compression algorithm for RPM packages (empty string uses default). Returns a Packer interface and an error if any issues occur.