summaryrefslogtreecommitdiff
path: root/repo/system/tzdata.xibuild
blob: 08137334f3e74585db92fbb759562c6e9deded38 (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
#!/bin/sh

NAME="tzdata"
DESC="Timezone data"

MAKEDEPS="cmake "
DEPS="musl "

PKG_VER=2022a
SOURCE="https://www.iana.org/time-zones/repository/releases/tzdata$PKG_VER.tar.gz"
tzcodever=2022a
ptzver=0.5

ADDITIONAL="
https://www.iana.org/time-zones/repository/releases/tzcode$tzcodever.tar.gz
https://dev.alpinelinux.org/archive/posixtz/posixtz-$ptzver.tar.xz
0002-fix-implicit-declaration-warnings-by-including-strin.patch 0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch 
"

timezones="africa antarctica asia australasia europe northamerica \
	southamerica etcetera backward factory"

prepare () {
    tar xf tzcode$tzcodever.tar.gz
    tar xf posixtz-$ptzver.tar.xz
    apply_patches
}


build() {
	make cc="${CC:-gcc}" CFLAGS="$CFLAGS -DHAVE_STDINT_H=1"
		TZDIR="/usr/share/zoneinfo"

	cd posixtz-$ptzver
	make posixtz
    cd ..
}

package () {
    ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo $timezones
	./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo/right -L leapseconds $timezones

	./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo -p America/New_York
	install -m444 -t "$PKG_DEST"/usr/share/zoneinfo iso3166.tab zone1970.tab zone.tab

	mkdir -p "$PKG_DEST"/usr/sbin
	install -m755 zic zdump "$PKG_DEST"/usr/sbin

	mkdir -p "$PKG_DEST"/usr/share/man/man8
	install -m644 zic.8 zdump.8 "$PKG_DEST"/usr/share/man/man8

	rm -f "$PKG_DEST"/usr/share/zoneinfo/localtime
	install -Dm755 posixtz-$ptzver/posixtz \
		"$PKG_DEST"/usr/bin/posixtz

}