summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b1dfe6cc7e1c24c09f2ebc628a0b1c766c2b18bc (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: Chris Snell <chris.snell@gmail.com>

pkgname=captive-browser-git
_pkgname=captive-browser
pkgver=r18.0845056
pkgrel=1
pkgdesc="A dedicated Chrome instance to log into captive portals without messing with DNS settings"
arch=('x86_64' 'i686' 'arm')
url="https://blog.filippo.io/captive-browser"
conflicts=('captive-browser')
provides=('captive-browser')
optdepends=('chromium: used to log into captive portal'
           'google-chrome: used to log into captive portal')
options=('!strip')
license=('MIT')
makedepends=('go' 'git')
depends=('google-chrome')
source=('git+https://github.com/FiloSottile/captive-browser.git')
sha512sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

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

  # Force our own git checkout
  export GOPATH="$srcdir"
  mkdir -p "$GOPATH/src/github.com/FiloSottile"
  ln -s `pwd` "$GOPATH/src/github.com/FiloSottile/captive-browser"

  go get -d -v github.com/BurntSushi/toml
  go get -d -v github.com/armon/go-socks5
  go get -d -v github.com/FiloSottile/captive-browser
  go build
}

package() {
  cd "$srcdir/$_pkgname"
  install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
  install -Dm644 captive-browser-ubuntu-chrome.toml "$pkgdir/usr/share/$_pkgname/example/captive-browser.toml"
}