]> git.saurik.com Git - apple/system_cmds.git/blame - zic.tproj/Makefile
system_cmds-496.tar.gz
[apple/system_cmds.git] / zic.tproj / Makefile
CommitLineData
916eb79e
A
1Project = zic
2Install_Dir = /usr/sbin
1815bff5 3
2fc1e207 4HFILES = private.h
1815bff5 5CFILES = ialloc.c scheck.c zic.c
916eb79e
A
6MANPAGES = zic.8
7
ef8ad44b
A
8Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
9Extra_LD_Flags = -dead_strip
10
916eb79e
A
11include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
12
13LOCALTIME= US/Pacific
14POSIXRULES= US/Pacific
15
16Embedded=$(shell tconf --test TARGET_OS_EMBEDDED)
17
18# Embedded zic is probably not built with the same architecture as
19# the build host, so we can't use the recently built copy.
20ifeq "$(Embedded)" "YES"
21ZIC=/usr/sbin/zic
22else
23ZIC=$(DSTROOT)/usr/sbin/zic
24endif
25
26# pacificnew is obsolete and was removed from ZONE_FILES
27ZONE_FILES = africa antarctica asia australasia europe northamerica southamerica etcetera factory backward systemv solar87 solar88 solar89
28ZONEINFO = $(DSTROOT)/usr/share/zoneinfo
29
30# ftp://elsie.nci.nih.gov/pub/tzdata*.tar.gz
31# the tzdata*.tar.gz file is automatically unpacked and a version file created
32# /usr/local/share/tz/tzdata*.tar.gz is installed by the TimeZoneData project
33DATFILES = $(OBJROOT)/datfiles
c03df0e9 34TARBALL = $(shell ls $(SDKROOT)/usr/local/share/tz/tzdata* | sort | tail -n 1)
916eb79e
A
35DATVERS = $(shell basename $(TARBALL) | sed -e 's,\..*,,' -e 's/^tzdata//')
36VERSIONFILE = $(ZONEINFO)/+VERSION
37
38after_install:
39 $(MKDIR) $(DATFILES)
40 cd $(DATFILES) && tar xzf $(TARBALL)
41 $(INSTALL_DIRECTORY) $(ZONEINFO)
42 for tz in $(ZONE_FILES); do \
43 if [[ $${tz} = "northamerica" ]]; then \
44 ARG="-p America/New_York" ; \
45 else \
46 ARG="" ; \
47 fi ; \
48 $(ZIC) $${ARG} \
49 -L /dev/null \
50 -d $(ZONEINFO) \
51 -y $(DATFILES)/yearistype.sh \
52 $(DATFILES)/$${tz} ; \
53 done
54 chmod -R og-w $(ZONEINFO)
55 $(INSTALL_FILE) $(DATFILES)/zone.tab $(ZONEINFO)
56 $(INSTALL_FILE) $(DATFILES)/iso3166.tab $(ZONEINFO)
57ifeq "$(Embedded)" "YES"
58 $(INSTALL_DIRECTORY) $(DSTROOT)/private/var/db
ef8ad44b
A
59 $(INSTALL_DIRECTORY) -m a+rwx $(DSTROOT)/private/var/db/timezone
60 $(LN) -hfs /usr/share/zoneinfo/$(LOCALTIME) $(DSTROOT)/private/var/db/timezone/localtime
916eb79e
A
61else
62 $(INSTALL_DIRECTORY) $(DSTROOT)/private/etc
63 $(LN) -hfs /usr/share/zoneinfo/$(LOCALTIME) $(DSTROOT)/private/etc/localtime
64endif
ef8ad44b 65 $(RM) $(VERSIONFILE)
916eb79e
A
66 echo $(DATVERS) > $(VERSIONFILE)
67 chmod 444 $(VERSIONFILE)