PKGBUILD-hg.proto 1.29 KB
Newer Older
1
2
3
4
5
6
7
8
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# See http://wiki.archlinux.org/index.php/VCS_PKGBUILD_Guidelines
# for more information on packaging from Mercurial(hg) sources.

9
# Maintainer: Your Name <youremail@domain.com>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pkgname=NAME-hg
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=()
makedepends=('mercurial')
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
26
source=()
27
28
29
noextract=()
md5sums=() #generate with 'makepkg -g'

matt mooney's avatar
matt mooney committed
30
31
_hgroot=HGURL
_hgrepo=REPONAME
32
33
34
35
36

build() {
  cd "$srcdir"
  msg "Connecting to Mercurial server...."

matt mooney's avatar
matt mooney committed
37
38
  if [[ -d "$_hgrepo" ]]; then
    cd "$_hgrepo"
39
    hg pull -u
40
41
    msg "The local files are updated."
  else
matt mooney's avatar
matt mooney committed
42
    hg clone "$_hgroot" "$_hgrepo"
43
44
45
  fi

  msg "Mercurial checkout done or server timeout"
matt mooney's avatar
matt mooney committed
46
  msg "Starting build..."
47
48
49
50
51
52
53
54
55
56

  rm -rf "$srcdir/$_hgrepo-build"
  cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
  cd "$srcdir/$_hgrepo-build"

  #
  # BUILD HERE
  #
  ./autogen.sh
  ./configure --prefix=/usr
57
  make
58
59
60
61
}

package() {
  cd "$srcdir/$_hgrepo-build"
62
  make DESTDIR="$pkgdir/" install
matt mooney's avatar
matt mooney committed
63
}
matt mooney's avatar
matt mooney committed
64
65

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