summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18a9cd17acedb03633b0397b765f7a8b7f3c6a03 (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
# Maintainer: JSpringYC <JSpringYC@gmail.com>

pkgname=pgyvpn-bin
_pkgname=PgyVisitor
pkgver=2.3.0
pkgrel=1
pkgdesc="Suitable for business personnal long-distance intelligent network access"
arch=('x86_64')
url="https://pgy.oray.com/download/"
license=('custom')
provides=('pgyvpn-bin')
conflicts=('pgyvpn')
install=pgyvpn-bin.install
source=('LICENSE::https://service.oray.com/question/1820.html'
        "${pkgname%-bin}.service"
        "${_pkgname}_Ubuntu_${pkgver}_X86_64.deb::https://pgy.oray.com/dl/42/download?os=Ubuntu%20Linux(X86_64)")
sha256sums=('SKIP'
            '25995cc8f865139147ced000fea52a8f4dda072addbf9e4a3b18b5c599a8be7f'
            '7fabd22c75ac21f5c23d4682988ddf5832315b97986acb9790370a107349d1ac')

package() {
  tar -xf data.tar.*z -C ${pkgdir}

  cd ${pkgdir}

  # binary
  for binary in usr/sbin/*;
  do
    install -Dm755 $binary usr/bin/`basename $binary`
  done
  rm -rf usr/sbin

  # systemd service
  install -Dm644 ${srcdir}/${pkgname%-bin}.service usr/lib/systemd/system/${pkgname%-bin}.service
  if [ $CARCH == 'x86_64' ] || [ $CARCH == 'i686' ];then
    rm -rf etc/init.d
  else
    rm -rf lib
  fi

  # license
  install -Dm644 ${srcdir}/LICENSE usr/share/licenses/${pkgname}/LICENSE

  # fixed permission
  chown -R root:root usr etc
  chmod 755 usr usr/share etc etc/oray etc/oray/pgyvpn
}