1 #!/opt/csw/bin/gmake -f -d
6 DESTDIR = ${CURDIR}/${BUILDDIR}
7 PKGDIR = ${CURDIR}/${PKG}
8 PKGNAME = CSWmcollective
9 VERSION = $(shell cd ../.. ; RUBYLIB=./lib /opt/csw/bin/ruby18 -r mcollective -e 'puts MCollective::VERSION' )
10 # If we checked out from git:
11 ifeq ($(VERSION),@DEVELOPMENT_VERSION@)
12 VERSION = $(shell ggrep "PROJ_VERSION = " ../../Rakefile | cut -d' ' -f3 | sed -e 's/"//g')
15 PKGVERSION = ${VERSION}-${RELEASE}\,REV=$(shell date +%Y.%m.%d)
17 RUBY_SITE = ${DESTDIR}/opt/csw/lib/ruby/site_ruby/${RUBY_VERSION}
21 ginstall -d $(DESTDIR)
22 ginstall -g root -d $(DESTDIR)/opt
23 ginstall -g sys -d $(DESTDIR)/var $(DESTDIR)/var/lock $(DESTDIR)/etc $(DESTDIR)/etc/opt
24 ginstall -g bin -d $(DESTDIR)/var/opt $(DESTDIR)/var/opt/csw $(DESTDIR)/var/opt/csw/svc $(DESTDIR)/var/opt/csw/svc/manifest $(DESTDIR)/var/opt/csw/svc/manifest/network
25 ginstall -g bin -d $(DESTDIR)/opt/csw/lib $(DESTDIR)/opt/csw/lib/svc $(DESTDIR)/opt/csw/lib/svc/method
26 ginstall -g bin -d $(DESTDIR)/opt/csw $(DESTDIR)/opt/csw/lib $(DESTDIR)/opt/csw/sbin $(DESTDIR)/opt/csw/bin
27 ginstall -g bin -d $(DESTDIR)/opt/csw/lib/ruby $(DESTDIR)/opt/csw/lib/ruby/site_ruby $(DESTDIR)/opt/csw/lib/ruby/site_ruby/$(RUBY_VERSION)
28 ginstall -g bin -d $(DESTDIR)/etc/opt/csw $(DESTDIR)/etc/opt/csw/mcollective
29 ginstall -g bin -d $(DESTDIR)/opt/csw/share $(DESTDIR)/opt/csw/share/mcollective
32 ginstall -g bin $(CURDIR)/../../bin/mc-* $(DESTDIR)/opt/csw/sbin/
33 ginstall -g bin $(CURDIR)/../../bin/mco $(DESTDIR)/opt/csw/sbin/
34 ginstall -g bin $(CURDIR)/../../bin/mcollectived $(DESTDIR)/opt/csw/sbin/mcollectived
36 gcp -a $(CURDIR)/../../lib/* $(RUBY_SITE)/
37 chgrp -R bin $(RUBY_SITE)/
38 # install example config files
39 gcp -a $(CURDIR)/../../etc/* $(DESTDIR)/etc/opt/csw/mcollective/
40 grm $(DESTDIR)/etc/opt/csw/mcollective/ssl/PLACEHOLDER
41 grm $(DESTDIR)/etc/opt/csw/mcollective/ssl/clients/PLACEHOLDER
42 chgrp -R bin $(DESTDIR)/etc/opt/csw/mcollective/
44 gcp -a $(CURDIR)/../../plugins $(DESTDIR)/opt/csw/share/mcollective/
46 #ginstall -d $(DESTDIR)/opt/csw/doc $(DESTDIR)/opt/csw/doc/mcollective/
47 #gcp -a $(CURDIR)/../../doc/ $(DESTDIR)/opt/cs/doc/mcollective
49 ginstall -g bin $(CURDIR)/mcollective.init $(DESTDIR)/opt/csw/lib/svc/method/svc-cswmcollectived
50 ginstall -g bin $(CURDIR)/cswmcollectived.xml $(DESTDIR)/var/opt/csw/svc/manifest/network
52 (cat prototype.head; pkgproto $(DESTDIR)=/ ) > solaris/prototype
53 mkdir $(PKGDIR) || true
54 ginstall postinstall solaris/
55 ginstall postremove solaris/
56 ginstall preremove solaris/
58 ginstall pkginfo solaris/
59 (echo PKG=${PKGNAME} ) >> solaris/pkginfo
60 (echo VERSION=${PKGVERSION} ) >> solaris/pkginfo
61 (cd solaris/ ; pkgmk -o -d $(PKGDIR))
62 pkgtrans -s $(PKGDIR) $(CURDIR)/$(PKGNAME)-$(PKGVERSION)-`uname -s``uname -r`-all-CSW.pkg $(PKGNAME)
67 grm -f solaris/prototype
68 grm -f $(PKGNAME)-$(SOLARIS_VERSION)-`uname -s``uname -r`-all-CSW.pkg