# # AUTHORS: # Copyright (C) 2003-2009 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.2.2 REVISION := $(shell ./revision) ifneq ($(origin REVISION),undefined) BUILD := ${VERSION}.${REVISION} else BUILD := ${VERSION} endif GENERATED = opsview-web/opsview-web.spec opsview-web/version SUBDIRS = opsview-core opsview-base all: tar tar_checks: which giftopnm || ( echo "**** Install netpbm ****"; false ) which pngtogd2 || ( echo "**** Install libgd-tools ****"; false ) which convert || ( echo "**** Install imagemagick ****"; false ) tar: tar_checks ${GENERATED} 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} opsview-web/version opsview-web/opsview-web.spec: perl -pe 's/%VERSION%/${BUILD}/g' $@.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 cp opsview-web/opsview_web.yml opsview-web/opsview_web.yml.bak perl -i -pe 's/^version: .*/version: ${VERSION}/' opsview-web/opsview_web.yml perl -i -pe 's/^build: .*/build: ${BUILD}/' 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} mv opsview-web/opsview_web.yml.bak opsview-web/opsview_web.yml 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} 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 version: opsview-web/version cd opsview-base && $(MAKE) version VERSION=${BUILD} cd opsview-core && $(MAKE) version VERSION=${BUILD} debpkg: version cd opsview-base && $(MAKE) debpkg cd opsview-core && $(MAKE) debpkg perl -i -pe 's/^build: .*/build: ${BUILD}/' opsview-web/opsview_web.yml 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}