1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00
freebsd-ports/misc/global-tz/Makefile

81 lines
2.6 KiB
Makefile
Raw Permalink Normal View History

misc/global-tz: new port The Global Time Zone Database (global-tz) is a fork of the IANA Time Zone Database with expanded best-effort historical data for some time zones whose clocks have agreed with other time zones since 1970. In an up to date default FreeBSD installation /usr/share/zoneinfo contains the most recent IANA tzdb release as well as compatibility links for time zones that existed in previous IANA tzdb releases (from the "backward" file in the distribution). FreeBSD releases have never included the out of scope pre-1970 historical data (from the "backzone" file in the distribution). This is the same approach as taken by most other open source projects that distribute the IANA Time Zone Database. The global-tz fork was prompted by the controversial decision by the maintainers of the IANA Time Zone Database to move time zones whose clocks have not changed since 1970 to "backzone". While previous IANA tzdb releases would return historical data for these zones if available, recent IANA tzdb releases instead return available pre-1970 data for the zones whose clocks they have agreed with since 1970 (the target of the "backward" link). The overwhelming majority of users are unlikely to be affected by this decision. FreeBSD users who rely on pre-1970 time zone history may wish to install this port. This port overwrites system files in /usr/share/zoneinfo. If you build your systems from source, add WITHOUT_ZONEINFO="yes" to /etc/src.conf. If you use freebsd-update(8), add /usr/share/zoneinfo to IgnorePaths in /etc/freebsd-update.conf. WWW: https://github.com/JodaOrg/global-tz
2022-03-21 06:59:48 +00:00
PORTNAME= global-tz
DISTVERSION= 2022agtz
CATEGORIES= misc
MASTER_SITES= https://github.com/JodaOrg/${PORTNAME}/releases/download/${DISTVERSION}/:tzdata \
https://raw.githubusercontent.com/JodaOrg/${PORTNAME}/${DISTVERSION}/:tab
DISTNAME= tzdata${DISTVERSION}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:tzdata \
zone1970.tab:tab
DIST_SUBDIR= ${DISTNAME}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= philip@FreeBSD.org
COMMENT= Fork of the IANA Time Zone Database with expanded pre-1970 data
WWW= https://github.com/JodaOrg/global-tz
misc/global-tz: new port The Global Time Zone Database (global-tz) is a fork of the IANA Time Zone Database with expanded best-effort historical data for some time zones whose clocks have agreed with other time zones since 1970. In an up to date default FreeBSD installation /usr/share/zoneinfo contains the most recent IANA tzdb release as well as compatibility links for time zones that existed in previous IANA tzdb releases (from the "backward" file in the distribution). FreeBSD releases have never included the out of scope pre-1970 historical data (from the "backzone" file in the distribution). This is the same approach as taken by most other open source projects that distribute the IANA Time Zone Database. The global-tz fork was prompted by the controversial decision by the maintainers of the IANA Time Zone Database to move time zones whose clocks have not changed since 1970 to "backzone". While previous IANA tzdb releases would return historical data for these zones if available, recent IANA tzdb releases instead return available pre-1970 data for the zones whose clocks they have agreed with since 1970 (the target of the "backward" link). The overwhelming majority of users are unlikely to be affected by this decision. FreeBSD users who rely on pre-1970 time zone history may wish to install this port. This port overwrites system files in /usr/share/zoneinfo. If you build your systems from source, add WITHOUT_ZONEINFO="yes" to /etc/src.conf. If you use freebsd-update(8), add /usr/share/zoneinfo to IgnorePaths in /etc/freebsd-update.conf. WWW: https://github.com/JodaOrg/global-tz
2022-03-21 06:59:48 +00:00
LICENSE= PD
NO_WRKSUBDIR= yes
PREFIX= /usr
DATADIR= ${PREFIX}/share/zoneinfo
NO_ARCH= yes
TZFILES= africa antarctica asia australasia etcetera europe \
factory northamerica southamerica backward
POSIXRULES= America/New_York
# XXX The global-tz distribution omits the zone1970.tab file, precluding
# it from being a drop-in replacement for the IANA Time Zone Database.
post-extract:
@${CP} ${DISTDIR}/${DIST_SUBDIR}/zone1970.tab ${WRKSRC}
# tzsetup objects (fatally) if any entry in zone.tab or zone1970.tab
# refers to a country code that doesn't exist in misc/iso3166. While
# arguably that should be fixed, for compatibility we remove such
# entries here to avoid the problem.
#
# This used to be done by adding patch files for each country to
# remove, but that doesn't work for zone1970.tab.
#
# We generate a list of all 2-letter codes that are NOT in iso3166;
# then, for any entry in zone.tab or zone1970.tab that contains a bad
# code: first emit a commented-out version of the line, then a version
# with the bad codes stripped out of the first field (unless this
# leaves the first field empty).
post-patch:
cd ${WRKSRC}; \
badc=$$(${AWK} '/^[^\#]/ { t[$$1]=1; }; \
END { for (i=0; i<676; ++i) { \
c = sprintf("%c%c", 65+int(i/26), 65+(i%26)); \
if (!(c in t)) print c; \
} \
}' \
/usr/share/misc/iso3166 | \
${SED} -n -e '1h; 1!H; $${g;s/\n/|/g;p;}'); \
for fn in zone.tab zone1970.tab; do \
${MV} $${fn} $${fn}.bak; \
${AWK} -v FS="\t" -v OFS="\t" -v re="(^|,)($${badc})" \
'/^[^#]/ && $$1 ~ re { \
print "#" $$0; \
gsub(re,"",$$1); \
sub(/^,/,"",$$1); \
}; \
$$1 != "" { print; }' <$${fn}.bak >$${fn}; \
done
do-build:
umask 022; \
cd ${WRKSRC}; \
zic -d ${WRKSRC}/zoneinfo -p ${POSIXRULES} -m ${NOBINMODE} \
-y ${.OBJDIR}/yearistype ${TZFILES}
do-install:
${MKDIR} ${STAGEDIR}${PREFIX}/share/zoneinfo
(cd ${WRKSRC}/zoneinfo && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/share/zoneinfo)
${INSTALL_DATA} ${WRKSRC}/zone.tab ${STAGEDIR}${PREFIX}/share/zoneinfo
${INSTALL_DATA} ${WRKSRC}/zone1970.tab ${STAGEDIR}${PREFIX}/share/zoneinfo
.include <bsd.port.mk>