1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-06-02 06:36:19 +02:00

rpm: bindir

This commit is contained in:
Carlos Alexandro Becker 2018-02-12 16:29:44 -02:00
parent 74f4bdaa15
commit 6a25e65a17
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
3 changed files with 5 additions and 2 deletions

1
pkg.go
View File

@ -51,6 +51,7 @@ type Info struct {
Vendor string `yaml:"vendor,omitempty"`
Homepage string `yaml:"homepage,omitempty"`
License string `yaml:"license,omitempty"`
Bindir string `yaml:"bindir,omitempty"`
Files map[string]string `yaml:"files,omitempty"`
ConfigFiles map[string]string `yaml:"config_files,omitempty"`
}

View File

@ -175,6 +175,7 @@ const specTemplate = `
%define debug_package %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define _arch {{.Arch}}
%define _bindir {{.Bindir}}
Name: {{ .Name }}
Summary: {{ first_line .Description }}
@ -226,12 +227,12 @@ rm -rf %{buildroot}
{{ range $index, $element := .Files }}
{{ . }}
{{ end }}
# %{_bindir}/*
%{_bindir}/*
{{ range $index, $element := .ConfigFiles }}
{{ . }}
{{ end }}
{{ range $index, $element := .ConfigFiles }}
#%config(noreplace) {{ . }}
%config(noreplace) {{ . }}
{{ end }}
%changelog

View File

@ -27,6 +27,7 @@ func TestRPM(t *testing.T) {
Homepage: "http://carlosbecker.com",
Vendor: "nope",
License: "MIT",
Bindir: "/usr/local/bin",
Files: map[string]string{
"../testdata/fake": "/usr/local/bin/fake",
},