components/ruby/puppet/Makefile
changeset 7565 48aa82a0931f
parent 6684 57b59903a65e
child 7580 d8438d87f127
--- a/components/ruby/puppet/Makefile	Wed Jan 11 15:24:27 2017 -0800
+++ b/components/ruby/puppet/Makefile	Mon Nov 28 16:54:02 2016 -0800
@@ -28,33 +28,59 @@
 RUBY_VERSIONS=2.1.0
 
 COMPONENT_NAME=		puppet
-COMPONENT_VERSION=	3.8.6
+COMPONENT_VERSION=	4.7.0
 COMPONENT_PROJECT_URL=	http://puppetlabs.com/
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:99ccccd1016d30914f69d96355002818aa8087dfb9e1e6e40578aa67fee77da8
+		sha256:f7eec9099c04a9ad65ee41b6c525b612c487e9a277d4d9ecaea587bb93c130bc
 COMPONENT_ARCHIVE_URL=	http://downloads.puppetlabs.com/puppet/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	utility/puppet
 
-TPNO=			27309
+TPNO=			32470
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/install.rb.mk
 include $(WS_MAKE_RULES)/ips.mk
 include $(WS_MAKE_RULES)/ruby.mk
 
-# puppet requires facter and hiera as part of the install phase 
+# puppet requires facter and hiera as part of the install phase
 FACTER_LIB=$(WS_TOP)/components/ruby/facter/build/$(MACH)/lib
 HIERA_LIB=$(WS_TOP)/components/ruby/hiera/build/$(MACH)/lib
 COMPONENT_INSTALL_ENV	+= RUBYLIB="$(FACTER_LIB):$(HIERA_LIB)"
 
 ../facter/build/%/.installed:
-	(cd ../facter ; $(GMAKE) install)
+	cd ../facter ; $(GMAKE) install
 
 ../hiera/build/%/.installed:
-	(cd ../hiera ; $(GMAKE) install)
+	cd ../hiera ; $(GMAKE) install
+
+
+SECURITY_FILES=$(addprefix files/,auth_attr exec_attr prof_attr)
+ETC_FILES=$(addprefix files/,user_attr)
+
+ext/PuppetAudit.so:
+	# Ruby extension for auditing
+	cd ext; $(RUBY) extconf.rb; $(GMAKE)
 
+clean::
+	@if [ -f ext/Makefile ]; then \
+		cd ext; $(GMAKE) clean; $(RM) Makefile; \
+	fi
+
+$(BUILD_DIR)/puppet.conf:
+	RUBYLIB=$(PROTO_DIR)/usr/ruby/$(RUBY_VERSION):$(PROTO_DIR)$(VENDOR_RUBY) \
+	  $(PROTO_DIR)/usr/sbin/puppet agent --genconfig > $@
+
+$(BUILD_DIR)/puppet.xml: $(BUILD_DIR)/puppet.conf
+	-$(RM) $@
+	$(PYTHON) tools/update_smf.py -c $(BUILD_DIR)/puppet.conf \
+	  -s files/puppet.xml -o $@
+
+$(BUILD_DIR)/.smf_updated: $(BUILD_DIR)/puppet.xml
+	$(GDIFF) -q $(BUILD_DIR)/puppet.xml files/puppet.xml > /dev/null 2>&1 || \
+		$(CP) $(BUILD_DIR)/puppet.xml files/puppet.xml
+	$(TOUCH) $@
 
 # Collect and print puppet module manifests for cherry picking into group
 # dependencies as a helper for the package maintainer
@@ -69,6 +95,8 @@
 # --sbindir option not supported by Puppet install.rb
 INSTALL_RB_SBINDIR_OPTION =
 
+INSTALL_RB_OPTIONS += --vardir=/var/cache/puppetlabs
+
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
 PKG_OPTIONS +=	-I $(BUILD_DIR)
@@ -77,9 +105,7 @@
 build::		$(BUILD_NO_ARCH)
 
 # make sure facter and hiera are installed first
-install:	../facter/build/$(MACH)/.installed ../hiera/build/$(MACH)/.installed $(INSTALL_NO_ARCH)
-
-clean::
+install:	../facter/build/$(MACH)/.installed ../hiera/build/$(MACH)/.installed $(INSTALL_NO_ARCH) ext/PuppetAudit.so $(BUILD_DIR)/.smf_updated
 
 # puppet requires the installation of the following rubygems to run
 # the unittests:  rspec rspec-expectations mocha rack rgen
@@ -91,3 +117,9 @@
 REQUIRED_PACKAGES += runtime/ruby-21
 REQUIRED_PACKAGES += library/ruby/hiera
 REQUIRED_PACKAGES += system/management/facter
+REQUIRED_PACKAGES += shell/ksh93
+REQUIRED_PACKAGES += system/core-os
+REQUIRED_PACKAGES += system/library
+REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
+REQUIRED_PACKAGES += system/library/math
+REQUIRED_PACKAGES += system/network