nfpm: Index | Files | Directories

package nfpm

import ""

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


Package Files


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 Info Uses

type Info struct {
    Overridables `yaml:",inline"`
    Name         string `yaml:"name,omitempty"`
    Arch         string `yaml:"arch,omitempty"`
    Platform     string `yaml:"platform,omitempty"`
    Version      string `yaml:"version,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"`

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"`

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 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


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 through rpmbuild.

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