summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 647f5218e023473ec8f5a9eaac9ca6e3640b3f25 (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
# Maintainer: Jeremy Kescher <jeremy@kescher.at>
pkgname=mjpeg-proxy-git
_pkgname=mjpeg-proxy
pkgver=r55.042fc2e
pkgrel=1
pkgdesc="Republish MJPEG HTTP image streams using a server in Go"
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url="https://github.com/vvidic/mjpeg-proxy"
license=('GPL3')
makedepends=(
  'go'
  'git'
)
provides=('mjpeg-proxy')
conflicts=('mjpeg-proxy')
source=(
    "$_pkgname::git+https://github.com/vvidic/mjpeg-proxy.git"
    "service"
    "tmpfiles"
)
backup=('etc/mjpeg-proxy/sources.json')
sha256sums=('SKIP'
            '698c307c758f5b911d8bf054f2ed74bf707bf8eb18ad9e6475fd8abd6b15fbea'
            '11b464bb313a6ea6f6719b7f47814f76bcf10f733dc83c06aefd76b825e47988')

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

build() {
  cd "$srcdir/$_pkgname"

  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"

  go build -o $_pkgname
}

package() {
  cd "$srcdir"
  install -Dm755 $_pkgname/$_pkgname "${pkgdir}"/usr/bin/$_pkgname
  install -Dm644 $_pkgname/sources.json "${pkgdir}"/etc/mjpeg-proxy/sources.json
  install -Dm644 service "${pkgdir}"/usr/lib/systemd/system/mjpeg-proxy.service
  install -Dm644 tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/$_pkgname.conf
}