[c3e7c06] | 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. |
---|
[31f6347] | 6 | #@note This script will make the "ogagent" directory with 1.5 GiB approx. |
---|
[c3e7c06] | 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. |
---|
[3cc5bd2] | 14 | PROGDIR="$PWD/ogagent" |
---|
| 15 | BRANCH="branches/devel" |
---|
| 16 | SVNURL="https://github.com/opengnsys/OpenGnsys/$BRANCH/admin/Sources/Clients/ogagent" |
---|
[c3e7c06] | 17 | |
---|
| 18 | # Show prerequisites needed to build the environment. |
---|
[b6de0f0] | 19 | mkdir -p $PROGDIR || exit 1 |
---|
[c3e7c06] | 20 | cat << EOT |
---|
| 21 | |
---|
| 22 | OGAgent devoloping environment installation |
---|
| 23 | |
---|
| 24 | Prerequisites: |
---|
| 25 | - Install packages, if needed: |
---|
[3cc5bd2] | 26 | - Subversion |
---|
[435c10d] | 27 | - Wine for 32-bit (Winetricks may be required) |
---|
[c3e7c06] | 28 | - Python 2.7 with pyqt4-dev-tools |
---|
| 29 | - realpath |
---|
| 30 | - dpkg-dev |
---|
| 31 | - rpmbuild |
---|
[9d42c8e] | 32 | - xar |
---|
[c3e7c06] | 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 |
---|
[3cc5bd2] | 39 | # Downloading Visual C++ Redistributable. |
---|
| 40 | wget --unlink https://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe |
---|
[c3e7c06] | 41 | |
---|
| 42 | # Update PyQt components. |
---|
| 43 | pushd ogagent/src >/dev/null |
---|
| 44 | ./update.sh |
---|
| 45 | popd >/dev/null |
---|
| 46 | |
---|
| 47 | # Showing instructions to configure Wine. |
---|
| 48 | cat << EOT |
---|
| 49 | |
---|
| 50 | Manual actions: |
---|
| 51 | - After all downloads, install Gecko for Wine, if needed. |
---|
[435c10d] | 52 | - Press [Esc] key or "Cancel" button on Winetricks screen, if needed. |
---|
| 53 | - Accept default settings for all other components. |
---|
[c3e7c06] | 54 | - Uncheck all options on "Completing NSIS Setup" screen. |
---|
| 55 | Press [Enter] key to init downloads. |
---|
| 56 | |
---|
| 57 | EOT |
---|
| 58 | read |
---|
| 59 | |
---|
| 60 | # Downloading and configuring Wine prerequisites. |
---|
| 61 | pushd ogagent/windows >/dev/null |
---|
| 62 | ./py2exe-wine-linux.sh |
---|
| 63 | cp -a build.bat ogagent.nsi .. |
---|
| 64 | ln -s ../../.. wine/drive_c/ogagent |
---|
| 65 | popd >/dev/null |
---|
| 66 | |
---|
[9d42c8e] | 67 | # Download, compile and install bomutils. |
---|
[8db55ed] | 68 | mkdir -p ogagent/macos/downloads |
---|
| 69 | svn export https://github.com/hogliux/bomutils.git/trunk ogagent/macos/downloads/bomutils |
---|
| 70 | pushd ogagent/macos/downloads/bomutils >/dev/null |
---|
[31f6347] | 71 | make && sudo make install |
---|
[9d42c8e] | 72 | popd >/dev/null |
---|
| 73 | |
---|
[86b33ef] | 74 | # Build OGAgent for GNU/Linux. |
---|
[c3e7c06] | 75 | pushd $PROGDIR/linux >/dev/null |
---|
| 76 | sudo ./build-packages.sh |
---|
| 77 | popd >/dev/null |
---|
| 78 | |
---|
[9d42c8e] | 79 | # Build OGAgent for macOS. |
---|
| 80 | pushd $PROGDIR/macos >/dev/null |
---|
[3ca0b65] | 81 | ./build-pkg.sh |
---|
[9d42c8e] | 82 | popd >/dev/null |
---|
| 83 | |
---|
[c3e7c06] | 84 | # Build OGAgent for Windows. |
---|
| 85 | pushd $PROGDIR/windows >/dev/null |
---|
| 86 | ./build-windows.sh |
---|
| 87 | popd >/dev/null |
---|
| 88 | |
---|
| 89 | # Showing instructions to rebuild OGAgent packages. |
---|
| 90 | cat << EOT |
---|
| 91 | |
---|
| 92 | How to rebuild OGAgent packages |
---|
| 93 | ------------------------------- |
---|
| 94 | OGAgent project source code is available in $PROGDIR/src directory. |
---|
| 95 | |
---|
| 96 | - Commands to update PyQt graphical components for OGAgnet: |
---|
| 97 | cd $PROGDIR/src |
---|
| 98 | ./update.sh |
---|
| 99 | |
---|
[9d42c8e] | 100 | - Commands to rebuild Linux packages: |
---|
[c3e7c06] | 101 | cd $PROGDIR/linux |
---|
| 102 | sudo ./build-packages.sh |
---|
| 103 | |
---|
[9d42c8e] | 104 | - Commands to rebuild macOS package: |
---|
| 105 | cd $PROGDIR/macos |
---|
| 106 | ./build-pkg.sh |
---|
| 107 | |
---|
[c3e7c06] | 108 | - Commands to rebuild Windows installer: |
---|
| 109 | cd $PROGDIR/windows |
---|
| 110 | ./build-windows.sh |
---|
| 111 | |
---|
| 112 | OGAgent packages will be created into $PROGDIR directory. |
---|
| 113 | |
---|
| 114 | EOT |
---|
| 115 | |
---|