From a2bc03e7eae87b3d649f7e3cd1465a31c6039b5d Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sat, 2 Mar 2013 13:59:20 +0000 Subject: [PATCH] Fix this port: * depend on ruby18 and do not let the ruby module handles FLAVORs * enable regression tests * fix path to the default hiera database; and create its directory * install the yaml configuration file for the cli under SYSCONFDIR * configure hiera.yaml the same way it is done in the hiera tarball distributed by puppetlabs * tweak DESCR * take MAINTAINER Hiera now works out of the box with Puppet. ok jasper@ --- databases/ruby-hiera/Makefile | 31 +++++++++++++++++++++------ databases/ruby-hiera/files/hiera.yaml | 20 ++++++++--------- databases/ruby-hiera/pkg/DESCR | 6 ++---- databases/ruby-hiera/pkg/PLIST | 11 ++++++---- 4 files changed, 43 insertions(+), 25 deletions(-) diff --git a/databases/ruby-hiera/Makefile b/databases/ruby-hiera/Makefile index b4a2a43c6a5..f2955d8aacb 100644 --- a/databases/ruby-hiera/Makefile +++ b/databases/ruby-hiera/Makefile @@ -1,13 +1,17 @@ -# $OpenBSD: Makefile,v 1.1.1.1 2013/02/03 16:44:03 jasper Exp $ +# $OpenBSD: Makefile,v 1.2 2013/03/02 13:59:20 ajacoutot Exp $ COMMENT= simple pluggable hierarchical database -DISTNAME= hiera-1.1.2 +V= 1.1.2 +DISTNAME= hiera-${V} +PKGNAME= ruby-hiera-${V} +REVISION= 0 + CATEGORIES= databases -HOMEPAGE= https://github.com/puppetlabs/hiera +HOMEPAGE= http://projects.puppetlabs.com/projects/hiera -MODULES= lang/ruby +MAINTAINER= Antoine Jacoutot # Apachev2 PERMIT_PACKAGE_CDROM= Yes @@ -15,15 +19,28 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes +MODULES= lang/ruby + +MODRUBY_HANDLE_FLAVORS= No + CONFIGURE_STYLE= ruby gem BUILD_DEPENDS= ${RUN_DEPENDS} RUN_DEPENDS= devel/ruby-json_pure,${MODRUBY_FLAVOR} -EXAMPLE_DIR= ${PREFIX}/share/examples/ruby-${GEM_MAN_SUFFIX}-hiera/ +REGRESS_DEPENDS= devel/ruby-mocha,${MODRUBY_FLAVOR} +MODRUBY_REGRESS= rspec2 + +pre-configure: + perl -pi -e 's,/var/lib,/var/db,g' \ + ${WRKSRC}/lib/hiera/backend.rb \ + ${WRKSRC}/lib/hiera/util.rb \ + ${WRKSRC}/spec/unit/util_spec.rb \ + ${WRKSRC}/README.md post-install: - ${INSTALL_DATA_DIR} ${EXAMPLE_DIR} - ${INSTALL_DATA} ${FILESDIR}/hiera.yaml ${EXAMPLE_DIR} + ${INSTALL_DATA_DIR} ${PREFIX}/${MODRUBY_RELEXAMPLEDIR}-hiera + ${INSTALL_DATA} ${FILESDIR}/hiera.yaml \ + ${PREFIX}/${MODRUBY_RELEXAMPLEDIR}-hiera .include diff --git a/databases/ruby-hiera/files/hiera.yaml b/databases/ruby-hiera/files/hiera.yaml index 96dc4071f5b..17d51185d60 100644 --- a/databases/ruby-hiera/files/hiera.yaml +++ b/databases/ruby-hiera/files/hiera.yaml @@ -1,17 +1,17 @@ -# $OpenBSD: hiera.yaml,v 1.1.1.1 2013/02/03 16:44:03 jasper Exp $ +# $OpenBSD: hiera.yaml,v 1.2 2013/03/02 13:59:20 ajacoutot Exp $ --- :backends: - yaml - -:logger: console - :hierarchy: - - "%{location}" - - common + - defaults + - %{clientcert} + - %{environment} + - global :yaml: - :datadir: /etc/puppet/hieradata - -:puppet: - :datasource: data +# datadir is empty here, so hiera uses its defaults: +# - /var/db/hiera on *nix +# - %CommonAppData%\PuppetLabs\hiera\var on Windows +# When specifying a datadir, make sure the directory exists. + :datadir: diff --git a/databases/ruby-hiera/pkg/DESCR b/databases/ruby-hiera/pkg/DESCR index 0d1b8781544..344b62934cc 100644 --- a/databases/ruby-hiera/pkg/DESCR +++ b/databases/ruby-hiera/pkg/DESCR @@ -1,4 +1,2 @@ -Hiera is a simple pluggable Hierarchical Database. It can be used to -store various information and therefor is a good fit for the -representation of infrastructure information. It can be used to querying -multiple data backends e.g. YAML or Puppet. +Hiera is a pluggable (YAML, JSON, Puppet) hierarchical database for +storing infrastructure representation data. diff --git a/databases/ruby-hiera/pkg/PLIST b/databases/ruby-hiera/pkg/PLIST index c4a3a69b87e..2a1961eefb9 100644 --- a/databases/ruby-hiera/pkg/PLIST +++ b/databases/ruby-hiera/pkg/PLIST @@ -1,5 +1,6 @@ -@comment $OpenBSD: PLIST,v 1.1.1.1 2013/02/03 16:44:03 jasper Exp $ -${GEM_BIN}/hiera${GEM_BIN_SUFFIX} +@comment $OpenBSD: PLIST,v 1.2 2013/03/02 13:59:20 ajacoutot Exp $ +@extraunexec rm -rf /var/db/hiera/* +${GEM_BIN}/hiera ${GEM_LIB}/cache/${DISTNAME}.gem ${GEM_LIB}/gems/${DISTNAME}/ ${GEM_LIB}/gems/${DISTNAME}/COPYING @@ -31,5 +32,7 @@ ${GEM_LIB}/gems/${DISTNAME}/spec/unit/console_logger_spec.rb ${GEM_LIB}/gems/${DISTNAME}/spec/unit/hiera_spec.rb ${GEM_LIB}/gems/${DISTNAME}/spec/unit/util_spec.rb ${GEM_LIB}/specifications/${DISTNAME}.gemspec -share/examples/ruby-${GEM_MAN_SUFFIX}-hiera/ -share/examples/ruby-${GEM_MAN_SUFFIX}-hiera/hiera.yaml +${MODRUBY_RELEXAMPLEDIR}-hiera/ +${MODRUBY_RELEXAMPLEDIR}-hiera/hiera.yaml +@sample ${SYSCONFDIR}/hiera.yaml +@sample /var/db/hiera