Permalink
Browse files

*** empty log message ***

  • Loading branch information...
scuri
scuri committed Feb 26, 2011
1 parent adce282 commit c070430a6ab0bb3113fd610c636a5a74dde4f984
Showing with 139 additions and 54 deletions.
  1. +26 −0 LINSTALL
  2. +13 −14 config_lua_module
  3. +10 −14 install
  4. +12 −17 install_dev
  5. +28 −9 tec_uname
  6. +50 −0 uninstall
View
@@ -0,0 +1,26 @@
+INSTALL for CD on Linux
+
+ The CD 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 "cd-X.X_Linux26g4_lib.tar.gz" or "cd-X.X_Linux26g4_64_lib.tar.gz".
+
+ Create a folder and unpack the files:
+
+ mkdir cd
+ cd cd
+ tar -xpvzf ../cd-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 CD's web site at http://www.tecgraf.puc-rio.br/cd
+ or access its documentation in the HTML folder.
+
+(end of INSTALL)
View
@@ -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 cdlua
Make_Lua_Link cdluacontextplus
View
24 install
@@ -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 cd'
+ echo ' cd cd'
+ echo ' tar -xpvzf ../cd-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 cd
View
@@ -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 cd'
+ echo ' cd cd'
+ echo ' tar -xpvzf ../cd-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 cd
View
@@ -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
}
View
@@ -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 cd

0 comments on commit c070430

Please sign in to comment.