aboutsummaryrefslogtreecommitdiffstats
path: root/main/tzdata/APKBUILD
blob: b968321198333534f4f2af47d7b1becdfe535a81 (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=tzdata
pkgver=2012j
_tzcodever=2011i
_ptzver=0.3
pkgrel=1
pkgdesc="Timezone data"
url="http://www.twinsun.com/tz/tz-link.htm"
arch="all"
license="Public Domain"
depends=
makedepends=
install=
subpackages="$pkgname-doc"
source="http://www.iana.org/time-zones/repository/releases/tzcode$_tzcodever.tar.gz
	http://www.iana.org/time-zones/repository/releases/tzdata$pkgver.tar.gz
	http://git.alpinelinux.org/cgit/ncopa/posixtz/snapshot/posixtz-$_ptzver.tar.bz2
	Makefile.patch
	0001-posixtz-fix-up-lseek.patch"

_builddir="$srcdir"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	make || return 1

	cd "$srcdir"/posixtz-$_ptzver
	make posixtz
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/share/zoneinfo/localtime
	
	if [ "$ALPINE_LIBC" = "eglibc" ]; then
		# tzselect is bashish
		depends="bash"
		# we have this in eglibc
		rm -rf "$pkgdir"/usr/sbin
	else
		rm -f "$pkgdir"/usr/bin/tzselect
		install -Dm755 "$srcdir"/posixtz-$_ptzver/posixtz \
			"$pkgdir"/usr/bin/posixtz || return 1
	fi
}

md5sums="cf7f4335b7c8682899fa2814e711c1b2  tzcode2011i.tar.gz
ba2f92ae7ad099090e8f86cff2f2d799  tzdata2012j.tar.gz
99efce32b3f870e1b071ce47f3a98a18  posixtz-0.3.tar.bz2
b12fcd52ddda1d4de16655e0c52a3675  Makefile.patch
0b4d86d855f7daa3f79c9f28f04a48f9  0001-posixtz-fix-up-lseek.patch"