1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: Christian Muehlhaeuser <muesli at gmail dot com>
7 pkgdesc='The backend for the Charm cloud'
9 url='https://charm.sh/cloud/'
12 makedepends=('git' 'go')
13 conflicts=('charm-tool')
14 replaces=('charm-tool')
15 backup=('etc/charm.conf')
17 _commit='31a737e71a1e43ead4a3c597271036f19164e98d'
19 "git+https://github.com/charmbracelet/charm.git#commit=$_commit"
26 'c6414097223dde827dfcbaf500d29c45843b3b0a08600a3a69c7d4ec9781675f7b677cc9bc59f88c6c3734a8ee349ee589e5d2070a3aa6afa35f4825766270e6'
27 'ad16df43405a2969abfaf3e6f4cd6edcb2a29661a8a27bbaa13b34d3febb979356538340940383d5c737b9bd4fa434920395ea4e960951660073f8d31d225dac'
28 'b6b509de048f1d63d3d08dda04f3e5743fc212ec44f4a7a83a98a429f9a8fdf01194b83aba7588d02b5712f9bef3efcface1197d3ca458aee5d1be955f6782cd'
29 '2eee2c889e4efe83a534249c7048340b67819d81096a0fd7a23522d2eda46b833709eab1a0359538fdfbe27dbe4154c9d235535374e27c441dc7c030277f7218')
34 git describe --tags | sed 's/^v//'
39 # create directory for build output
42 # download dependencies
43 export GOPATH="${srcdir}"
51 export CGO_CPPFLAGS="${CPPFLAGS}"
52 export CGO_CFLAGS="${CFLAGS}"
53 export CGO_CXXFLAGS="${CXXFLAGS}"
54 export GOPATH="${srcdir}"
60 -ldflags "-compressdwarf=false \
62 -extldflags ${LDFLAGS} \
63 -X main.Version=$pkgver \
64 -X main.CommitSHA=$_commit" \
69 ./build/charm man > build/charm.1
71 # ensure reproducibility of man page
72 # i'm not 100% sure where the man sub-command gets the date from, i assume
73 # it uses $TODAYS_DATE, so this should make the man page reproducible
74 local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)
78 -e "s/\"[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\"/\"$_commit_date\"/"
80 # generate shell completion
81 for shell in bash fish zsh; do
82 ./build/charm completion "$shell" > "build/$shell.completion"
94 install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/charm.service"
95 install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/charm.conf"
96 install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/charm.conf"
97 install -vDm644 charm.conf "$pkgdir/etc/charm.conf"
102 install -vDm755 -t "$pkgdir/usr/bin" build/charm
105 install -vDm644 build/bash.completion "$pkgdir/usr/share/bash-completion/completions/charm"
106 install -vDm644 build/fish.completion "$pkgdir/usr/share/fish/vendor_completions.d/charm.fish"
107 install -vDm644 build/zsh.completion "$pkgdir/usr/share/zsh/site-functions/_charm"
110 install -vDm644 -t "$pkgdir/usr/share/man/man1" build/charm.1
113 install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
116 # vim:set ts=2 sw=2 et: