summaryrefslogtreecommitdiff
path: root/share/zoneinfo/Makefile
blob: 000e6b4654f881ee8d8897cb86d36bf0d4255ba2 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#	$NetBSD: Makefile,v 1.36 2003/10/21 10:01:20 lukem Exp $

.include <bsd.own.mk>

# Change the line below for your time zone (after finding the zone you want in
# the time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -l rightzone

# If you want something other than Eastern United States time as a template
# for handling POSIX-style time zone environment variables,
# change the line below (after finding the zone you want in the
# time zone files, or adding it to a time zone file).
# Alternately, if you discover you've got the wrong time zone, you can just
#	zic -p rightzone

POSIXRULES=	US/Pacific

# Use an absolute path name for TZDIR unless you're just testing the software.
# Note: ${DESTDIR} is prepended to this for the actual copy.

TZDIR=	/usr/share/zoneinfo

# If you always want time values interpreted as "seconds since the epoch
# (not counting leap seconds)", use
# 	REDO=		posix_only
# below.  If you always want right time values interpreted as "seconds since
# the epoch" (counting leap seconds)", use
#	REDO=		right_only
# below.  If you want both sets of data available, with leap seconds not
# counted normally, use
#	REDO=		posix_right
# below.  If you want both sets of data available, with leap seconds counted
# normally, use
#	REDO=		right_posix
# below.

REDO=		posix_only

# Since "." may not be in PATH...
YEARISTYPE=	"${HOST_SH} ${.CURDIR}/yearistype.sh"

YDATA=		africa antarctica asia australasia \
		europe northamerica southamerica pacificnew etcetera factory \
		backward
NDATA=		systemv
SDATA=		solar87 solar88 solar89
TDATA=		$(YDATA) $(NDATA) $(SDATA)
DATA=		$(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
USNO=		usno1988 usno1989

TZBUILDDIR=	${.OBJDIR}/builddir
TZBUILDSPEC=	${.OBJDIR}/builddir.spec

.PHONY:	posix_only
posix_only: ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}

.PHONY:	right_only
right_only: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}

.PHONY:	other_two
other_two: leapseconds ${TDATA}
	${_MKTARGET_CREATE}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}

.PHONY:	posix_right
posix_right: posix_only other_two

.PHONY:	right_posix
right_posix: right_only other_two

.if ${MKUNPRIVED} == "no"
TOOL_PAX.unpriv=-pe
.else
TOOL_PAX.unpriv=
.endif

.if ${MKSHARE} != "no"
afterinstall: ${DATA} ${REDO}
	${_MKMSG_CREATE} ${POSIXRULES}
	mkdir -p ${TZBUILDDIR}
	cd ${.CURDIR} && \
	    ${TOOL_ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
	cd ${TZBUILDDIR} && \
	(   find . -type d | xargs -n 1 printf \
		"%s type=dir mode=0755 uname=${BINOWN} gname=${BINGRP}\n" ; \
	    find . -type f | xargs -n 1 printf \
		"%s type=file mode=0444 uname=${BINOWN} gname=${BINGRP}\n" ; \
	) > ${TZBUILDSPEC}
	${_MKMSG_INSTALL} ${DESTDIR}${TZDIR}
	cd ${TZBUILDDIR} && \
	  ${TOOL_PAX} -O -rw ${TOOL_PAX.unpriv} -M -N ${NETBSDSRCDIR}/etc \
	  ${DESTDIR}${TZDIR} < ${TZBUILDSPEC}
.if ${MKUNPRIVED} != "no"
	sed -e "s|^\.|./${TZDIR}|g" -e "s|//|/|g" < ${TZBUILDSPEC} | \
	    ${METALOG.add}
.endif

.else	# ${MKSHARE} == "no"
afterinstall:
.endif	# ${MKSHARE} == "no"

clean:
	rm -rf ${TZBUILDDIR} ${TZBUILDSPEC}

.include <bsd.prog.mk>