Makefile revision 296697
1# $FreeBSD: head/share/zoneinfo/Makefile 296697 2016-03-11 23:45:17Z bdrewery $
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 commit	# Commit message: "Tag of tzdata2008X"
21#
22# Merge-from-vendor
23#
24# $ cd ~/svn/head/contrib/tzdata
25# $ svn update
26# $ svn merge -c X --accept=postpone \
27#	svn+ssh://svn.freebsd.org/base/vendor/tzdata/dist .
28# $ svn commit	# Commit message: "MFV of tzdata2008X"
29#
30
31CLEANFILES+=	yearistype
32CLEANDIRS+=	builddir
33CONTRIBDIR=	${.CURDIR}/../../contrib/tzdata/
34.PATH:		${CONTRIBDIR}
35
36.if defined(LEAPSECONDS)
37LEAPFILE=	-L ${CONTRIBDIR}leapseconds
38.else
39LEAPFILE=
40.endif
41
42TZFILES=	africa antarctica asia australasia etcetera europe \
43		factory northamerica southamerica
44POSIXRULES=	America/New_York
45
46.if defined(OLDTIMEZONES)
47TZFILES+=	backward systemv
48.endif
49
50TZFILES:=	${TZFILES:S/^/${CONTRIBDIR}/}
51
52TZBUILDDIR=	${.OBJDIR}/builddir
53TZBUILDSUBDIRS=	\
54		Africa \
55		America/Argentina \
56		America/Indiana \
57		America/Kentucky \
58		America/North_Dakota \
59		Antarctica \
60		Arctic \
61		Asia \
62		Atlantic \
63		Australia \
64		Etc \
65		Europe \
66		Indian \
67		Pacific \
68		SystemV
69
70.if !defined(_SKIP_BUILD)
71all: zoneinfo
72.endif
73
74.PHONY: zoneinfo
75zoneinfo: yearistype ${TDATA}
76	mkdir -p ${TZBUILDDIR}
77	cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
78	umask 022; cd ${.CURDIR}; \
79	zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
80	    ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
81
82beforeinstall:
83	cd ${TZBUILDDIR} && \
84	    find -s * -type f -print -exec ${INSTALL} \
85	    -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
86	    \{} ${DESTDIR}/usr/share/zoneinfo/\{} \;
87	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
88	    ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
89
90afterinstall:
91#
92# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
93# and the contents of it exists in /usr/share/zoneinfo, then reinstall
94# it.
95#
96	@if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
97	    -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
98		zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
99		if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
100			if [ ! -z "${DESTDIR}" ]; then \
101				optC="-C ${DESTDIR}"; \
102			fi; \
103			echo "Updating /etc/localtime"; \
104			tzsetup $${optC} -r; \
105		fi; \
106	else \
107		echo "Run tzsetup(8) manually to update /etc/localtime."; \
108	fi
109
110.include <bsd.prog.mk>
111