]> git.saurik.com Git - apple/system_cmds.git/blob - zic.tproj/Makefile
system_cmds-496.tar.gz
[apple/system_cmds.git] / zic.tproj / Makefile
1 Project = zic
2 Install_Dir = /usr/sbin
3
4 HFILES = private.h
5 CFILES = ialloc.c scheck.c zic.c
6 MANPAGES = zic.8
7
8 Extra_CC_Flags = -Wall -Werror -mdynamic-no-pic
9 Extra_LD_Flags = -dead_strip
10
11 include $(MAKEFILEPATH)/CoreOS/ReleaseControl/BSDCommon.make
12
13 LOCALTIME= US/Pacific
14 POSIXRULES= US/Pacific
15
16 Embedded=$(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.
20 ifeq "$(Embedded)" "YES"
21 ZIC=/usr/sbin/zic
22 else
23 ZIC=$(DSTROOT)/usr/sbin/zic
24 endif
25
26 # pacificnew is obsolete and was removed from ZONE_FILES
27 ZONE_FILES = africa antarctica asia australasia europe northamerica southamerica etcetera factory backward systemv solar87 solar88 solar89
28 ZONEINFO = $(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
33 DATFILES = $(OBJROOT)/datfiles
34 TARBALL = $(shell ls $(SDKROOT)/usr/local/share/tz/tzdata* | sort | tail -n 1)
35 DATVERS = $(shell basename $(TARBALL) | sed -e 's,\..*,,' -e 's/^tzdata//')
36 VERSIONFILE = $(ZONEINFO)/+VERSION
37
38 after_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)
57 ifeq "$(Embedded)" "YES"
58 $(INSTALL_DIRECTORY) $(DSTROOT)/private/var/db
59 $(INSTALL_DIRECTORY) -m a+rwx $(DSTROOT)/private/var/db/timezone
60 $(LN) -hfs /usr/share/zoneinfo/$(LOCALTIME) $(DSTROOT)/private/var/db/timezone/localtime
61 else
62 $(INSTALL_DIRECTORY) $(DSTROOT)/private/etc
63 $(LN) -hfs /usr/share/zoneinfo/$(LOCALTIME) $(DSTROOT)/private/etc/localtime
64 endif
65 $(RM) $(VERSIONFILE)
66 echo $(DATVERS) > $(VERSIONFILE)
67 chmod 444 $(VERSIONFILE)