summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9d5516e9ad694fa2d7f418191ab35a481f0ffff2 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=mercurial-stable-hg
pkgver=r46489.fb6eca7b8c63
pkgrel=1
pkgdesc="Distributed source control management tool (development stable branch)"
arch=('i686' 'x86_64')
url="https://www.mercurial-scm.org/"
license=('GPL2')
depends=('glibc' 'python')
makedepends=('mercurial' 'python-docutils' 'rust')
optdepends=('tk: for the hgk GUI')
provides=('mercurial')
conflicts=('mercurial')
backup=('etc/mercurial/hgrc')
source=("hg+https://www.mercurial-scm.org/repo/hg#branch=stable"
        "mercurial.profile::https://git.archlinux.org/svntogit/packages.git/plain/trunk/mercurial.profile?h=packages/mercurial")
sha256sums=('SKIP'
            'SKIP')


pkgver() {
  cd "hg"

  printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)"
}

build() {
  cd "hg"

  make PURE="--rust" all
  make -C "contrib/chg"
}

check() {
  cd "hg"

  #make tests
}

package() {
  cd "hg"

  make DESTDIR="$pkgdir" PREFIX="/usr" PURE="--rust" install
  make DESTDIR="$pkgdir" PREFIX="/usr" -C "contrib/chg" install

  install -Dm755 contrib/{hgk,hg-ssh} -t "$pkgdir/usr/bin"
  install -Dm644 "contrib/bash_completion" "$pkgdir/usr/share/bash-completion/completions/hg"
  install -Dm644 "contrib/zsh_completion" "$pkgdir/usr/share/zsh/site-functions/_hg"

  install -Dm644 contrib/{mq.el,mercurial.el} -t "$pkgdir/usr/share/emacs/site-lisp"
  install -Dm644 "contrib/vim/HGAnnotate.vim" -t "$pkgdir/usr/share/vim/vimfiles/syntax"

  install -Dm755 "$srcdir/mercurial.profile" "$pkgdir/etc/profile.d/mercurial.sh"

  # FS#38825 - Add certs config to package
  install -dm755 "$pkgdir/etc/mercurial"
  printf "[web]\ncacerts = /etc/ssl/certs/ca-certificates.crt\n" >> "$pkgdir/etc/mercurial/hgrc"
}