summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9714e275cd433216db2b1cd3660ac4ca13aab269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pkgname=christmasfetch
pkgver=1.0.r2.2352b3e
pkgrel=1
epoch=
pkgdesc="A simple program that fetches information on the next Christmas!"
arch=('i686' 'pentium4' 'x86_64' 'arm' 'aarch64')
url="https://github.com/mattishere/christmasfetch"
license=('MIT')
groups=()
depends=()
makedepends=(git make go)
checkdepends=()
optdepends=()
provides=('christmasfetch')
conflicts=('christmasfetch')
backup=()
options=()
install=
changelog=
source=("git+$url")
noextract=()
md5sums=('SKIP')
validpgpkeys=()

pkgver() {
	cd "${_pkgname}"
	printf "1.0.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export CGO_ENABLED=1 

	cd "$srcdir/$pkgname"
	go build -o "$pkgname" main.go
}

package() {
	cd "$srcdir/$pkgname"
	mkdir -p "${pkgdir}/usr/bin"
	mkdir -p ${pkgdir}/opt/${pkgname}
	cp -rf * ${pkgdir}/opt/${pkgname}

	install -Dm755 christmasfetch "$pkgdir/usr/bin"
	install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
	install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}