xref: /freebsd/share/zoneinfo/Makefile (revision 641a6cfb86023499caafe26a4d821a0b885cf00b)
1# $FreeBSD$
2
3#
4# HOW TO UPDATE THE ZONEINFO DATA
5#
6# With the use of subversion, this is a little bit simpler than the CVS method.
7#
8# Import the new sources to the vendor branch:
9#
10# $ cd ~/svn/vendor/tzdata/dist
11# $ tar zxvf /usr/ports/distfile/tzdata2008X.tar.gz
12#   (check with "svn stat" and "svn diff" if it all makes sense)
13# $ svn commit	# Commit message: "Vendor import of tzdata2008X (+details)"
14#
15# Tag it
16#
17# $ cd ~/svn/vendor/tzdata
18# $ svn cp svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist \
19#	svn+ssh://svn.freebsd.org/base/vendor/tzdata/tzdata2008X
20# $ svn update	# Commit message: "Tag of tzdata2008X"
21#
22# Merge-from-vendor
23#
24# $ cd ~/svn/head/share/zoneinfo
25# $ svn update
26# $ svn merge -c X --accept=postpone \
27#	svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist .
28# $ svn update	# Commit message: "MFV of tzdata2008X"
29#
30
31CLEANFILES+=	yearistype
32CONTRIBDIR=	${.CURDIR}/../../contrib/tzdata/
33.PATH:		${CONTRIBDIR}
34
35.if defined(LEAPSECONDS)
36LEAPFILE=	-L leapseconds
37.else
38LEAPFILE=
39.endif
40
41TZFILES=	africa antarctica asia australasia etcetera europe \
42		factory northamerica southamerica
43POSIXRULES=	America/New_York
44
45.if defined(OLDTIMEZONES)
46TZFILES+=	backward systemv
47.endif
48
49TZFILES:=	${TZFILES:S/^/${CONTRIBDIR}/}
50
51all: yearistype
52
53beforeinstall:
54	umask 022; cd ${.CURDIR}; \
55	zic -D -d ${DESTDIR}/usr/share/zoneinfo -p ${POSIXRULES} \
56	    -u ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
57	    ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
58	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
59	    ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
60
61afterinstall:
62#
63# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
64# and the contents of it exists in /usr/share/zoneinfo, then reinstall
65# it.
66#
67	@if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
68	    -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
69		zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
70		if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
71			if [ ! -z "${DESTDIR}" ]; then \
72				optC="-C ${DESTDIR}"; \
73			fi; \
74			echo "Updating /etc/localtime"; \
75			tzsetup $${optC} -r; \
76		fi; \
77	else \
78		echo "Run tzsetup(8) manually to update /etc/localtime."; \
79	fi
80
81.include <bsd.prog.mk>
82