/
tmpl.go
102 lines (94 loc) · 2.07 KB
/
tmpl.go
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package aur
type templateData struct {
Name string
Desc string
Homepage string
Version string
License string
ReleasePackages []releasePackage
Maintainers []string
Contributors []string
Provides []string
Conflicts []string
Backup []string
Depends []string
OptDepends []string
Arches []string
Rel string
Package string
}
type releasePackage struct {
DownloadURL string
SHA256 string
Arch string
Format string
}
const aurTemplateData = `# This file was generated by GoReleaser. DO NOT EDIT.
{{- range .Maintainers }}
# Maintainer: {{ . }}
{{- end }}
{{- range .Contributors }}
# Contributor: {{ . }}
{{- end }}
pkgname='{{ .Name }}'
pkgver={{ .Version }}
pkgrel={{ .Rel }}
pkgdesc='{{ .Desc }}'
url='{{ .Homepage }}'
arch=({{ pkgArray .Arches }})
license=('{{ .License }}')
{{- with .Provides }}
provides=({{ pkgArray . }})
{{- end }}
{{- with .Conflicts }}
conflicts=({{ pkgArray . }})
{{- end }}
{{- with .Depends }}
depends=({{ pkgArray . }})
{{- end }}
{{- with .OptDepends }}
optdepends=({{ pkgArray . }})
{{- end }}
{{- with .Backup }}
backup=({{ pkgArray . }})
{{- end }}
{{ range .ReleasePackages -}}
source_{{ .Arch }}=("${pkgname}_${pkgver}_{{ .Arch }}.{{ .Format }}::{{ .DownloadURL }}")
sha256sums_{{ .Arch }}=('{{ .SHA256 }}')
{{ printf "" }}
{{ end }}
{{- with .Package -}}
package() {
{{ fixLines . }}
}
{{ end }}`
const srcInfoTemplate = `pkgbase = {{ .Name }}
pkgdesc = {{ .Desc }}
pkgver = {{ .Version }}
pkgrel = {{ .Rel }}
{{ with .Homepage -}}
url = {{ . }}
{{ end -}}
{{ with .License -}}
license = {{ . }}
{{ end -}}
{{ range .OptDepends -}}
optdepends = {{ . }}
{{ end -}}
{{ range .Depends -}}
depends = {{ . }}
{{ end -}}
{{ range .Conflicts -}}
conflicts = {{ . }}
{{ end -}}
{{ range .Provides -}}
provides = {{ . }}
{{ end -}}
{{ range .ReleasePackages -}}
arch = {{ .Arch }}
source_{{ .Arch }} = {{ .DownloadURL }}
sha256sums_{{ .Arch }} = {{ .SHA256 }}
{{ end -}}
{{ printf "\n" -}}
pkgname = {{ .Name }}
`