summaryrefslogtreecommitdiff
path: root/puppet/modules/rubygems/manifests/gpgme.pp
blob: e9b04a9a2a598da57be9e686971e15c336dc9507 (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
class rubygems::gpgme{
  case $::operatingsystem {
    debian,ubuntu: {
      case $::lsbdistcodename {
        'lenny','squeeze': {
          # install gpgme as gem, as the squeeze deb-package is too old
          # for i.e. gpg module
          $provider    = 'gem'
          $packagename = 'ruby-gpgme'
          }
        default:  {
          # don't need to install gpgme as gem, debian package works
          # fine with the gpg module
          $provider    = 'apt'
          $packagename = 'libgpgme-ruby'
        }
      }
    }
    default: {
      $provider = 'gem'
      $packagename = 'ruby-gpgme'
    }
  }

  if $provider == 'gem' {
    require rubygems::devel
    require gpg::gpgme::devel
  }

  package{'ruby-gpgme':
    ensure   => present,
    provider => $provider,
    name     => $packagename
  }
}