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 | BRANCH="master" |
---|
16 | SVNURL="https://github.com/opengnsys/OpenGnsys/branches/$BRANCH/admin/Sources/Clients/ogagent" |
---|
17 | |
---|
18 | # Show prerequisites needed to build the environment. |
---|
19 | mkdir -p $PROGDIR || exit 1 |
---|
20 | cat << EOT |
---|
21 | |
---|
22 | OGAgent devoloping environment installation |
---|
23 | |
---|
24 | Prerequisites: |
---|
25 | - Install packages, if needed: |
---|
26 | - Subversion |
---|
27 | - Wine for 32-bit (Winetricks may be required) |
---|
28 | - Python 2.7 with pyqt4-dev-tools |
---|
29 | - realpath |
---|
30 | - dpkg-dev |
---|
31 | - rpmbuild |
---|
32 | - xar |
---|
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 | # Downloading Visual C++ Redistributable. |
---|
40 | wget --unlink https://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe |
---|
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. |
---|
52 | - Press [Esc] key or "Cancel" button on Winetricks screen, if needed. |
---|
53 | - Accept default settings for all other components. |
---|
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 | |
---|
67 | # Download, compile and install bomutils. |
---|
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 |
---|
71 | make && sudo make install |
---|
72 | popd >/dev/null |
---|
73 | |
---|
74 | # Build OGAgent for GNU/Linux. |
---|
75 | pushd $PROGDIR/linux >/dev/null |
---|
76 | sudo ./build-packages.sh |
---|
77 | popd >/dev/null |
---|
78 | |
---|
79 | # Build OGAgent for macOS. |
---|
80 | pushd $PROGDIR/macos >/dev/null |
---|
81 | ./build-pkg.sh |
---|
82 | popd >/dev/null |
---|
83 | |
---|
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 | |
---|
100 | - Commands to rebuild Linux packages: |
---|
101 | cd $PROGDIR/linux |
---|
102 | sudo ./build-packages.sh |
---|
103 | |
---|
104 | - Commands to rebuild macOS package: |
---|
105 | cd $PROGDIR/macos |
---|
106 | ./build-pkg.sh |
---|
107 | |
---|
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 | |
---|