summaryrefslogtreecommitdiffstats
path: root/main/py-configobj/APKBUILD
blob: 6e8f0bcbc19abfa36f1fac051123c49026c80143 (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=py-configobj
_realname=configobj
pkgver=0_hg78
_ver=0_hg
pkgrel=1
pkgdesc="Python library for reading and writing of configuration files (ini)"
url="http://code.google.com/p/configobj/"
arch="noarch"
license="GPL"
depends="python"
depends_dev="mercurial"
makedepends="$depends_dev"
install=
subpackages=
source="http://dev.alpinelinux.org/archive/configobj/$_realname-$pkgver.tar.gz"

_mercurial_url="https://code.google.com/p/configobj/"

_builddir="$srcdir"/$_realname

snapshot() {
	mkdir -p "$srcdir"
	cd "${SRCDEST:-$srcdir}"
	if ! [ -d $_realname ]; then
		hg clone $_mercurial_url || return 1
		cd $_realname
		_mercurial_revision=$(cd ${SRCDEST:-$srcdir}/$_realname && hg tip | grep changeset | egrep -o '[0-9]+:' | tr -d ":")
		_mercurial_commit=$(hg identify ${SRCDEST:-$srcdir}/$_realname | awk '{ print $1 }')
	else
		cd $_realname
		hg pull
		_mercurial_revision=$(cd ${SRCDEST:-$srcdir}/$_realname && hg tip | grep changeset | egrep -o '[0-9]+:' | tr -d ":")
		_mercurial_commit=$(hg identify ${SRCDEST:-$srcdir}/$_realname | awk '{ print $1 }')
	fi

	hg archive --prefix=$_realname/ "$SRCDEST"/${_realname}-${_ver}${_mercurial_revision}.tar.gz
	scp "$SRCDEST"/${_realname}-${_ver}${_mercurial_revision}.tar.gz dev.alpinelinux.org:/archive/$_realname/
}

prepare() {
	cd "$_builddir"
	return 0
}

build() {
	cd "$_builddir"
	return 0
}

package() {
	cd "$_builddir"
	python setup.py install --root="$pkgdir"
}

md5sums="5a796359bffe586dff2f86d3a182f693  configobj-0_hg78.tar.gz"