aboutsummaryrefslogtreecommitdiff
path: root/cmd/yeet/internal/pkgmeta/package.go
blob: f955c6e4051e91e540af1c034005dc7c5aa4e3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package pkgmeta

type Package struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	Description string   `json:"description"`
	Homepage    string   `json:"homepage"`
	Group       string   `json:"group"`
	License     string   `json:"license"`
	Platform    string   `json:"platform"` // if not set, default to linux
	Goarch      string   `json:"goarch"`
	Replaces    []string `json:"replaces"`
	Depends     []string `json:"depends"`
	Recommends  []string `json:"recommends"`

	EmptyDirs     []string          `json:"emptyDirs"`     // rpm destination path
	ConfigFiles   map[string]string `json:"configFiles"`   // pwd-relative source path, rpm destination path
	Documentation map[string]string `json:"documentation"` // pwd-relative source path, file in /usr/share/doc/$Name
	Files         map[string]string `json:"files"`         // pwd-relative source path, rpm destination path

	Build    func(BuildInput)     `json:"build"`
	Filename func(Package) string `json:"mkFilename"`
}

type BuildInput struct {
	Output  string `json:"out"`
	Bin     string `json:"bin"`
	Doc     string `json:"doc"`
	Etc     string `json:"etc"`
	Man     string `json:"man"`
	Systemd string `json:"systemd"`
}

func (b BuildInput) String() string {
	return b.Output
}