1
0

package.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 ./packages
  12. mkdir ./packages
  13. os_all='linux windows darwin'
  14. arch_all='386 amd64 arm mips64 mips64le mips mipsle'
  15. for os in $os_all; do
  16. for arch in $arch_all; do
  17. frp_dir_name="frp_${frp_version}_${os}_${arch}"
  18. frp_path="./packages/frp_${frp_version}_${os}_${arch}"
  19. if [ "x${os}" = x"windows" ]; then
  20. if [ ! -f "./frpc_${os}_${arch}.exe" ]; then
  21. continue
  22. fi
  23. if [ ! -f "./frps_${os}_${arch}.exe" ]; then
  24. continue
  25. fi
  26. mkdir ${frp_path}
  27. mv ./frpc_${os}_${arch}.exe ${frp_path}/frpc.exe
  28. mv ./frps_${os}_${arch}.exe ${frp_path}/frps.exe
  29. else
  30. if [ ! -f "./frpc_${os}_${arch}" ]; then
  31. continue
  32. fi
  33. if [ ! -f "./frps_${os}_${arch}" ]; then
  34. continue
  35. fi
  36. mkdir ${frp_path}
  37. mv ./frpc_${os}_${arch} ${frp_path}/frpc
  38. mv ./frps_${os}_${arch} ${frp_path}/frps
  39. fi
  40. cp ./LICENSE ${frp_path}
  41. cp ./conf/* ${frp_path}
  42. # packages
  43. cd ./packages
  44. if [ "x${os}" = x"windows" ]; then
  45. zip -rq ${frp_dir_name}.zip ${frp_dir_name}
  46. else
  47. tar -zcf ${frp_dir_name}.tar.gz ${frp_dir_name}
  48. fi
  49. cd ..
  50. rm -rf ${frp_path}
  51. done
  52. done