kumquat-buildroot/package/tzdata/tzdata.mk
Yann E. MORIN 5c0c4861be package/tzdata: do extract to get the license file
Back in 2014, about 6 years ago now, in my infinite wisdom, I
decided that extracting the tzdata source was not necessary for
the target variant, because we would be installing the files
generated by the host variant, in commit 7aad5daa5d (package/tzdata:
only compile the zoneinfo once).

However, that did not account for the fact that we would eventually
like to have the licensing information for tzdata, later added in
2019, in commit 60889ccdf0 (package/tzdata: bump to version 2019b).

However, that last comit only added the license file to the host
variant, without explanations why that was so. It turns out that the
reason it was not added to the target variant is, probably, that he
source code for the target variant is not extracted, and thus saving
the license file fails.

But we really want the license file for what goes on into the target.

So, do extract the source code for the target variant, even if only to
get the license file.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Richard Braun <rbraun@sceen.net>
Cc: Martin Bark <martin@barkynet.com>
Cc: Christopher McCrory <chrismcc@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-04-27 22:48:13 +02:00

67 lines
2.1 KiB
Makefile

################################################################################
#
# tzdata
#
################################################################################
TZDATA_VERSION = 2020a
TZDATA_SOURCE = tzdata$(TZDATA_VERSION).tar.gz
TZDATA_SITE = https://www.iana.org/time-zones/repository/releases
TZDATA_STRIP_COMPONENTS = 0
TZDATA_DEPENDENCIES = host-tzdata
HOST_TZDATA_DEPENDENCIES = host-zic
TZDATA_LICENSE = Public domain
TZDATA_LICENSE_FILES = LICENSE
# Take care when re-ordering this list since this might break zone
# dependencies
TZDATA_DEFAULT_ZONELIST = \
africa antarctica asia australasia europe northamerica \
southamerica pacificnew etcetera backward systemv factory
ifeq ($(call qstrip,$(BR2_TARGET_TZ_ZONELIST)),default)
TZDATA_ZONELIST = $(TZDATA_DEFAULT_ZONELIST)
else
TZDATA_ZONELIST = $(call qstrip,$(BR2_TARGET_TZ_ZONELIST))
endif
TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
ifneq ($(TZDATA_LOCALTIME),)
define TZDATA_SET_LOCALTIME
if [ ! -f $(TARGET_DIR)/usr/share/zoneinfo/$(TZDATA_LOCALTIME) ]; then \
printf "Error: '%s' is not a valid timezone, check your BR2_TARGET_LOCALTIME setting\n" \
"$(TZDATA_LOCALTIME)"; \
exit 1; \
fi
ln -sf ../usr/share/zoneinfo/$(TZDATA_LOCALTIME) $(TARGET_DIR)/etc/localtime
echo "$(TZDATA_LOCALTIME)" >$(TARGET_DIR)/etc/timezone
endef
endif
define TZDATA_INSTALL_TARGET_CMDS
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
cp -a $(HOST_DIR)/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
cd $(TARGET_DIR)/usr/share/zoneinfo; \
for zone in posix/*; do \
ln -sfn "$${zone}" "$${zone##*/}"; \
done
$(TZDATA_SET_LOCALTIME)
endef
define HOST_TZDATA_BUILD_CMDS
(cd $(@D); \
for zone in $(TZDATA_ZONELIST); do \
$(ZIC) -d _output/posix -y yearistype.sh $$zone || exit 1; \
$(ZIC) -d _output/right -L leapseconds -y yearistype.sh $$zone || exit 1; \
done; \
)
endef
define HOST_TZDATA_INSTALL_CMDS
$(INSTALL) -d -m 0755 $(HOST_DIR)/share/zoneinfo
cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/share/zoneinfo
endef
$(eval $(generic-package))
$(eval $(host-generic-package))