diff options
author | Gzxhwq | 2021-12-25 00:31:30 +0800 |
---|---|---|
committer | Gzxhwq | 2021-12-25 00:31:30 +0800 |
commit | 2383f1da4c3f4043807ba3805ea025b5f749ecd8 (patch) | |
tree | 89678f839203b074c8e8f29d4e96ca25a7080a0b | |
download | aur-2383f1da4c3f4043807ba3805ea025b5f749ecd8.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 42 | ||||
-rw-r--r-- | PKGBUILD | 56 | ||||
-rwxr-xr-x | v2ray-rules-dat-autoupdate | 35 | ||||
-rw-r--r-- | v2ray-rules-dat-autoupdate.install | 8 | ||||
-rw-r--r-- | v2ray-rules-dat-autoupdate.service | 11 | ||||
-rw-r--r-- | v2ray-rules-dat-autoupdate.sysusers | 3 | ||||
-rw-r--r-- | v2ray-rules-dat-autoupdate.timer | 6 | ||||
-rw-r--r-- | v2ray-rules-dat-autoupdate.tmpfiles | 2 |
8 files changed, 163 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1f533a87de8e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,42 @@ +pkgbase = v2ray-rules-dat-autoupdate + pkgdesc = Enhanced edition of V2Ray and Xray rules dat files, compatible with Trojan-Go. Automaitcally update. + pkgver = 1.0 + pkgrel = 1 + url = https://github.com/Loyalsoldier/v2ray-rules-dat + install = v2ray-rules-dat-autoupdate.install + arch = any + license = GPL + makedepends = git + depends = curl + provides = xray-domain-list-community + provides = xray-geoip + provides = v2ray-domain-list-community + provides = v2ray-geoip + provides = v2ray-domain-list-custom + provides = v2ray-geoip-custom + provides = v2ray-rules-dat-git + provides = vxray-rules-dat-git + conflicts = xray-domain-list-community + conflicts = xray-geoip + conflicts = v2ray-domain-list-community + conflicts = v2ray-geoip + conflicts = v2ray-domain-list-custom + conflicts = v2ray-geoip-custom + conflicts = v2ray-rules-dat-git + conflicts = vxray-rules-dat-git + source = https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/rules.zip + source = v2ray-rules-dat-autoupdate + source = v2ray-rules-dat-autoupdate.install + source = v2ray-rules-dat-autoupdate.sysusers + source = v2ray-rules-dat-autoupdate.tmpfiles + source = v2ray-rules-dat-autoupdate.service + source = v2ray-rules-dat-autoupdate.timer + sha256sums = fa954de1d86de38ffec91fed6ee0b958ad3fbb42892c6dd6ceeff7db8e3a30c0 + sha256sums = 1fd7c4f89bb0b89520b1615a5d6e1372a90a3b13ecb1c6669825c44cc52169b4 + sha256sums = d5deeb9e02b2cf6e233da4369bb7d74e06054bd54ee9e62875f3342d7c931dbd + sha256sums = 5d0fac85c93516f45281f3e45071f4f98c4a9eadfbd72602129c888c823b79ef + sha256sums = ea8090be783d0d60f441d25ddad9686b75e5b8405311cc21d29235e80b1671b7 + sha256sums = 639f27779662970c2d476c4e9af73d7f7f34c1ec5241f43ce95e3231e9a58ea8 + sha256sums = 5bd55042d53d3794f27483277056f06f5e55d0e7702b0093ec6f17d7da6d548c + +pkgname = v2ray-rules-dat-autoupdate diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..18b7c5b2e89b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,56 @@ +# 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.0 +pkgrel=1 +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=("${url}/releases/latest/download/rules.zip" + "${pkgname}" + "${pkgname}.install" + "${pkgname}.sysusers" + "${pkgname}.tmpfiles" + "${pkgname}.service" + "${pkgname}.timer") + +sha256sums=($(curl -sL ${url}/releases/latest/download/rules.zip.sha256sum | awk '{print $1}') + '1fd7c4f89bb0b89520b1615a5d6e1372a90a3b13ecb1c6669825c44cc52169b4' + '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/" + ln -sf "/var/lib/${_pkgname}" "${pkgdir}/usr/share/v2ray" + ln -sf "/var/lib/${_pkgname}" "${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" +} diff --git a/v2ray-rules-dat-autoupdate b/v2ray-rules-dat-autoupdate new file mode 100755 index 000000000000..f4cc8e41ce89 --- /dev/null +++ b/v2ray-rules-dat-autoupdate @@ -0,0 +1,35 @@ +#!/bin/bash + +set -e + +FastGit="https://hub.fastgit.org/Loyalsoldier/v2ray-rules-dat/releases/latest" +GitHub="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download" +JsDelivr="https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release" +CfCDN="https://cfgit.cern.ga/Loyalsoldier/v2ray-rules-dat/releases/latest/download" + +download_files() { + echo "Fetching rules.zip" + curl -LO "${1}/rules.zip{,.sha256sum}" + sha256sum --check "rules.zip.sha256sum" + + bsdtar -xf ./rules.zip + + rm -vf $(find . -maxdepth 1 -type f ! -name "geo*.dat") +# cp -vf --reflink=auto *.dat /usr/share/v2ray/ +# echo /usr/share/v2ray/ /usr/share/xray/ | xargs -n 1 cp -vf --reflink *.dat +} + +case "${1}" in +"fastgit" | "fg") + download_files $FastGit + ;; +"jsdelivr" | "js") + download_files $JsDelivr + ;; +"cfcdn" | "cf") + download_files $CfCDN + ;; +*) + download_files $GitHub + ;; +esac diff --git a/v2ray-rules-dat-autoupdate.install b/v2ray-rules-dat-autoupdate.install new file mode 100644 index 000000000000..8fc69cb5b775 --- /dev/null +++ b/v2ray-rules-dat-autoupdate.install @@ -0,0 +1,8 @@ +post_install() { + systemctl enable --now v2ray-rules-dat-autoupdate.timer +} + +pre_remove() { + systemctl disable v2ray-rules-dat-autoupdate.timer +} + diff --git a/v2ray-rules-dat-autoupdate.service b/v2ray-rules-dat-autoupdate.service new file mode 100644 index 000000000000..71df46446fc5 --- /dev/null +++ b/v2ray-rules-dat-autoupdate.service @@ -0,0 +1,11 @@ +[Unit] +Description = Service for update v2ray-dat-rules files +After = network.target + +[Service] +Type = oneshot +User = v2ray-rules-dat +Group = v2ray-rules-dat + +WorkingDirectory = /var/lib/v2ray-rules-dat +ExecStart = /usr/bin/v2ray-rules-dat-autoupdate diff --git a/v2ray-rules-dat-autoupdate.sysusers b/v2ray-rules-dat-autoupdate.sysusers new file mode 100644 index 000000000000..f3c023bd4b7a --- /dev/null +++ b/v2ray-rules-dat-autoupdate.sysusers @@ -0,0 +1,3 @@ +g v2ray-rules-dat - -
+u v2ray-rules-dat - "account for v2ray-rules-dat autoupdate" /var/lib/v2ray-rules-dat
+m v2ray-rules-dat v2ray-rules-dat
\ No newline at end of file diff --git a/v2ray-rules-dat-autoupdate.timer b/v2ray-rules-dat-autoupdate.timer new file mode 100644 index 000000000000..3cc2d16e4e0e --- /dev/null +++ b/v2ray-rules-dat-autoupdate.timer @@ -0,0 +1,6 @@ +[Timer] +OnCalendar = daily +Persistent = true + +[Install] +WantedBy = timers.target diff --git a/v2ray-rules-dat-autoupdate.tmpfiles b/v2ray-rules-dat-autoupdate.tmpfiles new file mode 100644 index 000000000000..2a6a349b36de --- /dev/null +++ b/v2ray-rules-dat-autoupdate.tmpfiles @@ -0,0 +1,2 @@ +d /var/lib/v2ray-rules-dat 0755 v2ray-rules-dat v2ray-rules-dat - - +Z /var/lib/v2ray-rules-dat - v2ray-rules-dat v2ray-rules-dat - - |