summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/zoneinfo/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile
index e254277..6acd502 100644
--- a/share/zoneinfo/Makefile
+++ b/share/zoneinfo/Makefile
@@ -54,4 +54,24 @@ beforeinstall:
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
${.CURDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
+afterinstall:
+ @#
+ @# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
+ @# and the contents of it exists in /usr/share/zoneinfo, then reinstall
+ @# it.
+ @#
+ @if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
+ -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
+ zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
+ if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
+ if [ ! -z "${DESTDIR}" ]; then \
+ optC="-C ${DESTDIR}"; \
+ fi; \
+ echo "Updating /etc/localtime"; \
+ tzsetup ${optC} -r; \
+ fi; \
+ else \
+ echo "Run tzsetup(8) manually to update /etc/localtime."; \
+ fi
+
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud