summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b8aa0c1f82b658b830a2f93d0c71b69cbcf4068 (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
51
52
53
54
55
56
57
# Maintainer: Thomas Fanninger <thomas@fanninger.at>

pkgname=go-wol-server-git
_pkgname=go-wol-server
url="https://github.com/fanningert/wol-server"
pkgver=38.6f90177
pkgrel=1
epoch=1
pkgdesc="Wake on Lan server"
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
license=('MIT')
depends=()
optdepends=()
provides=('go-wol-server')
makedepends=('go>=1.2' 'git')
conflicts=()
options=('!strip' '!emptydirs')
backup=('etc/go-wol-server/config.toml')

_gourl=github.com/fanningert
_gourl_pkgname=wol-server
source=('go-wol-server.service'
        'config.toml'
        "${_gourl_pkgname}::git+https://${_gourl}/${_gourl_pkgname}.git")

sha512sums=('5df3bdc1cf04fd6a83fbe1bca6e8edfd9034f26214f79598eebb1f3bdbac79df53b5fa89e97705c5dd15030ea587a1d85072708ead08c84c61662fa71d2db91b'
            'a205bae9700053cfd326082a4a5d6fe21c82e8c7b2b94ef180e3c45f69889f66ec40d0a78e21e35f1d0bf26fb2e364d09d576e8b5c3463fba282d671b4bba884'
            'SKIP')

pkgver(){
  cd "$srcdir/../${_gourl_pkgname}"
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  mkdir -p "${srcdir}/src/${_gourl}"
  mv "${_gourl_pkgname}" "${srcdir}/src/${_gourl}"
  msg2 "go get"
  GOPATH="${srcdir}" go get "${_gourl}/${_gourl_pkgname}"
}

build() {
  msg2 "Build program"
  cd ${srcdir}/src/${_gourl}/${_gourl_pkgname}
  GOPATH="${srcdir}" go fix
  GOPATH="${srcdir}" go build
}

package() {
  install -D -m 0755 "${srcdir}/src/${_gourl}/${_gourl_pkgname}/${_gourl_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
  
  install -D -m 0600 "${srcdir}/config.toml" "$pkgdir/etc/${_pkgname}/config.toml"
  mkdir -p "${pkgdir}/usr/share/themes/${_pkgname}/templates"
  mv "${srcdir}/src/${_gourl}/${_gourl_pkgname}/templates" "${pkgdir}/usr/share/themes/${_pkgname}/templates/default"
  
  install -D -m 0644 "${srcdir}/${_pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${_pkgname}.service"
}