diff --git a/extras/ChangeLog b/extras/ChangeLog index c7485536e7..a1a6699f98 100644 --- a/extras/ChangeLog +++ b/extras/ChangeLog @@ -1,3 +1,8 @@ +2010-12-23 Ramon Novoa + + * build_src.sh, build_windows_agent.sh, + build_deb.sh, build_rpm.sh: Return error codes and exclude .po files. + 2010-12-21 Ramon Novoa * build_src.sh, build_deb.sh, build_rpm.sh: Small fixes to build scripts. diff --git a/extras/build_deb.sh b/extras/build_deb.sh index 474acf82b8..178dc242db 100755 --- a/extras/build_deb.sh +++ b/extras/build_deb.sh @@ -2,35 +2,27 @@ CODEHOME=~/code/pandora/trunk CODEHOME_ENT=~/code/artica/code RPMHOME=/usr/src/packages -START_DIR=`pwd` -mkdir -p $RPMHOME/DEB +if [ ! -d $RPMHOME/DEB ]; then + mkdir -p $RPMHOME/DEB || exit 1 +fi echo "Creating DEB packages in $RPMHOME/DEB" -cd $CODEHOME/pandora_console/DEBIAN -bash ./make_deb_package.sh -cd .. -mv *.deb $RPMHOME/DEB -cd $CODEHOME/pandora_server/DEBIAN -bash ./make_deb_package.sh -cd .. -mv *.deb $RPMHOME/DEB +# Console +cd $CODEHOME/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 -cd $CODEHOME/pandora_agents/unix/DEBIAN -bash ./make_deb_package.sh -cd .. -mv *.deb $RPMHOME/DEB +# Server +cd $CODEHOME/pandora_server/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 -cd $CODEHOME_ENT/pandora/trunk/pandora_console/DEBIAN -bash ./make_deb_package.sh -cd .. -mv *.deb $RPMHOME/DEB +# Unix agent +cd $CODEHOME/pandora_agents/unix/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 -cd $CODEHOME_ENT/pandora/trunk/pandora_server/PandoraFMS-Enterprise/DEBIAN -bash ./make_deb_package.sh -cd .. -mv *.deb $RPMHOME/DEB +# Enterprise console +cd $CODEHOME_ENT/pandora/trunk/pandora_console/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 -cd $START_DIR +# Enterprise server +cd $CODEHOME_ENT/pandora/trunk/pandora_server/PandoraFMS-Enterprise/DEBIAN && bash ./make_deb_package.sh && mv ../*.deb $RPMHOME/DEB || exit 1 + +exit 0 diff --git a/extras/build_rpm.sh b/extras/build_rpm.sh index 1e05aa0bb8..fe5486bfad 100755 --- a/extras/build_rpm.sh +++ b/extras/build_rpm.sh @@ -3,12 +3,29 @@ CODEHOME=~/code/pandora/trunk CODEHOME_ENT=~/code/artica/code RPMHOME=/usr/src/packages +if [ ! -d $RPMHOME/RPMS ]; then + mkdir -p $RPMHOME/RPMS || exit 1 +fi + echo "Creating RPM packages in $RPMHOME/RPMS" -rpmbuild -ba $CODEHOME/pandora_console/pandora_console.spec -rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.spec -rpmbuild -ba $CODEHOME/pandora_server/pandora_server.spec -rpmbuild -ba $CODEHOME_ENT/pandora/trunk/pandora_console/enterprise/pandora_console_enterprise.spec -rpmbuild -ba $CODEHOME_ENT/pandora/trunk/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec -rpmbuild -ba $CODEHOME_ENT/updatemanager/keygen/pandora/pandora_keygen.spec +# Console +rpmbuild -ba $CODEHOME/pandora_console/pandora_console.spec || exit 1 + +# Server +rpmbuild -ba $CODEHOME/pandora_server/pandora_server.spec || exit 1 + +# Unix agent +rpmbuild -ba $CODEHOME/pandora_agents/unix/pandora_agent.spec || exit 1 + +# Enterprise console +rpmbuild -ba $CODEHOME_ENT/pandora/trunk/pandora_console/enterprise/pandora_console_enterprise.spec || exit 1 + +# Enterprise server +rpmbuild -ba $CODEHOME_ENT/pandora/trunk/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec || exit 1 + +# Updatemanager keygen +rpmbuild -ba $CODEHOME_ENT/updatemanager/keygen/pandora/pandora_keygen.spec || exit 1 + +exit 0 diff --git a/extras/build_src.sh b/extras/build_src.sh index 233364856d..e6e6e5d47c 100755 --- a/extras/build_src.sh +++ b/extras/build_src.sh @@ -5,29 +5,29 @@ RPMHOME=/usr/src/packages VERSION=$(grep 'my $pandora_version =' $CODEHOME/pandora_server/lib/PandoraFMS/Config.pm | awk '{print substr($4, 2, length($4) - 3)}') KEYGEN_VERSION=$(grep "%define version" $CODEHOME_ENT/updatemanager/keygen/pandora/pandora_keygen.spec | awk '{print $3}') +if [ ! -d $RPMHOME/SOURCES ]; then + mkdir -p $RPMHOME/SOURCES || exit 1 +fi + echo "Creating source tarballs in $RPMHOME/SOURCES" -rm -Rf /usr/src/rpm/SOURCES/pandorafms_*.tar.gz -cd $CODEHOME/pandora_agents -tar zcvf $RPMHOME/SOURCES/pandorafms_agent-$VERSION.tar.gz --exclude \.svn --exclude nohup linux -tar zvcf $RPMHOME/SOURCES/pandorafms_agent_unix-$VERSION.tar.gz --exclude \.svn --exclude nohup --exclude NT4 unix +# Console +cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_console-$VERSION.tar.gz --exclude \.svn --exclude config.php --exclude enterprise --exclude \*\.po pandora_console || exit 1 -cd $CODEHOME -tar zcvf $RPMHOME/SOURCES/pandorafms_server-$VERSION.tar.gz --exclude \.svn pandora_server +# Server +cd $CODEHOME && tar zcvf $RPMHOME/SOURCES/pandorafms_server-$VERSION.tar.gz --exclude \.svn pandora_server || exit 1 -# Console OpenSource -cd $CODEHOME -tar zcvf $RPMHOME/SOURCES/pandorafms_console-$VERSION.tar.gz --exclude \.svn --exclude config.php --exclude enterprise pandora_console +# Linux and Unix agents +cd $CODEHOME/pandora_agents && tar zcvf $RPMHOME/SOURCES/pandorafms_agent-$VERSION.tar.gz --exclude \.svn --exclude nohup linux && tar zvcf $RPMHOME/SOURCES/pandorafms_agent_unix-$VERSION.tar.gz --exclude \.svn --exclude nohup --exclude NT4 unix || exit 1 -# Console Enterprise -cd $CODEHOME_ENT/pandora/trunk/pandora_console -tar zcvf $RPMHOME/SOURCES/pandorafms_console_enterprise-$VERSION.tar.gz --exclude \.svn enterprise/* +# Enterprise console +cd $CODEHOME_ENT/pandora/trunk/pandora_console && tar zcvf $RPMHOME/SOURCES/pandorafms_console_enterprise-$VERSION.tar.gz --exclude \.svn enterprise/* || exit 1 -# Server OpenSource -cd $CODEHOME_ENT/pandora/trunk/pandora_server/ -tar zcvf $RPMHOME/SOURCES/pandorafms_server_enterprise-$VERSION.tar.gz --exclude \.svn PandoraFMS-Enterprise +# Enterprise server +cd $CODEHOME_ENT/pandora/trunk/pandora_server/ && tar zcvf $RPMHOME/SOURCES/pandorafms_server_enterprise-$VERSION.tar.gz --exclude \.svn PandoraFMS-Enterprise || exit 1 -# Updatemanager Client keygen -cd $CODEHOME_ENT/updatemanager/keygen -tar cvzf $RPMHOME/SOURCES/pandorafms_keygen-$KEYGEN_VERSION.tar.gz --exclude .svn --exclude keygen --exclude keygen.i386.static --exclude pandora_keygen.spec pandora +# Updatemanager keygen +cd $CODEHOME_ENT/updatemanager/keygen && tar cvzf $RPMHOME/SOURCES/pandorafms_keygen-$KEYGEN_VERSION.tar.gz --exclude .svn --exclude keygen --exclude keygen.i386.static --exclude pandora_keygen.spec pandora || exit 1 + +exit 0 diff --git a/extras/build_windows_agent.sh b/extras/build_windows_agent.sh index 5980fa6f86..d1df0c346b 100755 --- a/extras/build_windows_agent.sh +++ b/extras/build_windows_agent.sh @@ -2,9 +2,13 @@ CODEHOME=~/code/pandora/trunk RPMHOME=/usr/src/packages -mkdir -p $RPMHOME/EXE +if [ ! -d $RPMHOME/EXE ]; then + mkdir -p $RPMHOME/EXE || exit 1 +fi echo "Creating Pandora FMS Agent Windows installer in $RPMHOME/EXE" + +# Windows agent rm -rf $CODEHOME/pandora_agents/win32/installer/output/*.exe cd $CODEHOME/pandora_agents/win32 ./build.sh