install 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. #....
  3. # Make sure only root can run our script
  4. # Retrouver le nombre de thread disponibles
  5. #cat /proc/cpuinfo | grep processor | wc -l
  6. if [ "$(id -u)" != "0" ]; then
  7. echo "Veuillez passer en mode super utilisateur"
  8. else
  9. #script lance en mode super utilisateur
  10. echo "Installation de la bibliotheque"
  11. echo "----------------------------------"
  12. echo ""
  13. echo ""
  14. make
  15. mv lib/liba2ri_dyn.so lib/liba2ri.so
  16. cp lib/liba2ri* /usr/local/lib/
  17. rm -rf /usr/local/include/a2ri
  18. mkdir /usr/local/include/a2ri
  19. cp include/*.h /usr/local/include/a2ri/
  20. chmod -R 755 /usr/local/include/a2ri
  21. mkdir /usr/local/share/doc/a2ri/
  22. cp -r doc/* /usr/local/share/doc/a2ri/
  23. rm -rf /usr/local/share/doc/a2ri/CVS
  24. rm -rf /usr/local/share/doc/a2ri/*/CVS
  25. rm -rf /usr/local/share/doc/a2ri/*/*/CVS
  26. rm -rf /usr/local/share/doc/a2ri/*/*/*/CVS
  27. rm -rf /usr/local/share/doc/a2ri/*/*/*/*/CVS
  28. cp -r examples /usr/local/share/doc/a2ri/
  29. mv lib/liba2ri.so lib/liba2ri_dyn.so
  30. make clean
  31. ldconfig
  32. echo ""
  33. echo ""
  34. echo "----------------------------------"
  35. echo "Les fichiers sont installes dans les repertoires /usr/local/include/a2ri/:/usr/local/lib/:/usr/local/share/doc/a2ri/"
  36. i=`grep "include /usr/local/lib" /etc/ld.so.conf | wc -l`
  37. if [[ $i -eq 0 ]]
  38. then
  39. echo "include /usr/local/lib/" >> /etc/ld.so.conf
  40. ldconfig
  41. fi
  42. fi