# # AUTHORS: # Copyright (C) 2003-2011 Opsera Limited. All rights reserved # # This file is part of Opsview # # Opsview is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Opsview 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 Opsview; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA VERSION = 3.13.2 OPSVIEW_PERL_VERSION = 3.13.1 REVISION := $(shell ./get_version) ifneq ($(origin REVISION),undefined) BUILD := ${VERSION}.${REVISION} else BUILD := ${VERSION} endif GENERATED = opsview-web/opsview-web.spec opsview-web/version opsview-web/opsview_web.yml SUBDIRS = opsview-core opsview-base all: version cd opsview-base && $(MAKE) VERSION=${BUILD} cd opsview-core && $(MAKE) VERSION=${BUILD} OPSVIEW_PERL_VERSION=${OPSVIEW_PERL_VERSION} cd opsview-web && $(MAKE) VERSION=${BUILD} # This is like a "make" version: ${GENERATED} cd opsview-base && $(MAKE) version VERSION=${BUILD} cd opsview-core && $(MAKE) version VERSION=${BUILD} OPSVIEW_PERL_VERSION=${OPSVIEW_PERL_VERSION} cd opsview-web && $(MAKE) version VERSION=${BUILD} tar_checks: which giftopnm || ( echo "**** Install netpbm ****"; false ) which pngtogd2 || ( echo "**** Install libgd-tools ****"; false ) which convert || ( echo "**** Install imagemagick ****"; false ) tar: tar_checks version opsview-base opsview-core opsview-web nightly: make tar VERSION="${BUILD}-`date +%Y%m%d`" tar-customer: if [ ! -d "customers/${CUSTOMER}" ] ; then echo "Must specify CUSTOMER=name" ; false ; fi tar --gzip --exclude=.svn -cf customers-${CUSTOMER}.tar.gz customers/${CUSTOMER} dev: opsview-web/opsview_web.yml cd opsview-base && $(MAKE) dev cd opsview-core && $(MAKE) dev cd opsview-web && $(MAKE) dev install-dev: cd opsview-base && $(MAKE) install-dev cd opsview-core && $(MAKE) install-dev cd opsview-web && $(MAKE) install-dev opsview-web/version opsview-web/opsview-web.spec: perl -pe 's/%VERSION%/${BUILD}/g' $@.in > $@ opsview-web/opsview_web.yml: Makefile perl -pe 's/^version: .*/version: ${VERSION}/; s/^build: .*/build: ${BUILD}/' $@.in > $@ opsview-core: opsview-core-${BUILD}.tar.gz opsview-web: opsview-web-${BUILD}.tar.gz opsview-base: opsview-base-${BUILD}.tar.gz opsview-web-${BUILD}.tar.gz: opsview-web/version opsview-web/opsview-web.spec opsview-web/opsview_web.yml rm -f opsview-web-${BUILD} ln -s opsview-web opsview-web-${BUILD} tar -h -cf opsview-web-${BUILD}.tar.gz --gzip --exclude=".*" --exclude="*.bak" opsview-web-${BUILD} rm opsview-web-${BUILD} opsview-web-install: tar -h -cf - --exclude=".*" opsview-web | ( cd /usr/local && tar -xf - ) perl -i -pe 's/^version: .*/version: "${BUILD}/' /usr/local/opsview-web/opsview_web.yml opsview-base-${BUILD}.tar.gz: cd opsview-base && $(MAKE) tar VERSION=${BUILD} opsview-core-${BUILD}.tar.gz: cd opsview-core && $(MAKE) tar VERSION=${BUILD} OPSVIEW_PERL_VERSION=${OPSVIEW_PERL_VERSION} rpm: tar opsview-base-rpm opsview-core-rpm opsview-web-rpm opsview-web-rpm: cp -f opsview-web-${BUILD}.tar.gz /usr/src/redhat/SOURCES/ rm -fr /usr/src/redhat/BUILD/opsview-web* rpmbuild -bb opsview-web/opsview-web.spec opsview-core-rpm: cp -f opsview-core-${BUILD}.tar.gz /usr/src/redhat/SOURCES/ rm -fr /usr/src/redhat/BUILD/opsview-core* rpmbuild -bb opsview-core/opsview-core.spec opsview-base-rpm: cp -f opsview-base-${BUILD}.tar.gz /usr/src/redhat/SOURCES/ rm -fr /usr/src/redhat/BUILD/opsview-base* rpmbuild -bb opsview-base/opsview-base.spec debpkg: version cd opsview-base && $(MAKE) debpkg cd opsview-core && $(MAKE) debpkg OPSVIEW_PERL_VERSION=${OPSVIEW_PERL_VERSION} cd opsview-web && $(MAKE) debpkg cd auth-tkt && $(MAKE) debpkg mv *.deb *.dsc *.tar.gz *.changes ../ solpkg: version cd opsview-base && $(MAKE) solpkg && mv ALT* ../ cd opsview-core && $(MAKE) solpkg && mv ALT* ../ cd opsview-web && $(MAKE) solpkg && mv ALT* ../ clean: for d in ${SUBDIRS} ; do [ -d $$d ] && ( cd $$d && make clean ) || true ; done rm -f *.tar *.tar.gz ${GENERATED} test: opsview-web/bin/opsview-web start FULL_RUN=1 prove opsview-core/t/*.t opsview-web/t/*.t odw-test/t/*.t opsview-web/bin/opsview-web stop junit: opsview-web/bin/opsview-web start FULL_RUN=1 PERL5LIB=/usr/local/nagios/perl/lib perl -e 'use lib "/home/nagios/perl5/lib/perl5"; use TAP::Harness::JUnit; my $$h = TAP::Harness::JUnit->new( { xmlfile => "junitResults.xml", merge => 1 } ); $$h->runtests(@ARGV)' opsview-core/t/*.t opsview-web/t/*.t odw-test/t/*.t opsview-web/bin/opsview-web stop opsview-core/bin/rc.opsview stop .PHONY: ${GENERATED}