Skip to content

Commit 87d2ecd

Browse files
committed
add aur_sources for fhome, fix completions
1 parent 79a263f commit 87d2ecd

File tree

1 file changed

+52
-14
lines changed

1 file changed

+52
-14
lines changed

.goreleaser.yaml

Lines changed: 52 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ archives:
5252
- goos: windows
5353
formats: zip
5454

55+
# Required for AUR sources
56+
source:
57+
enabled: true
58+
5559
changelog:
5660
disable: true
5761

@@ -89,6 +93,44 @@ brews:
8993
9094
man1.install "fhomed.1"
9195
96+
aur_sources:
97+
- name: fhome
98+
homepage: https://github.com/bartekpacia/fhome
99+
description: Interact with smart home devices connected to F&Home
100+
maintainers:
101+
- Bartek Pacia <[email protected]>
102+
license: MIT
103+
private_key: "{{ .Env.AUR_SSH_PRIVATE_KEY }}"
104+
git_url: [email protected]:bartekpacia/aur.git
105+
directory: fhome
106+
commit_msg_template: update fhome to {{ .Tag }}
107+
prepare: |
108+
cd "${pkgname}-${pkgver}"
109+
export GOPATH="${srcdir}"
110+
go mod download -modcacherw
111+
build: |
112+
cd "${pkgname}-${pkgver}"
113+
export CGO_CPPFLAGS="${CPPFLAGS}"
114+
export CGO_CFLAGS="${CFLAGS}"
115+
export CGO_CXXFLAGS="${CXXFLAGS}"
116+
export CGO_LDFLAGS="${LDFLAGS}"
117+
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
118+
go build -ldflags="-w -s -buildid='' -linkmode=external -X main.version=${pkgver}" .
119+
chmod +x ./fhome
120+
package: |
121+
cd "$pkgname-$pkgver"
122+
# bin
123+
install -Dm755 fhome "${pkgdir}/usr/bin/fhome"
124+
125+
# license
126+
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/fhome/LICENSE"
127+
128+
# completions
129+
./fhome completion bash > completion_bash
130+
./fhome completion zsh > completion_zsh
131+
install -Dm755 completion_bash "${pkgdir}/usr/share/bash-completion/completions/fhome"
132+
install -Dm755 completion_zsh "${pkgdir}/usr/share/zsh/site-functions/_fhome"
133+
92134
aurs:
93135
- name: fhome-bin
94136
ids:
@@ -111,14 +153,10 @@ aurs:
111153
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/fhome/LICENSE"
112154
113155
# completions
114-
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
115-
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
116-
# TODO: use completion scripts from executable
117-
install -Dm755 autocomplete/bash_autocomplete_fhome "${pkgdir}/usr/share/bash-completion/completions/fhome"
118-
install -Dm755 autocomplete/zsh_autocomplete_fhome "${pkgdir}/usr/share/zsh/site-functions/_fhome"
119-
120-
# man pages
121-
# install -Dm644 "./manpages/mybin.1.gz" "${pkgdir}/usr/share/man/man1/mybin.1.gz"
156+
./fhome completion bash > completion_bash
157+
./fhome completion zsh > completion_zsh
158+
install -Dm755 completion_bash "${pkgdir}/usr/share/bash-completion/completions/fhome"
159+
install -Dm755 completion_zsh "${pkgdir}/usr/share/zsh/site-functions/_fhome"
122160
123161
- name: fhomed-bin
124162
ids:
@@ -141,11 +179,11 @@ aurs:
141179
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/fhomed/LICENSE"
142180
143181
# completions
144-
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
145-
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
146-
# TODO: use completion scripts from executable
147-
install -Dm755 autocomplete/bash_autocomplete_fhomed "${pkgdir}/usr/share/bash-completion/completions/fhomed"
148-
install -Dm755 autocomplete/zsh_autocomplete_fhomed "${pkgdir}/usr/share/zsh/site-functions/_fhomed"
182+
./fhomed completion bash > completion_bash
183+
./fhomed completion zsh > completion_zsh
184+
install -Dm755 completion_bash "${pkgdir}/usr/share/bash-completion/completions/fhomed"
185+
install -Dm755 completion_zsh "${pkgdir}/usr/share/zsh/site-functions/_fhomed"
149186
150187
# man pages
151-
# install -Dm644 "./manpages/mybin.1.gz" "${pkgdir}/usr/share/man/man1/mybin.1.gz"
188+
./fhomed docs --format man-with-section > fhomed.1
189+
install -Dm644 fhomed.1 "${pkgdir}/usr/share/man/man1/fhomed.1"

0 commit comments

Comments
 (0)