| 1 | #!/bin/bash | 
|---|
| 2 | #/** | 
|---|
| 3 | #@file     ogagent-devel-installer.sh | 
|---|
| 4 | #@brief    Script to download and prepare the environmnt to compile OGAgent packages. | 
|---|
| 5 | #@warning  Some operations need "root" privileges. | 
|---|
| 6 | #@note     This script will make the "ogagent" directory with 1.5 GiB approx. | 
|---|
| 7 | #@version  1.0 - Initial version for OpenGnsys 1.1.0. | 
|---|
| 8 | #@author   Ramón M. Gómez, ETSII Universidad de Sevilla | 
|---|
| 9 | #@date     2016-04-07 | 
|---|
| 10 | #*/ ## | 
|---|
| 11 |  | 
|---|
| 12 |  | 
|---|
| 13 | # Variables. | 
|---|
| 14 | PROGDIR=$PWD/ogagent | 
|---|
| 15 | SVNURL=https://opengnsys.es/svn/branches/version1.1/admin/Sources/Clients/ogagent | 
|---|
| 16 |  | 
|---|
| 17 | # Show prerequisites needed to build the environment. | 
|---|
| 18 | mkdir -p $PROGDIR || exit 1 | 
|---|
| 19 | cat << EOT | 
|---|
| 20 |  | 
|---|
| 21 | OGAgent devoloping environment installation | 
|---|
| 22 |  | 
|---|
| 23 | Prerequisites: | 
|---|
| 24 | - Install packages, if needed: | 
|---|
| 25 | - Wine for 32-bit (Winetricks may be required) | 
|---|
| 26 | - Python 2.7 with pyqt4-dev-tools | 
|---|
| 27 | - realpath | 
|---|
| 28 | - dpkg-dev | 
|---|
| 29 | - rpmbuild | 
|---|
| 30 | - xar | 
|---|
| 31 | - Open a web browser and download Microsoft Visual C++ 2010 Redistributable Package (x86) from: http://www.microsoft.com/en-us/download/details.aspx?id=5555 | 
|---|
| 32 | - Copy or move "vcredist_x86.exe" file to $PROGDIR directory. | 
|---|
| 33 | Press [Enter] key when ready to continue. | 
|---|
| 34 | EOT | 
|---|
| 35 | read | 
|---|
| 36 |  | 
|---|
| 37 | # Importing OGAgent source code. | 
|---|
| 38 | svn export --force $SVNURL $PROGDIR || exit 1 | 
|---|
| 39 |  | 
|---|
| 40 | # Update PyQt components. | 
|---|
| 41 | pushd ogagent/src >/dev/null | 
|---|
| 42 | ./update.sh | 
|---|
| 43 | popd >/dev/null | 
|---|
| 44 |  | 
|---|
| 45 | # Showing instructions to configure Wine. | 
|---|
| 46 | cat << EOT | 
|---|
| 47 |  | 
|---|
| 48 | Manual actions: | 
|---|
| 49 | - After all downloads, install Gecko for Wine, if needed. | 
|---|
| 50 | - Press [Esc] key or "Cancel" button on Winetricks screen, if needed. | 
|---|
| 51 | - Accept default settings for all other components. | 
|---|
| 52 | - Uncheck all options on "Completing NSIS Setup" screen. | 
|---|
| 53 | Press [Enter] key to init downloads. | 
|---|
| 54 |  | 
|---|
| 55 | EOT | 
|---|
| 56 | read | 
|---|
| 57 |  | 
|---|
| 58 | # Downloading and configuring Wine prerequisites. | 
|---|
| 59 | pushd ogagent/windows >/dev/null | 
|---|
| 60 | ./py2exe-wine-linux.sh | 
|---|
| 61 | cp -a build.bat ogagent.nsi .. | 
|---|
| 62 | ln -s ../../.. wine/drive_c/ogagent | 
|---|
| 63 | popd >/dev/null | 
|---|
| 64 |  | 
|---|
| 65 | # Download, compile and install bomutils. | 
|---|
| 66 | mkdir -p ogagent/macos/downloads | 
|---|
| 67 | svn export https://github.com/hogliux/bomutils.git/trunk ogagent/macos/downloads/bomutils | 
|---|
| 68 | pushd ogagent/macos/downloads/bomutils >/dev/null | 
|---|
| 69 | make && sudo make install | 
|---|
| 70 | popd >/dev/null | 
|---|
| 71 |  | 
|---|
| 72 | # Build OGAgent for GNU/Linux. | 
|---|
| 73 | pushd $PROGDIR/linux >/dev/null | 
|---|
| 74 | sudo ./build-packages.sh | 
|---|
| 75 | popd >/dev/null | 
|---|
| 76 |  | 
|---|
| 77 | # Build OGAgent for macOS. | 
|---|
| 78 | pushd $PROGDIR/macos >/dev/null | 
|---|
| 79 | ./build-pkg.sh | 
|---|
| 80 | popd >/dev/null | 
|---|
| 81 |  | 
|---|
| 82 | # Build OGAgent for Windows. | 
|---|
| 83 | pushd $PROGDIR/windows >/dev/null | 
|---|
| 84 | ./build-windows.sh | 
|---|
| 85 | popd >/dev/null | 
|---|
| 86 |  | 
|---|
| 87 | # Showing instructions to rebuild OGAgent packages. | 
|---|
| 88 | cat << EOT | 
|---|
| 89 |  | 
|---|
| 90 | How to rebuild OGAgent packages | 
|---|
| 91 | ------------------------------- | 
|---|
| 92 | OGAgent project source code is available in $PROGDIR/src directory. | 
|---|
| 93 |  | 
|---|
| 94 | - Commands to update PyQt graphical components for OGAgnet: | 
|---|
| 95 | cd $PROGDIR/src | 
|---|
| 96 | ./update.sh | 
|---|
| 97 |  | 
|---|
| 98 | - Commands to rebuild Linux packages: | 
|---|
| 99 | cd $PROGDIR/linux | 
|---|
| 100 | sudo ./build-packages.sh | 
|---|
| 101 |  | 
|---|
| 102 | - Commands to rebuild macOS package: | 
|---|
| 103 | cd $PROGDIR/macos | 
|---|
| 104 | ./build-pkg.sh | 
|---|
| 105 |  | 
|---|
| 106 | - Commands to rebuild Windows installer: | 
|---|
| 107 | cd $PROGDIR/windows | 
|---|
| 108 | ./build-windows.sh | 
|---|
| 109 |  | 
|---|
| 110 | OGAgent packages will be created into $PROGDIR directory. | 
|---|
| 111 |  | 
|---|
| 112 | EOT | 
|---|
| 113 |  | 
|---|