summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 924a1998cbafac14f7c5e2296db2e7ebaba1a611 (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
# Maintainer: Krister Bäckman <ixevix@gmail.com>

pkgname=virtwold
pkgver=23.12.0
pkgrel=2
pkgdesc='Wake-on-LAN for libvirt based VMs'
depends=('glibc' 'libvirt')
makedepends=('git' 'go' 'libvirt')
source=("https://github.com/ScottESanDiego/${pkgname}/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('a3ecd37a53a3c1628a93f45876053aa3f3dddfd71e9c7688377410e4a16e934a')
arch=('x86_64')
url='https://github.com/ScottESanDiego/virtwold'

build() {
  cd "${pkgname}-${pkgver}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  _LDFLAGS="-X main.goos=$(go env GOOS) -X main.goarch=$(go env GOARCH) -X main.version=${pkgver} -X main.branch=tag-${pkgver} -X main.commit=tag-${pkgver} -extldflags -s"
  go build -ldflags="${_LDFLAGS}"

}

package() {
  install -D -m755 "${srcdir}/${pkgname}-${pkgver}/${pkgname}" \
    "${pkgdir}/usr/bin/${pkgname}"

  sed -i -e 's/\/usr\/local\/bin/\/usr\/bin/g' "${srcdir}/${pkgname}-${pkgver}/init-scripts/systemd/${pkgname}@.service"
  install -D -m644 "${srcdir}/${pkgname}-${pkgver}/init-scripts/systemd/${pkgname}@.service" \
    "${pkgdir}/usr/lib/systemd/system/${pkgname}@.service"
}