summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4ec569780eb552547c527f52d391c2f5707258b8 (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
# Maintainer: jason ryan <jasonwryan@gmail.com>
# Contributor: Max Meyer <dev@fedux.org>

pkgname=chruby
pkgver=0.3.9
pkgrel=3
pkgdesc="Changes the current ruby. Supports both zsh and bash."
arch=(any)
url="https://github.com/postmodern/chruby"
license=('MIT')
depends=('bash')
optdepends=('zsh')
makedepends=('gnupg')
install=${pkgname}.install
source=("https://github.com/postmodern/${pkgname}/archive/v${pkgver}.tar.gz" profile.d-chruby.sh)
sha256sums=('7220a96e355b8a613929881c091ca85ec809153988d7d691299e0a16806b42fd'
            '8256f38a8908654c4d75793774cbb85da324d73ce0137c647f43e852e6618b54')


prepare() {
  if gpg --fingerprint 0xB9515E77 >/dev/null 2>&1; then

    #download key
    msg "Downloading package signature"
    curl -L -o  ${pkgname}-${pkgver}.tar.gz.asc https://raw.github.com/postmodern/chruby/master/pkg/${pkgname}-${pkgver}.tar.gz.asc -s

    #check key
    if gpg --verify ${pkgname}-${pkgver}.tar.gz.asc ${srcdir}/v${pkgver}.tar.gz;then 
      msg "Verification of package was successfull."
    else
      msg "Verification of package failed. Please check yourself with:"
      echo "gpg --verify ${pkgname}-${pkgver}.tar.gz.asc ${srcdir}/v${pkgver}.tar.gz"
    fi

  else

    printf "\n\n"
    msg "Please import the gpg key of the chruby-author, to check package integrity:"
    msg "http://postmodern.github.com/contact.html#pgp"
    printf "\n\n"

  fi
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  #profile
  install -D -m644 ${srcdir}/profile.d-chruby.sh ${pkgdir}/etc/profile.d/chruby.sh

  #helper scripts
  install -D -m755 ${srcdir}/${pkgname}-${pkgver}/scripts/bug_report.sh ${pkgdir}/usr/share/${pkgname}/bug_report.sh
  install -D -m755 ${srcdir}/${pkgname}-${pkgver}/scripts/setup.sh ${pkgdir}/usr/share/${pkgname}/setup.sh

  #license
  install -d ${pkgdir}/usr/share/licenses/${pkgname}
  ln -s /usr/share/doc/${pkgname}-${pkgver}/LICENSE.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt

  #build
  make PREFIX="${pkgdir}/usr" install >/dev/null

}

# vim:set ts=2 sw=2 et: