derle.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. if [ -z $MPS_PATH ];then
  3. MPS_PATH="/usr/milis/mps"
  4. fi
  5. if [ ! -z $1 ];then
  6. MPS_PATH="$1"
  7. fi
  8. if [ ! -d $MPS_PATH ];then
  9. echo "$MPS_PATH dizini mevcut değil!"
  10. exit 1
  11. fi
  12. cd $MPS_PATH/src
  13. # lua kütüphanelerinin derlenip-yüklenmesi
  14. # 0 temizlik
  15. [ -d $MPS_PATH/lua/ext ] && mv $MPS_PATH/lua/ext $MPS_PATH/lua/ext.old
  16. mkdir -p $MPS_PATH/lua/ext
  17. # 1- luafilesystem
  18. cd luafilesystem && make clean && make && cp -rf src/*.so $MPS_PATH/lua/ext/ && make clean
  19. cd -
  20. # 2- luasocket
  21. cd luasocket && make clean && MYCFLAGS=$CFLAGS MYLDFLAGS=$LDFLAGS make LUAV=5.3 linux
  22. mkdir /tmp/pkg.socket
  23. make DESTDIR=/tmp/pkg.socket LUAV=5.3 prefix=/usr install-unix
  24. cp -rf /tmp/pkg.socket/usr/lib/lua/5.3/* $MPS_PATH/lua/ext/
  25. cp -rf /tmp/pkg.socket/usr/share/lua/5.3/* $MPS_PATH/lua/ext/
  26. rm -rf /tmp/pkg.socket
  27. make clean
  28. cd -
  29. # 3- lua-sec ssl support
  30. cd luasec && make clean && make linux DEFS="-DWITH_LUASOCKET -DOPENSSL_NO_SSL3"
  31. mkdir /tmp/pkg.sec
  32. make LUACPATH="/tmp/pkg.sec/usr/lib/lua/5.3" LUAPATH="/tmp/pkg.sec/usr/share/lua/5.3" install
  33. cp -rf /tmp/pkg.sec/usr/lib/lua/5.3/* $MPS_PATH/lua/ext/
  34. cp -rf /tmp/pkg.sec/usr/share/lua/5.3/* $MPS_PATH/lua/ext/
  35. rm -rf /tmp/pkg.sec
  36. make clean
  37. cd -
  38. # 4 temizlik
  39. rm -rf $MPS_PATH/lua/ext.old
  40. # exe
  41. chmod +x $MPS_PATH/bin/mps*.lua