fix build files

pull/1313/head^2
Darien Raymond 2018-10-03 22:06:21 +02:00
parent 2ca33e6a5b
commit 6e26fb5835
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
4 changed files with 16 additions and 5 deletions

View File

@ -2,8 +2,7 @@ package(default_visibility=["//visibility:public"])
load("@v2ray_ext//bazel:build.bzl", "foreign_go_binary") load("@v2ray_ext//bazel:build.bzl", "foreign_go_binary")
load("@v2ray_ext//bazel:zip.bzl", "pkg_zip") load("@v2ray_ext//bazel:zip.bzl", "pkg_zip")
load("@v2ray_ext//bazel:gpg.bzl", "gpg_sign")
package(default_visibility=["//visibility:public"])
foreign_go_binary( foreign_go_binary(
name = "v2ray_linux_amd64", name = "v2ray_linux_amd64",
@ -30,7 +29,7 @@ filegroup(
filegroup( filegroup(
name = "systemd", name = "systemd",
srcs = ["config/systemd/v2ray.service", "config/systemv/v2ray"], srcs = ["config/systemd_v2ray.service", "config/systemv_v2ray"],
) )
filegroup( filegroup(
@ -38,6 +37,11 @@ filegroup(
srcs = glob(["doc/*.md"]), srcs = glob(["doc/*.md"]),
) )
filegroup(
name = "geodata",
srcs = ["config/geoip.dat", "config/geosite.dat"],
)
pkg_zip( pkg_zip(
name = "v2ray_linux_amd64_package", name = "v2ray_linux_amd64_package",
srcs = [ srcs = [
@ -48,6 +52,7 @@ pkg_zip(
":config_all", ":config_all",
":systemd", ":systemd",
":doc", ":doc",
":geodata",
], ],
out = "v2ray-linux-64.zip", out = "v2ray-linux-64.zip",
) )

View File

@ -269,17 +269,23 @@ installV2Ray(){
installInitScript(){ installInitScript(){
if [[ -f "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemd/v2ray.service" ]]; then
cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemd/v2ray.service" "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemd_v2ray.service"
fi
if [[ -f "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" ]]; then
cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv_v2ray"
fi
if [[ -n "${SYSTEMCTL_CMD}" ]];then if [[ -n "${SYSTEMCTL_CMD}" ]];then
if [[ ! -f "/etc/systemd/system/v2ray.service" ]]; then if [[ ! -f "/etc/systemd/system/v2ray.service" ]]; then
if [[ ! -f "/lib/systemd/system/v2ray.service" ]]; then if [[ ! -f "/lib/systemd/system/v2ray.service" ]]; then
cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemd/v2ray.service" "/etc/systemd/system/" cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemd_v2ray.service" "/etc/systemd/system/"
systemctl enable v2ray.service systemctl enable v2ray.service
fi fi
fi fi
return return
elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then
installSoftware "daemon" || return $? installSoftware "daemon" || return $?
cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv/v2ray" "/etc/init.d/v2ray" cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/systemv_v2ray" "/etc/init.d/v2ray"
chmod +x "/etc/init.d/v2ray" chmod +x "/etc/init.d/v2ray"
update-rc.d v2ray defaults update-rc.d v2ray defaults
fi fi