summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5053f11f34384963ee3e082e18c7e2c724e8dd82 (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
58
59
# Maintainer: Gzxhwq <gzxhwq@gmail.com>
pkgname=v2ray-rules-dat-autoupdate
_pkgname=v2ray-rules-dat
pkgdesc="Enhanced edition of V2Ray and Xray rules dat files, compatible with Trojan-Go. Automaitcally update."
pkgver=1.3
pkgrel=2
arch=('any')
url="https://github.com/Loyalsoldier/v2ray-rules-dat"
tag=$(git ls-remote --tags --refs --sort="version:refname" "$url".git | awk -F/ 'END{print$NF}')
license=('GPL')

provides=('xray-domain-list-community' 'xray-geoip' 'v2ray-domain-list-community' 'v2ray-geoip' 'v2ray-domain-list-custom' 'v2ray-geoip-custom' 'v2ray-rules-dat-git' 'vxray-rules-dat-git')
conflicts=('xray-domain-list-community' 'xray-geoip' 'v2ray-domain-list-community' 'v2ray-geoip' 'v2ray-domain-list-custom' 'v2ray-geoip-custom' 'v2ray-rules-dat-git' 'vxray-rules-dat-git')

makedepends=('git')
depends=('curl')

install="${pkgname}.install"

source=("rules-${tag}.zip"::"${url}/releases/download/${tag}/rules.zip"
        "${pkgname}"
        "${pkgname}.install"
        "${pkgname}.sysusers"
        "${pkgname}.tmpfiles"
        "${pkgname}.service"
        "${pkgname}.timer")
  
sha256sums=($(curl -sL "${url}/releases/download/${tag}/rules.zip.sha256sum" | awk '{print $1}')
            '5ec5c6bd6735162fa1af92aa3ca8b3de47a2ff2dfab8567b5e443cdbd54f6481'
            'd5deeb9e02b2cf6e233da4369bb7d74e06054bd54ee9e62875f3342d7c931dbd'
            '5d0fac85c93516f45281f3e45071f4f98c4a9eadfbd72602129c888c823b79ef'
            'ea8090be783d0d60f441d25ddad9686b75e5b8405311cc21d29235e80b1671b7'
            '639f27779662970c2d476c4e9af73d7f7f34c1ec5241f43ce95e3231e9a58ea8'
            '5bd55042d53d3794f27483277056f06f5e55d0e7702b0093ec6f17d7da6d548c')

#pkgver() {
#  printf "1.0.r$tag"
#}

package() {

#  sha256sum --check --quiet "./rules.zip.sha256sum"

  install -Dm644 "./geoip.dat" "${pkgdir}/var/lib/${_pkgname}/geoip.dat"
  install -Dm644 "./geosite.dat" "${pkgdir}/var/lib/${_pkgname}/geosite.dat"

  mkdir -p "${pkgdir}/usr/share/"{v2ray,xray}

  ln -sf "/var/lib/${_pkgname}/"geosite.dat "${pkgdir}/usr/share/v2ray/"
  ln -sf "/var/lib/${_pkgname}/"geoip.dat "${pkgdir}/usr/share/v2ray/"
  ln -sf "/var/lib/${_pkgname}/"geosite.dat "${pkgdir}/usr/share/xray/"
  ln -sf "/var/lib/${_pkgname}/"geoip.dat "${pkgdir}/usr/share/xray/"

  install -Dm755 "./${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
  install -Dm644 "./${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
  install -Dm644 "./${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
  install -Dm644 "./${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
  install -Dm644 "./${pkgname}.timer" "${pkgdir}/usr/lib/systemd/system/${pkgname}.timer"
}