Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .config/goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,51 @@ source:
files:
- COMMIT

srpm:
enabled: true
package_name: chezmoi
spec_file: assets/templates/chezmoi.spec.tmpl

# Template for the source RPM file name.
#
# Default: '{{ .PackageName }}-{{ .Version }}.src.rpm'.
# Templates: allowed.
#file_name_template: "{{ .ConventionalFileName }}.src.rpm"

# Import path for the Go package (used in Fedora-style spec templates).
import_path: github.com/twpayne/chezmoi

# One-line summary of the package.
#summary: Manage your dotfiles across multiple machines, securely.

# License identifier.
license: MIT

# Name of the license file to include.
license_file_name: LICENSE

# URL of the project homepage.
url: https://chezmoi.io

# The person or organization that built this package.
packager: Tom Payne <twpayne@gmail.com>

# List of documentation files to include.
#docs:
#- README.md
#- CHANGELOG.md

# RPM-specific fields, shared with nfpms[].rpm.
#group: Applications/Internet
#compression: lzma

# Signature configuration.
#
# If the key is password-protected, you'll need to set the `%SRPM_PASSPHRASE`
# environment variable when calling GoReleaser.
#signature:
#key_file: "{{ .Env.GPG_KEY_FILE }}"

winget:
- name: chezmoi
publisher: twpayne
Expand Down
58 changes: 58 additions & 0 deletions assets/templates/chezmoi.spec.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by goreleaser
%bcond_without check

%global goipath {{ .ImportPath }}
%global commit {{ .FullCommit }}

%gometa -f

%global common_description %{expand:
{{ .Description }}}

{{ if .LicenseFileName }}%global golicenses {{ .LicenseFileName }}{{ end }}
{{ if .Docs }}%global godocs {{ range .Docs }} {{ . }}{{ end }}{{ end }}

Name: %{goname}
Version: {{ .Version }}
Release: %autorelease -p
Summary: {{ .Summary }}

License: {{ .License }}
URL: {{ .URL }}
Source: {{ .Source }}

%description %{common_description}

%gopkg

%prep
%goprep

%generate_buildrequires
%go_generate_buildrequires

%build
{{ range $binary, $importPath := .Bins }}
%gobuild -o %{gobuilddir}/bin/{{ $binary }} {{ $importPath }}
{{ end }}

%install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
%gocheck
%endif

%files
{{ range .Docs }}%doc {{ . }}
{{ end }}
{{ if .LicenseFileName }}%license {{ .LicenseFileName }}{{ end }}
%{_bindir}/*

%gopkgfiles

%changelog
%autochangelog
Loading