| 1 | # Copyright 2009 OpenCSW |
|---|
| 2 | # Distributed under the terms of the GNU General Public License v2 |
|---|
| 3 | # $Id$ |
|---|
| 4 | # |
|---|
| 5 | # Based on a build script[1] written by Gary Law. |
|---|
| 6 | # |
|---|
| 7 | # [1] http://garylaw.net/packages/puppet-build.sh |
|---|
| 8 | |
|---|
| 9 | NAME = puppet |
|---|
| 10 | VERSION = 2.7.14 |
|---|
| 11 | CATEGORIES = apps |
|---|
| 12 | GARTYPE = v2 |
|---|
| 13 | |
|---|
| 14 | define BLURB |
|---|
| 15 | Puppet helps accomplish the goal of a hands-off, automated infrastructure. |
|---|
| 16 | The benefits of automated infrastructure go beyond policy-enforced |
|---|
| 17 | consistency and auditing. The impact of hardware failure and other disaster |
|---|
| 18 | scenarios can be mitigated, as services can be quickly restored by Puppet. In |
|---|
| 19 | conjunction with virtualizaton, the ability to reliably create new systems |
|---|
| 20 | running consistent services can be leveraged to create autoscaling |
|---|
| 21 | applications as well as test systems identical to production environments. |
|---|
| 22 | endef |
|---|
| 23 | |
|---|
| 24 | MASTER_SITES = http://puppetlabs.com/downloads/puppet/ |
|---|
| 25 | DISTFILES = $(NAME)-$(VERSION).tar.gz |
|---|
| 26 | DISTFILES += cswpuppetd |
|---|
| 27 | DISTFILES += cswpuppetmasterd |
|---|
| 28 | DISTFILES += cswusergroup |
|---|
| 29 | DISTFILES += CSWpuppet.postinstall |
|---|
| 30 | # pkgutil.rb https://raw.github.com/domcleal/puppet/tickets/master/8011c/lib/puppet/provider/package/pkgutil.rb |
|---|
| 31 | # Should be headed into 2.7 code - supports -t REPO |
|---|
| 32 | # Still not in 2.7.14 as of 03-May-12(FFS!) |
|---|
| 33 | DISTFILES += pkgutil.rb |
|---|
| 34 | DISTFILES += README.CSW |
|---|
| 35 | DISTFILES += puppet.conf.example-CSW |
|---|
| 36 | SPKG_SOURCEURL = http://puppetlabs.com/ |
|---|
| 37 | LICENSE_CSWpuppet = LICENSE |
|---|
| 38 | LICENSE_CSWpuppetmaster = LICENSE |
|---|
| 39 | |
|---|
| 40 | INITSMF += $(sysconfdir)/init\.d/cswpuppetd |
|---|
| 41 | INITSMF += $(sysconfdir)/init\.d/cswpuppetmasterd |
|---|
| 42 | USERGROUP = $(sysconfdir)/pkg/puppet/cswusergroup |
|---|
| 43 | |
|---|
| 44 | # Creating a separate package CSWpuppetmaster so that the cswpuppetmaster |
|---|
| 45 | # service isn't started upon the installation of CSWpuppet. |
|---|
| 46 | PACKAGES += CSWpuppetmaster |
|---|
| 47 | PACKAGES += CSWpuppet |
|---|
| 48 | |
|---|
| 49 | SPKG_DESC_CSWpuppet = System configuration management tool, client daemon |
|---|
| 50 | SPKG_DESC_CSWpuppetmaster = System configuration management tool, server |
|---|
| 51 | |
|---|
| 52 | RUNTIME_DEP_PKGS = CSWfacter |
|---|
| 53 | RUNTIME_DEP_PKGS += CSWruby18 |
|---|
| 54 | RUNTIME_DEP_PKGS += CSWrubyaugeas |
|---|
| 55 | RUNTIME_DEP_PKGS_CSWpuppetmaster += CSWpuppet |
|---|
| 56 | RUNTIME_DEP_PKGS_CSWpuppetmaster += CSWruby18 |
|---|
| 57 | |
|---|
| 58 | PKGFILES_CSWpuppetmaster = $(sysconfdir)/init\.d/cswpuppetmasterd |
|---|
| 59 | PKGFILES_CSWpuppetmaster += $(sbindir)/puppetmasterd |
|---|
| 60 | PKGFILES_CSWpuppetmaster += $(mandir)/man8/puppetmasterd.8 |
|---|
| 61 | PKGFILES_CSWpuppetmaster += $(libdir)/.*/puppet/application/puppetmasterd.rb |
|---|
| 62 | PKGFILES_CSWpuppetmaster += $(sysconfdir)/puppet/auth.conf |
|---|
| 63 | |
|---|
| 64 | ARCHALL = 1 |
|---|
| 65 | |
|---|
| 66 | sysconfdir = /etc$(prefix) |
|---|
| 67 | localstatedir = /var$(prefix) |
|---|
| 68 | rubysitelibdir = $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") |
|---|
| 69 | |
|---|
| 70 | CONFIGURE_SCRIPTS = |
|---|
| 71 | BUILD_SCRIPTS = |
|---|
| 72 | TEST_SCRIPTS = |
|---|
| 73 | INSTALL_SCRIPTS = puppet |
|---|
| 74 | |
|---|
| 75 | CHECKPKG_OVERRIDES_CSWpuppetmaster = surplus-dependency|CSWruby18 |
|---|
| 76 | CHECKPKG_OVERRIDES_CSWpuppet = surplus-dependency|CSWfacter |
|---|
| 77 | CHECKPKG_OVERRIDES_CSWpuppet += surplus-dependency|CSWrubyaugeas |
|---|
| 78 | CHECKPKG_OVERRIDES_CSWpuppet += missing-dependency|CSWpython |
|---|
| 79 | # Puppet has hardcoded paths to look at for many OSes, many of which involve |
|---|
| 80 | # /usr/share and /usr/local. |
|---|
| 81 | CHECKPKG_OVERRIDES_CSWpuppet += file-with-bad-content |
|---|
| 82 | # These files are quite deliberate - without them users will not get CSW |
|---|
| 83 | # behaviour. The README explains |
|---|
| 84 | CHECKPKG_OVERRIDES_CSWpuppet += bad-location-of-file|file=/etc/puppet |
|---|
| 85 | CHECKPKG_OVERRIDES_CSWpuppet += bad-location-of-file|file=/etc/puppet/README.CSW |
|---|
| 86 | CHECKPKG_OVERRIDES_CSWpuppet += bad-location-of-file|file=/etc/puppet/puppet.conf.example-CSW |
|---|
| 87 | |
|---|
| 88 | include gar/category.mk |
|---|
| 89 | |
|---|
| 90 | install-puppet: |
|---|
| 91 | ginstall -m 755 -d $(DESTDIR) |
|---|
| 92 | ginstall -m 755 -d $(DESTDIR)/etc/puppet |
|---|
| 93 | ginstall -m 644 $(FILEDIR)/README.CSW $(DESTDIR)/etc/puppet/README.CSW |
|---|
| 94 | ginstall -m 644 $(FILEDIR)/puppet.conf.example-CSW $(DESTDIR)/etc/puppet/puppet.conf.example-CSW |
|---|
| 95 | ginstall -m 755 -d $(DESTDIR)$(sysconfdir)/puppet |
|---|
| 96 | ginstall -m 755 -d $(DESTDIR)$(localstatedir)/puppet/run |
|---|
| 97 | ginstall -m 755 -d $(DESTDIR)$(sysconfdir)/init.d |
|---|
| 98 | ginstall -m 755 $(FILEDIR)/cswpuppetd $(DESTDIR)$(sysconfdir)/init.d |
|---|
| 99 | ginstall -m 755 $(FILEDIR)/cswpuppetmasterd $(DESTDIR)$(sysconfdir)/init.d |
|---|
| 100 | ginstall -m 755 $(FILEDIR)/cswpuppetmasterd $(DESTDIR)/etc$(prefix)/init.d |
|---|
| 101 | cd $(WORKSRC) && $(INSTALL_ENV) ruby install.rb \ |
|---|
| 102 | --configdir=$(sysconfdir)/puppet \ |
|---|
| 103 | --bindir=$(bindir) \ |
|---|
| 104 | --sbindir=$(sbindir) \ |
|---|
| 105 | --full |
|---|
| 106 | ginstall -m 755 $(FILEDIR)/pkgutil.rb $(DESTDIR)$(rubysitelibdir)/puppet/provider/package |
|---|
| 107 | cd $(DESTDIR)$(mandir)/man8 && gunzip * |
|---|
| 108 | (cd $(WORKSRC)/examples/etc/puppet && \ |
|---|
| 109 | for f in *; do \ |
|---|
| 110 | if [ -f $$f ] ; then \ |
|---|
| 111 | cp $$f $(DESTDIR)$(sysconfdir)/puppet/$$f.example; \ |
|---|
| 112 | chmod 644 $(DESTDIR)$(sysconfdir)/puppet/$$f.example; \ |
|---|
| 113 | fi; \ |
|---|
| 114 | done) |
|---|
| 115 | mv $(DESTDIR)$(sysconfdir)/puppet/auth.conf $(DESTDIR)$(sysconfdir)/puppet/auth.conf.example |
|---|
| 116 | ginstall -m 644 $(FILEDIR)/puppet.conf.example-CSW $(DESTDIR)$(sysconfdir)/puppet/puppet.conf.example |
|---|
| 117 | ginstall -d -m 755 $(DESTDIR)$(sysconfdir)/pkg/puppet |
|---|
| 118 | ginstall -m 644 $(FILEDIR)/cswusergroup \ |
|---|
| 119 | $(DESTDIR)$(sysconfdir)/pkg/puppet/cswusergroup |
|---|
| 120 | mkdir -p $(DESTDIR)$(localstatedir)/lib |
|---|
| 121 | gunzip $(DESTDIR)$(mandir)/man5/puppet.conf.5.gz |
|---|
| 122 | @$(MAKECOOKIE) |
|---|