nfpm: github.com/goreleaser/nfpm Index | Files | Directories

package nfpm

import "github.com/goreleaser/nfpm"

Package nfpm provides ways to package programs in some linux packaging formats.

Index

Package Files

nfpm.go

func Register Uses

func Register(format string, p Packager)

Register a new packager for the given format

func Validate Uses

func Validate(info *Info) error

Validate the given Info and returns an error if it is invalid.

type Config Uses

type Config struct {
    Info      `yaml:",inline"`
    Overrides map[string]Overridables `yaml:"overrides,omitempty"`
}

Config contains the top level configuration for packages

func Parse Uses

func Parse(in io.Reader) (config Config, err error)

Parse decodes YAML data from an io.Reader into a configuration struct

func ParseFile Uses

func ParseFile(path string) (config Config, err error)

ParseFile decodes YAML data from a file path into a configuration struct

func (*Config) Get Uses

func (c *Config) Get(format string) (info *Info, err error)

Get returns the Info struct for the given packager format. Overrides for the given format are merged into the final struct

func (*Config) Validate Uses

func (c *Config) Validate() error

Validate ensures that the config is well typed

type Deb Uses

type Deb struct {
    Scripts         DebScripts `yaml:"scripts,omitempty"`
    VersionMetadata string     `yaml:"metadata,omitempty"`
}

Deb is custom configs that are only available on deb packages

type DebScripts Uses

type DebScripts struct {
    Rules string `yaml:"rules,omitempty"`
}

DebScripts is scripts only available on deb packages

type Info Uses

type Info struct {
    Overridables `yaml:",inline"`
    Name         string `yaml:"name,omitempty"`
    Arch         string `yaml:"arch,omitempty"`
    Platform     string `yaml:"platform,omitempty"`
    Epoch        string `yaml:"epoch,omitempty"`
    Version      string `yaml:"version,omitempty"`
    Release      string `yaml:"release,omitempty"`
    Section      string `yaml:"section,omitempty"`
    Priority     string `yaml:"priority,omitempty"`
    Maintainer   string `yaml:"maintainer,omitempty"`
    Description  string `yaml:"description,omitempty"`
    Vendor       string `yaml:"vendor,omitempty"`
    Homepage     string `yaml:"homepage,omitempty"`
    License      string `yaml:"license,omitempty"`
    Bindir       string `yaml:"bindir,omitempty"`
    Target       string `yaml:"-"`
}

Info contains information about a single package

func WithDefaults Uses

func WithDefaults(info *Info) *Info

WithDefaults set some sane defaults into the given Info

type Overridables Uses

type Overridables struct {
    Replaces     []string          `yaml:"replaces,omitempty"`
    Provides     []string          `yaml:"provides,omitempty"`
    Depends      []string          `yaml:"depends,omitempty"`
    Recommends   []string          `yaml:"recommends,omitempty"`
    Suggests     []string          `yaml:"suggests,omitempty"`
    Conflicts    []string          `yaml:"conflicts,omitempty"`
    Files        map[string]string `yaml:"files,omitempty"`
    ConfigFiles  map[string]string `yaml:"config_files,omitempty"`
    EmptyFolders []string          `yaml:"empty_folders,omitempty"`
    Scripts      Scripts           `yaml:"scripts,omitempty"`
    RPM          RPM               `yaml:"rpm,omitempty"`
    Deb          Deb               `yaml:"deb,omitempty"`
}

Overridables contain the field which are overridable in a package

type Packager Uses

type Packager interface {
    Package(info *Info, w io.Writer) error
}

Packager represents any packager implementation

func Get Uses

func Get(format string) (Packager, error)

Get a packager for the given format

type RPM Uses

type RPM struct {
    Group       string `yaml:"group,omitempty"`
    Compression string `yaml:"compression,omitempty"`
}

RPM is custom configs that are only available on RPM packages

type Scripts Uses

type Scripts struct {
    PreInstall  string `yaml:"preinstall,omitempty"`
    PostInstall string `yaml:"postinstall,omitempty"`
    PreRemove   string `yaml:"preremove,omitempty"`
    PostRemove  string `yaml:"postremove,omitempty"`
}

Scripts contains information about maintainer scripts for packages

Directories

PathSynopsis
acceptancePackage acceptance contains acceptance tests
cmd/nfpmPackage main contains the main nfpm cli source code.
debPackage deb implements nfpm.Packager providing .deb bindings.
globPackage glob provides file globbing for use in nfpm.Packager implementations
rpmPackage rpm implements nfpm.Packager providing .rpm bindings using google/rpmpack.

Package nfpm imports 8 packages (graph) and is imported by 11 packages. Updated 2019-11-25. Refresh now. Tools for package owners.