aboutsummaryrefslogtreecommitdiffstats
path: root/package/tzdata/tzdata.mk
blob: 04d9b27690f45557b7f364a788a7b1f00743a280 (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
#############################################################
#
# tzdata
#
#############################################################

TZDATA_VERSION = 2012j
TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
TZDATA_SITE = http://www.iana.org/time-zones/repository/releases
TZDATA_DEPENDENCIES = host-zic
TZDATA_LICENSE = Public domain

TZDATA_DEFAULT_ZONELIST = africa antarctica asia australasia backward etcetera \
			europe factory northamerica pacificnew southamerica

ifeq ($(call qstrip,$(BR2_PACKAGE_TZDATA_ZONELIST)),default)
TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
else
TZDATA_ZONELIST = $(call qstrip,$(BR2_PACKAGE_TZDATA_ZONELIST))
endif

# Don't strip any path components during extraction.
define TZDATA_EXTRACT_CMDS
	gzip -d -c $(DL_DIR)/$(TZDATA_SOURCE) \
		| $(TAR) --strip-components=0 -C $(@D) -xf -
endef

define TZDATA_BUILD_CMDS
	(cd $(@D); \
		for zone in $(TZDATA_ZONELIST); do \
			$(ZIC) -d _output/posix -y yearistype.sh $$zone; \
			$(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone; \
		done; \
	)
endef

define TZDATA_INSTALL_TARGET_CMDS
	mkdir -p $(TARGET_DIR)/usr/share/zoneinfo
	cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
	for zone in posix/*; do                 \
	    ln -sfn "$${zone}" "$${zone##*/}";    \
	done
endef

$(eval $(generic-package))