diff options
-rw-r--r-- | LINSTALL | 26 | ||||
-rw-r--r-- | config_lua_module | 27 | ||||
-rw-r--r-- | install | 24 | ||||
-rw-r--r-- | install_dev | 29 | ||||
-rw-r--r-- | tec_uname | 37 | ||||
-rw-r--r-- | uninstall | 50 |
6 files changed, 139 insertions, 54 deletions
diff --git a/LINSTALL b/LINSTALL new file mode 100644 index 0000000..3476c44 --- /dev/null +++ b/LINSTALL @@ -0,0 +1,26 @@ +INSTALL for IM on Linux + + The IM documentation contains a guide to help you build and install the major Tecgraf libraries in Linux. It is available in "Guide"/"Building in Linux". There you will find the external dependencies you need to install to build from sources and how to use the available scripts to install the necessary files in the system. + + Only the simplest installation procedure is described here. + + Download the pre-compile binaries, usually "im-X.X_Linux26g4_lib.tar.gz" or "im-X.X_Linux26g4_64_lib.tar.gz". + + Create a folder and unpack the files: + + mkdir im + cd im + tar -xpvzf ../im-X.X_Linux26g4_lib.tar.gz + + To install the run time libraries (dynamic libraries), run the "install" script. + + To install the development files (includes and static libraries), run the "install_dev" script. + + To configure the run time libraries as Lua modules, run the "config_lua_module" script. + + All scripts don't need parameters. They need root privileges. If they fail check the Guide at the documentation. + + For complete information, visit IM's web site at http://www.tecgraf.puc-rio.br/im + or access its documentation in the HTML folder. + +(end of INSTALL) diff --git a/config_lua_module b/config_lua_module index d95e2f3..da61413 100644 --- a/config_lua_module +++ b/config_lua_module @@ -1,8 +1,11 @@ #!/bin/bash +# Include TEC_UNAME definitions +source tec_uname + echo ' ' echo ' This script will configure the Tecgraf libraries in the system' -echo ' to be used from Lua. It was tested only in Ubuntu and in Fedora.' +echo ' to be used from Lua. It was tested in Ubuntu and in Fedora.' echo ' ' echo ' The Run Time libraries must be already installed on the system (see the install script).' echo ' It assumes that Lua binaries are installed using system packages.' @@ -11,24 +14,20 @@ echo ' Must be run with "sudo", or install will fail,' echo ' for example:' echo ' sudo ./config_lua_module' echo ' ' -echo -n Press Enter to continue or Ctrl+C to abort... -read contscr -echo ' ' - -if [ -d /usr/lib64 ]; then - SYSTEM_LIB=/usr/lib64 -else - SYSTEM_LIB=/usr/lib -fi -LUA_LIB=$SYSTEM_LIB/lua/5.1 Make_Lua_Link() { - ln -fsv $SYSTEM_LIB/lib$1'51'.so $1.so + ln -fsv $TEC_SYSTEM_LIB/lib$1'51'.so $1.so } -mkdir -p $LUA_LIB -cd $LUA_LIB +# From tec_uname script +ComputeTecUname +ComputeSystemPaths +#PrintInfo + +Pause +mkdir -p $TEC_LUA_LIB +cd $TEC_LUA_LIB Make_Lua_Link imlua Make_Lua_Link imlua_process @@ -3,13 +3,6 @@ # Include TEC_UNAME definitions source tec_uname -# System paths -if [ -d /usr/lib64 ]; then - SYSTEM_LIB=/usr/lib64 -else - SYSTEM_LIB=/usr/lib -fi - echo ' ' echo ' This script will install the >>Run Time<< libraries in the system' echo ' from the build directories or from the unpacked download.' @@ -24,24 +17,24 @@ EchoDownloadTip() echo ' The downloaded package must already be unpacked in the current directory.' echo ' Do NOT unpack different packages in the same directory.' echo ' For example:' - echo ' mkdir iup' - echo ' cd iup' - echo ' tar -xpvzf ../iup-3.2_Linux26g4_lib.tar.gz' + echo ' mkdir im' + echo ' cd im' + echo ' tar -xpvzf ../im-X.X_Linux26g4_lib.tar.gz' echo ' ' } Copy_RunTime_Extra_CD() { # Do NOT overwrite for FreeType - cp -fn $1libfreetype.so $SYSTEM_LIB + cp -fn $1libfreetype.so $TEC_SYSTEM_LIB - cp -fv $1libpdflib.so $SYSTEM_LIB - cp -fv $1libftgl.so $SYSTEM_LIB + cp -fv $1libpdflib.so $TEC_SYSTEM_LIB + cp -fv $1libftgl.so $TEC_SYSTEM_LIB } Copy_RunTime_To_System() { - cp -fv $2lib$1*.so $SYSTEM_LIB + cp -fv $2lib$1*.so $TEC_SYSTEM_LIB if [ $1 == cd ]; then Copy_RunTime_Extra_CD $2 @@ -65,6 +58,9 @@ Install_RunTime() fi } +# From tec_uname script ComputeTecUname +ComputeSystemPaths +#PrintInfo Install_RunTime im diff --git a/install_dev b/install_dev index db1938c..9bb4614 100644 --- a/install_dev +++ b/install_dev @@ -3,14 +3,6 @@ # Include TEC_UNAME definitions source tec_uname -# System paths -if [ -d /usr/lib64 ]; then - SYSTEM_LIB=/usr/lib64 -else - SYSTEM_LIB=/usr/lib -fi -SYSTEM_INC=/usr/include - echo ' ' echo ' This script will install the >>Development<< files in the system' echo ' from the build directories or from the unpacked download.' @@ -25,26 +17,26 @@ EchoDownloadTip() echo ' The downloaded package must already be unpacked in the current directory.' echo ' Do NOT unpack different packages in the same directory.' echo ' For example:' - echo ' mkdir iup' - echo ' cd iup' - echo ' tar -xpvzf ../iup-3.2_Linux26g4_lib.tar.gz' + echo ' mkdir im' + echo ' cd im' + echo ' tar -xpvzf ../im-X.X_Linux26g4_lib.tar.gz' echo ' ' } Copy_Dev_Extra_CD() { # Do NOT overwrite for FreeType - cp -fn $1libfreetype.a $SYSTEM_LIB + cp -fn $1libfreetype.a $TEC_SYSTEM_LIB - cp -fv $1libpdflib.a $SYSTEM_LIB - cp -fv $1libftgl.a $SYSTEM_LIB + cp -fv $1libpdflib.a $TEC_SYSTEM_LIB + cp -fv $1libftgl.a $TEC_SYSTEM_LIB } Copy_Dev_To_System() { - mkdir -p $SYSTEM_INC/$1 - cp -fv include/*.h $SYSTEM_INC/$1 - cp -fv $2lib$1*.a $SYSTEM_LIB + mkdir -p $TEC_SYSTEM_INC/$1 + cp -fv include/*.h $TEC_SYSTEM_INC/$1 + cp -fv $2lib$1*.a $TEC_SYSTEM_LIB if [ $1 == cd ]; then Copy_Dev_Extra_CD $2 @@ -68,6 +60,9 @@ Install_Dev() fi } +# From tec_uname script ComputeTecUname +ComputeSystemPaths +#PrintInfo Install_Dev im @@ -124,14 +124,33 @@ ComputeTecUname() fi fi fi - - TU_DEBUG=1 - if [ $TU_DEBUG == 1 ]; then - echo ' ' - echo ' Info:' - echo 'TEC_SYSNAME='$TEC_SYSNAME - echo 'TEC_SYSVERSION='$TEC_SYSVERSION - echo 'TEC_SYSMINOR='$TEC_SYSMINOR - echo 'TEC_SYSARCH='$TEC_SYSARCH +} + +ComputeSystemPaths() +{ + if [ $TEC_SYSARCH == x64 ]; then + if [ -d /usr/lib64 ]; then + TEC_SYSTEM_LIB=/usr/lib64 + else + TEC_SYSTEM_LIB=/usr/lib + fi + else + TEC_SYSTEM_LIB=/usr/lib fi + + TEC_SYSTEM_INC=/usr/include + + TEC_LUA_LIB=$TEC_SYSTEM_LIB/lua/5.1 +} + +PrintInfo() +{ + echo ' ' + echo ' Info:' + echo 'TEC_SYSNAME='$TEC_SYSNAME + echo 'TEC_SYSVERSION='$TEC_SYSVERSION + echo 'TEC_SYSMINOR='$TEC_SYSMINOR + echo 'TEC_SYSARCH='$TEC_SYSARCH + echo 'TEC_SYSTEM_LIB='$TEC_SYSTEM_LIB + echo 'TEC_SYSTEM_INC='$TEC_SYSTEM_INC } diff --git a/uninstall b/uninstall new file mode 100644 index 0000000..804f3a7 --- /dev/null +++ b/uninstall @@ -0,0 +1,50 @@ +#!/bin/bash + +# Include TEC_UNAME definitions +source tec_uname + +echo ' ' +echo ' This script will uninstall both the >>Run Time<< libraries' +echo ' and the >>Development<< files from the system' +echo ' It was tested in Ubuntu and in Fedora.' +echo ' ' +echo ' Must be run with "sudo" at the library folder, or install will fail:' +echo ' sudo ./uninstall' +echo ' ' + +Remove_Lua_Links() +{ + LUA_LIB=$TEC_SYSTEM_LIB/lua/5.1 + rm -fv $LUA_LIB/$1lua*.so +} + +Remove_Extra_CD() +{ + # Do NOT remove FreeType + + rm -fv $TEC_SYSTEM_LIB/libpdflib.a + rm -fv $TEC_SYSTEM_LIB/libftgl.a + rm -fv $TEC_SYSTEM_LIB/libpdflib.so + rm -fv $TEC_SYSTEM_LIB/libftgl.so +} + +Remove_From_System() +{ + rm -frv $TEC_SYSTEM_INC/$1 + rm -fv $TEC_SYSTEM_LIB/lib$1*.a + rm -fv $TEC_SYSTEM_LIB/lib$1*.so + + if [ $1 == cd ]; then + Remove_Extra_CD + fi + + Remove_Lua_Links $1 +} + +# From tec_uname script +ComputeTecUname +ComputeSystemPaths +#PrintInfo + +Pause +Remove_From_System im |