summaryrefslogtreecommitdiff
path: root/extra/mercurial/PKGBUILD
blob: 224342902b927f993602fea1ff71c6ee38097fd3 (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
# $Id: PKGBUILD 151621 2012-02-28 20:53:00Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=mercurial
pkgver=2.1
pkgrel=2
pkgdesc="A scalable distributed SCM tool"
arch=('i686' 'x86_64')
url="http://mercurial.selenic.com/"
license=('GPL')
depends=('python2')
optdepends=('tk: for the hgk GUI')
backup=('etc/mercurial/hgrc')
source=("http://mercurial.selenic.com/release/${pkgname}-${pkgver}.tar.gz"
        'mercurial.profile'
        'mercurial-2.1-return-code.patch')
md5sums=('d2ca44f8d0129ab50639143af99d9363'
         '43e1d36564d4c7fbe9a091d3ea370a44'
         '025e2ec8acc18a9b2a1b4f51f7bddbe3')

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -Np1 -i "${srcdir}/mercurial-2.1-return-code.patch"
  python2 setup.py install --root="${pkgdir}/" --optimize=1

  sed -i -e 's#env python#env python2#' \
    "${pkgdir}"/usr/lib/python2.7/site-packages/mercurial/lsprof.py

  install -d ${pkgdir}/usr/share/man/{man1,man5}
  install -m644 doc/hg.1 "${pkgdir}/usr/share/man/man1"
  install -m644 doc/{hgrc.5,hgignore.5} "${pkgdir}/usr/share/man/man5"
  install -m755 contrib/hgk "${pkgdir}/usr/bin"
  install -m644 -D contrib/zsh_completion "${pkgdir}/usr/share/zsh/site-functions/_hg"
  install -m644 -D contrib/bash_completion "${pkgdir}/etc/bash_completion.d/hg"
  install -d "${pkgdir}/usr/share/emacs/site-lisp"
  install -m644 contrib/{mq.el,mercurial.el} "${pkgdir}/usr/share/emacs/site-lisp"

  vimpath="${pkgdir}/usr/share/vim/vimfiles"
  install -Dm644 contrib/vim/HGAnnotate.vim "${vimpath}/syntax/HGAnnotate.vim"

  # set some variables
  install -m755 -d ${pkgdir}/etc/profile.d
  install -m755 ${srcdir}/mercurial.profile "${pkgdir}/etc/profile.d/mercurial.sh"

  # install configuration file
  install -m755 -d ${pkgdir}/etc/mercurial
  install -m644 contrib/sample.hgrc "${pkgdir}/etc/mercurial/hgrc"
}