package.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # compile for version
  2. make
  3. if [ $? -ne 0 ]; then
  4. echo "make error"
  5. exit 1
  6. fi
  7. frp_version=`./bin/frps --version`
  8. echo "build version: $frp_version"
  9. # cross_compiles
  10. make -f ./Makefile.cross-compiles
  11. rm -rf ./release/packages
  12. mkdir -p ./release/packages
  13. os_all='linux windows darwin freebsd'
  14. arch_all='386 amd64 arm arm64 mips64 mips64le mips mipsle'
  15. cd ./release
  16. for os in $os_all; do
  17. for arch in $arch_all; do
  18. frp_dir_name="frp_${frp_version}_${os}_${arch}"
  19. frp_path="./packages/frp_${frp_version}_${os}_${arch}"
  20. if [ "x${os}" = x"windows" ]; then
  21. if [ ! -f "./frpc_${os}_${arch}.exe" ]; then
  22. continue
  23. fi
  24. if [ ! -f "./frps_${os}_${arch}.exe" ]; then
  25. continue
  26. fi
  27. mkdir ${frp_path}
  28. mv ./frpc_${os}_${arch}.exe ${frp_path}/frpc.exe
  29. mv ./frps_${os}_${arch}.exe ${frp_path}/frps.exe
  30. else
  31. if [ ! -f "./frpc_${os}_${arch}" ]; then
  32. continue
  33. fi
  34. if [ ! -f "./frps_${os}_${arch}" ]; then
  35. continue
  36. fi
  37. mkdir ${frp_path}
  38. mv ./frpc_${os}_${arch} ${frp_path}/frpc
  39. mv ./frps_${os}_${arch} ${frp_path}/frps
  40. fi
  41. cp ../LICENSE ${frp_path}
  42. cp -rf ../conf/* ${frp_path}
  43. # packages
  44. cd ./packages
  45. if [ "x${os}" = x"windows" ]; then
  46. zip -rq ${frp_dir_name}.zip ${frp_dir_name}
  47. else
  48. tar -zcf ${frp_dir_name}.tar.gz ${frp_dir_name}
  49. fi
  50. cd ..
  51. rm -rf ${frp_path}
  52. done
  53. done
  54. cd -