http://archive.groundworkopensource.com/groundwork-opensource/trunk/build/BUILD_INSTRUCTIONS_GWMON-5.2 Date: 2007-04-27 10:09:57 -0700 (Fri, 27 April 2007) GroundWork Monitor 5.2 Copyright (C) 2008 GroundWork Open Source, Inc. (GroundWork) All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BUILD INSTRUCTIONS ------------------ Building GroundWork Monitor Open Source 5.0-alpha from source requires 1) preparing build environment, 2) installing prerequisite software components, and 3) executing the build script. The following information presents the instructions for building from source. PREREQUISITES ------------- These steps describe how to set up the development environment. Currently, these instructions have been used to perform successful builds on the following platforms: specialized instructions for a specific platform, where they exist, are denoted with the appropriate heading (e.g. CentOS 4 instructions are proceeded by (CENTOS4). RedHat Enterprise Linux 4 (RHEL4) RedHat Enterprise Linux 5 (RHEL5) Open SuSE 9 (32 bit only) Open SuSE 10 CentOS 4 (CENTOS4) We will add instructions for new environments as the project continues toward a stable release. *** Feedback is invited! Please post corrections and/or improvements to this document to the GroundWork Community Support Forums: http://www.groundworkopensource.com/community/forums/ *** Development Environment ----------------------- 1. These packages must be installed before attempting a build of GroundWork Monitor Open Source: gcc (3.4.3-9 or later) gcc-c++ (3.4.3-9 or later) glibc (3.4.3-9 or later) Java Development Toolkit (JDK) (1.5.0_05 or later) MySQL Database server (5.0.18 or later) Subversion (version 1.3 or later) ant (1.6.5 - get it from GroundWork - see below) maven (1.0.2 - get it from GroundWork - see below) Check for the existence of and the correct version of any and all of these packages with "rpm -qa | grep packagename". For example, to verify that these packages are installed and are of the correct version: 1. Execute this command to check gcc and gcc-c++ % rpm -qa |grep gcc expect this output: gcc-3.4.3-9.EL4 libgcc-3.4.3-9.EL4 gcc-c++-3.4.3-9.EL4 2. Execute this command to check glibc % rpm -qa |grep glibc expect this output glibc-2.3.4-2 glibc-devel-2.3.4-2 glibc-headers-2.3.4-2 2. Make sure that rpm-devel package is not installed. It conflicts with the libbeecrypt compilation. To verify that this package is not installed: 1. Execute this command to check rpm-devel: % rpm -qa | grep rpm-devel If you see this output: rpm-devel-4.3.3-13_nonptl (or any version of rpm-devel) you need to uninstall rpm-devel. See next. 2. Execute this command to uninstall rpm-devel: % rpm -e rpm-devel-4.3.3 (specify the version according to what you have installed.) 3. Installing Java 5 Download and install JDK 1.5 from http://java.sun.com/. Install by following Sun's instructions for your platform. Change the link in /etc/alternatives/java to point to the Java5 install (/usr/java/jdk1.5.0_05/bin/java). 4. Installing MySQL 5.0 (RHEL4) RedHat installs some MySQL4 packages. You can identify the versions of the packages with this command: rpm -qa | grep -i mysql To uninstall run this command, replacing XX with the version identified above. rpm -e mysql-client-XX cyrus-sasl-sql-2.1.19-5.EL4.i386 Download the MySQL rpm files from the MySQL web site. Here are the packages: MySQL-server-standard-5.0.24-0.rhel4.i386.rpm MySQL-client-standard-5.0.24-0.rhel4.i386.rpm MySQL-shared-standard-5.0.24-0.rhel4.i386.rpm MySQL-devel-standard-5.0.24-0.rhel4.i386.rpm If you put all the files into the same temporary directory, rpm can install them all, in the right order, with a single command: cd /tmp/mysql rpm -Uvh MySQL-* (CENTOS4) You need to get the CentOS-specific MySQL 5 packages available from: http://mirror.centos.org/centos/4/centosplus/i386/RPMS/ You need the following files, installed in this order: mysqlclient14-4.1.14-4.2.c4.1.i386.rpm mysql-5.0.22-1.centos.1.i386.rpm (you may need the CentOS Install Disk 1 in the CD drive) mysql-server-5.0.22-1.centos.1.i386.rpm Check for the proper installation of these files using rpm -qa, e.g.: rpm -qa | grep -i mysql expect this output: mysql-server-5.0.22-1.centos.1 mysqlclient14-4.1.14-4.2.c4.1 mysql-5.0.22-1.centos.1 perl-DBD-MySQL-2.9004-3.1 5. Modify /etc/hosts Make sure that localhost entry in /etc/hosts is valid: 127.0.0.1 localhost localhost.localdomain Note that the "localhost" is *before* the "localhost.localdomain". 6. Install Apache Runtime Utilities (apr) Subversion Use RPM to install: apr-util-0.9.4-17.i386.rpm & subversion-1.3.2-1.rhel4.i386.rpm 7. Install ant and maven GroundWork uses the 1.0.2 version of maven. You can get the right versions of these tools from our repository: wget -c ftp://archive.groundworkopensource.com/pub/groundwork-core/build/* untar files into an appropriate location, such as /usr/local/ant /usr/local/maven 8. Update the .bash_profile Note that the build has to be run as root. This is because some of the components execute the ldconfig command. These environment variables must be set for the user running the build, in the .bash_profile, for example: export GW_HOME=/usr/local/groundwork export JAVA_HOME=/usr/java/jdk1.5.0_05 export ANT_HOME=/home/nagios/apache/apache-ant-1.6.5 export MAVEN_HOME=/home/nagios/apache/maven-1.0.2 export LDFLAGS=-L$GW_HOME/lib export LD_RUN_PATH=$GW_HOME/lib:$LD_RUN_PATH export LD_LIBRARY_PATH=$GW_HOME/lib:$LD_LIBRARY_PATH export CPPFLAGS=-I$GW_HOME/include export PATH=$GW_HOME/bin:$PATH:$MAVEN_HOME/bin:$ANT_HOME/bin:$JAVA_HOME/bin Confirm all paths and versions are correct: the build does do a pre-flight check and will abort early if it can't find a necessary build component. EXECUTE THE BUILD ----------------- These are the steps. 1. The build has some hard coded references to /home/nagios which requires that that directory exists. Either you add a user nagios (useradd nagios ) or simply create /home/nagios and set the permission to 777 2. Create a build directory (e.g mkdir /root/build ) 3. Step into the build directory (e.g cd /root/build) and execute the following commands to download the main build scripts: wget http://archive.groundworkopensource.com/groundwork-opensource/trunk/nightlybuild/nightlyBuildFoundation.sh wget http://archive.groundworkopensource.com/groundwork-opensource/trunk/nightlybuild/nightlybuild-OS.sh 4. The first RPM of the distribution is Foundation that includes the GroundWork Monitor backend. To start the build change the permission on the scripts: chmod +x * start the build: nohup ./nightlyBuildFoundation.sh & the output goes into the nohup.out file. In order to watch the build simply tail the file: tail -f nohup.out At the end you should end up with an RPM in /usr/src/package/RPM/noarch (Note: This path is for SuSE systems. Redhat uses the following path: /usr/src/redhat/RPM/noarch ). If the RPM is not there check the nohup.out files for errors. 5. Build the monitor core RPM which includes Nagios, Apache and the GroundWork UI and other utilities. rename the nohup.out created by the foundation build to nohup.out.foundation start the core build nohup ./nightlybuild-OS.sh & the output goes into the nohup.out file. In order to watch the build simply tail the file: tail -f nohup.out At the end you should end up with an RPM in /usr/src/package/RPM/i586 (Note: This path is for SuSE systems. Redhat uses the following path: /usr/src/redhat/RPM/i586 ). If the RPM is not there check the nohup.out files for errors. 6. The two RPM make up the Open Source Version of GroundWork Monitor 5.1. The groundwork monitor-core RPM has a dependency on the Foundation packages. Both RPMs need to be installed together. On a target system just invoke: rpm -Uvh groundwork* 7. See the file INSTALLATION_INSTRUCTIONS for information about how to install the RPM. Instructions are in the open source repository at this URL: http://archive.groundworkopensource.com/groundwork-opensource/build/INSTALLATION_INSTRUCTIONS NOTE: The RPM should not be installed in the same environment where it was built. This is because the installation procedure will clobber some of the components of the build. [end]