Package Details: ruby-gettext-setup 0.34-1

Git Clone URL: https://aur.archlinux.org/ruby-gettext-setup.git (read-only, click to copy)
Package Base: ruby-gettext-setup
Description: A gem that configures gettext for internationalization.
Upstream URL: https://github.com/puppetlabs/gettext-setup-gem
Licenses: Apache
Submitter: supermario
Maintainer: supermario
Last Packager: supermario
Votes: 1
Popularity: 0.34
First Submitted: 2016-09-07 11:48
Last Updated: 2020-01-22 18:18

Latest Comments

PedroHLC commented on 2020-02-01 13:50

==> Starting check()...

An error occurred while loading ./spec/lib/tasks/gettext_rake_spec.rb.
Failure/Error: require 'rake'

It seems like to be missing a make dependency.

bastelfreak commented on 2020-01-21 18:47

I updated it again for 0.34. This time I also attached the patch file. thanks for the reminder!

# Maintainer: Mario Finelli <mario at finel dot li>
# Contributor: Tim Meusel <tim@bastelfreak.de>

# https://github.com/puppetlabs/gettext-setup-gem/issues/73
_gemname='gettext-setup'
pkgname="ruby-${_gemname}"
pkgver=0.34
pkgrel=1
pkgdesc='A gem that configures gettext for internationalization'
arch=('any')
url='https://github.com/puppetlabs/gettext-setup-gem'
license=('Apache')
makedepends=('ruby-rdoc' 'ruby-bundler')
depends=('ruby' 'ruby-fast_gettext' 'ruby-gettext')
checkdepends=('ruby-rake' 'ruby-rspec' 'git')
source=("https://github.com/puppetlabs/gettext-setup-gem/archive/${pkgver}/${_gemname}-gem-${pkgver}.tar.gz" 'disable-simplecov.patch')
options=("!emptydirs")
sha512sums=('479e2a79768923796960b45f1e3b3963939a4166c636ad4c3af60840a5c8449fa7fff81271b4c938e5a441146b25fcdd9fd8bb60e1df7ef31bb39efc56577572'
            '10c399266d07aab811c8911d742c6225f7ef9c0cd184485a21a0887a8d273095e2815d860d1457a8e61d1f15f0c53d0e46a8ba0a7d371293d67d32384babe01e')

prepare() {
  cd "${srcdir}/${_gemname}-gem-${pkgver}"

  # allow latest dependencies
  sed --in-place 's|~>|>=|g' "${_gemname}.gemspec"

  # The Rakefile and a helper file try to load a bunch of gems to report the CI status to a cloud provider
  # Also it tries to execute a ruby linter for a legacy Ruby version
  # all those tools aren't required to build and test the software, also we don't have them in the repos.
  sed --in-place "s/spec.version.*/spec.version       = '0.34'/" "${_gemname}.gemspec"
  sed --in-place "/spec.add_development_dependency 'rubocop'/d" "${_gemname}.gemspec"
  sed --in-place "/spec.add_development_dependency 'simplecov'/d" "${_gemname}.gemspec"

  # allow latest gettext version (removes explicit upper boundary)
  sed --in-place "s/.*'gettext'.*/  spec.add_dependency 'gettext'/" "${_gemname}.gemspec"
  patch -p1 -N -i "${srcdir}/disable-simplecov.patch"
}

build() {
  cd "${srcdir}/${_gemname}-gem-${pkgver}"
  gem build "${_gemname}.gemspec"
}

check() {
  cd "${srcdir}/${_gemname}-gem-${pkgver}"
  rspec spec
}

package() {
  cd "${_gemname}-gem-${pkgver}"
  local _gemdir="$(gem env gemdir)"
  gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.gem"

  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"

  # delete cache files from the build process
  rm -rf "${pkgdir}/${_gemdir}/cache"
}

# vim: ts=2 sw=2 et:
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1120dfc..ca4560a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,14 +1,9 @@
 # frozen_string_literal: true

-require 'simplecov'
 require_relative '../lib/gettext-setup'

 GettextSetup.initialize(File.join(File.dirname(__FILE__), 'fixtures', 'locales'))

-SimpleCov.start do
-  add_filter '/spec/'
-end
-
 def cmd_present?(cmd)
   # Try to call out to msgcmp, if it doesn't error, we have the tool
   `#{cmd} --version`

bastelfreak commented on 2020-01-05 13:35

Hi, I updated the PKGBUILD to build properly from source:

# Maintainer: Mario Finelli <mario at finel dot li>
# Contributor: Tim Meusel <tim@bastelfreak.de>

_gemname='gettext-setup'
pkgname="ruby-${_gemname}"
pkgver=0.31
pkgrel=1
pkgdesc='A gem that configures gettext for internationalization'
arch=('any')
url='https://github.com/puppetlabs/gettext-setup-gem'
license=('Apache')
makedepends=('ruby-rdoc' 'ruby-rake' 'ruby-rspec' 'ruby-bundler' 'git' 'ruby-irb')
depends=('ruby' 'ruby-fast_gettext' 'ruby-gettext')
source=("https://github.com/puppetlabs/gettext-setup-gem/archive/${pkgver}/${_gemname}-gem-${pkgver}.tar.gz" 'disable-simplecov.patch')
options=("!emptydirs")
sha512sums=('ac408d37a4feb03043368db6dd1e0fe3cc1f08c5d0c161ae8e9b80d0ac514e7d5891fdbdbcafa7bc72c960d38b6965b73c56d5d4e9a3fe1da0502667c33142ef'
            '98f2618e864d785b6b82ef98be66796449dca7c6787110e46c6eb195d778b6f8fca289ef83812fc2a75cf9afd6c62c4a67bda45fe10144bce2a0368507619220')

# The Rakefile and a helper file try to load a bunch of gems to report the CI status to a cloud provider
# Also it tries to execute a ruby linter for a legacy Ruby version
# all those tools aren't required to build and test the software, also we don't have them in the repos.
prepare() {
  cd "${_gemname}-gem-${pkgver}"
  sed --in-place 's|~>|>=|g' "${_gemname}.gemspec"
  sed --in-place "s/spec.version.*/spec.version       = '0.31.0'/" "${_gemname}.gemspec"
  sed --in-place "/spec.add_development_dependency 'rubocop'/d" "${_gemname}.gemspec"
  sed --in-place "/spec.add_development_dependency 'simplecov'/d" "${_gemname}.gemspec"
  patch -p1 -N -i "${srcdir}/disable-simplecov.patch"
}

build() {
  cd "${_gemname}-gem-${pkgver}"
  gem build "${_gemname}.gemspec"
}

check() {
  cd "${_gemname}-gem-${pkgver}"
  # unit tests currently don't work for a number of reasons
  # - they require outdated gems
  # - they require irb 1.1
  # - they need to be executed in a git directory
  # https://github.com/puppetlabs/gettext-setup-gem/pull/74
  # https://github.com/puppetlabs/gettext-setup-gem/pull/68
  #rspec spec
}

package() {
  cd "${_gemname}-gem-${pkgver}"
  local _gemdir="$(gem env gemdir)"
  gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "${_gemname}-${pkgver}.0.gem"

  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"

  rm -rf "${pkgdir}/${_gemdir}/cache"
}

# vim: ts=2 sw=2 et: