xref: /dragonfly/share/zoneinfo/Makefile (revision ec21d9fb)
1# $FreeBSD: src/share/zoneinfo/Makefile,v 1.16.2.3 2002/08/07 16:31:52 ru Exp $
2
3CLEANFILES+=	yearistype
4
5.if defined(LEAPSECONDS)
6LEAPFILE=	-L leapseconds
7.else
8LEAPFILE=
9.endif
10
11ZIC_UG_FLAGS=	-u ${BINOWN} -g ${BINGRP}
12
13TZFILES=	africa antarctica asia australasia etcetera europe \
14		northamerica southamerica
15TZFILES+=	backward
16POSIXRULES=	America/New_York
17
18.if exists(${.OBJDIR}/yearistype)
19YEARISTYPE=	${.OBJDIR}/yearistype
20.else
21YEARISTYPE=	${.CURDIR}/yearistype
22.endif
23
24FILES=			iso3166.tab zone.tab
25FILESDIR_iso3166.tab=	${SHAREDIR}/misc
26FILESNAME_iso3166.tab=	iso3166
27FILESDIR_zone.tab=	${SHAREDIR}/zoneinfo
28
29all: yearistype
30
31yearistype: yearistype.sh
32	cp ${.ALLSRC} ${.TARGET}
33	chmod +x ${.TARGET}
34
35beforeinstall:
36	umask 022; cd ${.CURDIR}; \
37	zic -D -d ${DESTDIR}/usr/share/zoneinfo -p ${POSIXRULES} \
38	    ${ZIC_UG_FLAGS} ${LEAPFILE} -y ${YEARISTYPE} ${TZFILES}
39
40afterinstall:
41#
42# If the file /var/db/zoneinfo exists, and it is owned by root:wheel,
43# and the contents of it exists in /usr/share/zoneinfo, then reinstall
44# it.
45#
46	@-if [ -f ${DESTDIR}/var/db/zoneinfo -a -O ${DESTDIR}/var/db/zoneinfo \
47	    -a -G ${DESTDIR}/var/db/zoneinfo ]; then \
48		zf=$$(cat ${DESTDIR}/var/db/zoneinfo); \
49		if [ -f ${DESTDIR}/usr/share/zoneinfo/$${zf} ]; then \
50			if [ ! -z "${DESTDIR}" ]; then \
51				optC="-C ${DESTDIR}"; \
52			fi; \
53			echo "Updating /etc/localtime"; \
54			tzsetup $${optC} -r; \
55		fi; \
56	else \
57		echo "Run tzsetup(8) manually to update /etc/localtime."; \
58	fi
59
60.include <bsd.prog.mk>
61