1###################################
2# Makefile for NSCA Solaris Package
3#
4# Last Modified: 6 Jan 2012
5###################################
6
7TARGET_OS=@TARGET_OS@
8TARGET_VER=@TARGET_VER@
9TARGET_ARCH=@TARGET_ARCH@
10TARGET_PLATFORM=@TARGET_PLATFORM@
11
12SOLARIS_CONFIG_OPTS=--prefix=/opt/nagios --sysconfdir=/etc/nagios
13
14PKG_NAME=NGOSnsca
15PKG_VERSION=@PKG_VERSION@
16PKG_FILE=@PACKAGE_NAME@-$(PKG_VERSION)-$(TARGET_PLATFORM)-$(TARGET_ARCH)-local
17
18TOPDIR=@top_builddir@
19PKGDIR=@builddir@/pkg
20SRCDIR=@builddir@/build/src
21INSTALLDIR=@builddir@/install
22ABSINSTALLDIR=@abs_builddir@/install
23
24build:
25	if [ ! -d build ] ; then mkdir build ; fi
26	cd build; ../../../configure $(SOLARIS_CONFIG_OPTS); make all
27
28prototype: $(PKGDIR)
29	@echo "i pkginfo" > $(PKGDIR)/prototype
30	@echo "i copyright=../$(TOPDIR)/LEGAL" >> $(PKGDIR)/prototype
31	@echo "i preinstall" >> $(PKGDIR)/prototype
32	@echo "i i.config" >> $(PKGDIR)/prototype
33	@echo "i r.config" >> $(PKGDIR)/prototype
34	@echo "d none /etc/nagios 0755 nagios nagios" >> $(PKGDIR)/prototype
35	@echo "f config /etc/nagios/send_nsca.cfg=$(TOPDIR)/sample-config/send_nsca.cfg 0600 nagios nagios" >> $(PKGDIR)/prototype
36	@echo "d none /opt/nagios/bin 0755 nagios bin" >> $(PKGDIR)/prototype
37	@echo "f none /opt/nagios/bin/send_nsca=$(SRCDIR)/send_nsca 0755 nagios bin" >> $(PKGDIR)/prototype
38
39pkginfo: $(PKGDIR)
40	@echo PKG="$(PKG_NAME)" > $(PKGDIR)/pkginfo
41	@echo NAME="Nagios Service Check Acceptor $(PKG_VERSION)" >> $(PKGDIR)/pkginfo
42	@echo VERSION="$(PKG_VERSION)" >> $(PKGDIR)/pkginfo
43	@echo ARCH="$(TARGET_ARCH)" >> $(PKGDIR)/pkginfo
44	@echo CATEGORY="utility" >> $(PKGDIR)/pkginfo
45	@echo CLASSES="none config manifest" >> $(PKGDIR)/pkginfo
46	@echo VENDOR="www.nagios.org" >> $(PKGDIR)/pkginfo
47	@echo EMAIL="nagios-users@lists.sourceforge.net" >> $(PKGDIR)/pkginfo
48	@echo ISTATES="S s 1 2 3" >> $(PKGDIR)/pkginfo
49	@echo RSTATES="S s 1 2 3" >> $(PKGDIR)/pkginfo
50	@echo BASEDIR="/" >> $(PKGDIR)/pkginfo
51
52$(PKG_FILE): pkginfo prototype
53	pkgmk -o -d $(PKGDIR) -f $(PKGDIR)/prototype -r .
54	pkgtrans ./pkg $(PKG_FILE) $(PKG_NAME)
55
56pkg: $(PKG_FILE)
57
58all: pkg
59
60clean:
61	rm -rf build package
62	rm -rf $(PKGDIR)/$(PKG_NAME)
63	rm -f $(PKGDIR)/prototype $(PKGDIR)/pkginfo
64	rm -f $(PKGDIR)/$(PKG_FILE)
65	rm -f core
66	rm -f *~ */*~
67
68distclean: clean
69	rm -f Makefile
70	rm -f config.log
71
72devclean: distclean
73
74