archrelease: copy trunk to community-any
[ArchLinux/community.git] / duf / repos / community-x86_64 / PKGBUILD
blob650cf6692a5b5b7f2911ad706f4575ba0c0ab597
1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Christian Muehlhaeuser <muesli at gmail dot com>
4 pkgname=duf
5 pkgver=0.8.1
6 pkgrel=2
7 pkgdesc='Disk Usage/Free Utility'
8 arch=(x86_64)
9 url="https://github.com/muesli/$pkgname"
10 license=(MIT)
11 depends=(glibc)
12 makedepends=(git
13              go)
14 _archive="$pkgname-$pkgver"
15 source=("$url/archive/v$pkgver/$_archive.tar.gz")
16 sha256sums=('ebc3880540b25186ace220c09af859f867251f4ecaef435525a141d98d71a27a')
18 build() {
19         local commit=$(zcat ${source[1]##*/} | git get-tar-commit-id)
20         local extraflags="-X main.Version=$pkgver -X main.CommitSHA=$commit"
21         export CGO_CPPFLAGS="$CPPFLAGS"
22         export CGO_CFLAGS="$CFLAGS"
23         export CGO_CXXFLAGS="$CXXFLAGS"
24         cd "$_archive"
25         go build \
26                 -trimpath \
27                 -buildmode=pie \
28                 -mod=readonly \
29                 -modcacherw \
30                 -ldflags "-linkmode external $extraflags -extldflags \"$LDFLAGS\"" \
31                 -o "$pkgname" .
34 package() {
35         cd "$_archive"
36         install -Dm0755 -t "$pkgdir/usr/bin/" "$pkgname"
37         install -Dm0644 -t "$pkgdir/usr/share/man/man1/" "$pkgname.1"
38         install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE