summaryrefslogtreecommitdiff
path: root/sysutils/puppet/Makefile
blob: 3210f51cecd9ccf5999f60595b9cd2563ea34b2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# $NetBSD: Makefile,v 1.54 2022/04/28 14:54:53 jperkin Exp $

DISTNAME=		puppet-7.13.1
CATEGORIES=		sysutils
#MASTER_SITES=		http://puppetlabs.com/downloads/puppet/

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		http://www.puppetlabs.com/
COMMENT=		Configuration management framework written in Ruby
LICENSE=		apache-2.0

DEPENDS+=	${RUBY_PKGPREFIX}-facter>=4.2.0:../../sysutils/ruby-facter
DEPENDS+=	${RUBY_PKGPREFIX}-hiera>=3.2.1:../../databases/ruby-hiera
DEPENDS+=	${RUBY_PKGPREFIX}-semantic_puppet>=1.0<2:../../devel/ruby-semantic_puppet
DEPENDS+=	${RUBY_PKGPREFIX}-fast_gettext>=1.1:../../devel/ruby-fast_gettext
DEPENDS+=	${RUBY_PKGPREFIX}-locale>=2.1<3:../../devel/ruby-locale
DEPENDS+=	${RUBY_PKGPREFIX}-multi_json>=1.10<2:../../textproc/ruby-multi_json
DEPENDS+=	${RUBY_PKGPREFIX}-puppet-resource_api>=1.5<2:../../sysutils/ruby-puppet-resource_api
DEPENDS+=	${RUBY_PKGPREFIX}-concurrent-ruby>=1.0<2:../../devel/ruby-concurrent-ruby
DEPENDS+=	${RUBY_PKGPREFIX}-deep_merge>=1.0<2:../../devel/ruby-deep_merge
DEPENDS+=	${RUBY_PKGPREFIX}-scanf>=1.0.0<2:../../devel/ruby-scanf

RUBYGEM_OPTIONS+=	--format-executable
OVERRIDE_GEMSPEC+=	fast_gettext>=1.1
USE_LANAUGES=		# none

PKG_SYSCONFSUBDIR=	puppet
RCD_SCRIPTS=		puppetd puppetmasterd

SMF_SRCDIR=		${WRKSRC}/ext/solaris/smf
SMF_MANIFEST=		puppet.xml
SMF_METHODS=		puppet
SMF_METHOD_SRC.puppet=	${SMF_SRCDIR}/puppet
SMF_NAME=		puppet

SUBST_CLASSES+=		prefix
SUBST_STAGE.prefix=	pre-configure
SUBST_FILES.prefix=	install.rb
SUBST_FILES.prefix+=	lib/puppet/face/module/changes.rb
SUBST_FILES.prefix+=	lib/puppet/face/module/install.rb
SUBST_FILES.prefix+=	lib/puppet/face/module/list.rb
SUBST_FILES.prefix+=	lib/puppet/face/module/uninstall.rb
SUBST_FILES.prefix+=	lib/puppet/face/module/upgrade.rb
SUBST_FILES.prefix+=	lib/puppet/reference/configuration.rb
SUBST_FILES.prefix+=	lib/puppet/util/run_mode.rb
SUBST_FILES.prefix+=	man/man5/puppet.conf.5
SUBST_FILES.prefix+=	man/man8/puppet-apply.8
SUBST_FILES.prefix+=	man/man8/puppet-module.8
SUBST_FILES.prefix+=	man/man8/puppet-parser.8
SUBST_FILES.prefix+=	spec/unit/util/run_mode_spec.rb
SUBST_FILES.prefix+=	spec/unit/util/selinux_spec.rb
SUBST_SED.prefix=	-e "s|/etc/puppet|${PKG_SYSCONFDIR}|g"

SUBST_CLASSES+=		smf
SUBST_STAGE.smf=	pre-configure
SUBST_FILES.smf+=	ext/solaris/smf/puppet
SUBST_FILES.smf+=	ext/solaris/smf/puppet.xml
SUBST_SED.smf=		-e "s,/etc/puppetlabs/puppet,${PKG_SYSCONFDIR},g"
SUBST_SED.smf+=		-e "s,/opt/puppetlabs/bin/puppet,${PREFIX}/bin/puppet${RUBY_SUFFIX},g"
SUBST_SED.smf+=		-e "s,network/puppet,${SMF_PREFIX}/puppet,g"

SUBST_CLASSES+=		sufx
SUBST_STAGE.sufx=	pre-configure
SUBST_MESSAGE.sufx=	Fixing command suffix
SUBST_FILES.sufx=	lib/puppet/util/command_line.rb
SUBST_VARS.sufx=	RUBY_SUFFIX

EGDIR=			share/examples/${PKGBASE}
CONF_FILES=		${EGDIR}/puppet.conf ${PKG_SYSCONFDIR}/puppet.conf

## Since these users are needed only for puppet server,
## puppet-server package should be created.
#SUBST_CLASSES+=		user
#SUBST_STAGE.user=		post-patch
#SUBST_FILES.user=		lib/puppet/defaults.rb
#SUBST_SED.user=		-e "s|@PUPPET_GROUP@|${PUPPET_GROUP}|g"
#SUBST_SED.user+=		-e "s|@PUPPET_USER@|${PUPPET_USER}|g"
#
#PKG_GROUPS_VARS=		PUPPET_GROUP
#PKG_USERS_VARS=		PUPPET_USER
#
#PKG_GROUPS=			${PUPPET_GROUP}
#PKG_USERS=			${PUPPET_USER}:${PUPPET_GROUP}
#PKG_GECOS.${PUPPET_USER}=	Puppet configuration management pseudo-user

PLIST_SUBST+=		EGDIR=${EGDIR}

BUILD_DEFS+=		VARBASE
INSTALLATION_DIRS+=	${EGDIR}

.include "../../mk/bsd.prefs.mk"

#PUPPET_GROUP?=		puppet
#PUPPET_USER?=		puppet

pre-configure:
	cd ${WRKSRC}/bin && ${CHMOD} ${BINMODE} puppet

pre-build:
	cd ${WRKSRC} && \
		${FIND} lib/puppet spec -type f -exec ${CHMOD} -x {} \;
	cd ${WRKSRC} && ${RUBY} -Ilib bin/puppet agent			\
		--confdir=${PKG_SYSCONFDIR:Q} --rundir=${VARBASE:Q}/run	\
		--genconfig |						\
		${SED} -e 's/genconfig = true/# genconfig = false/'	\
		> examples/puppet.conf

post-install:
	${INSTALL_DATA} ${WRKSRC}/examples/puppet.conf			\
		${DESTDIR}${PREFIX}/${EGDIR}

.include "../../lang/ruby/gem.mk"
.include "../../mk/bsd.pkg.mk"