mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-25 00:51:21 +00:00
b7f05445c0
It has been common practice to have one or more URLs at the end of the ports' pkg-descr files, one per line and prefixed with "WWW:". These URLs should point at a project website or other relevant resources. Access to these URLs required processing of the pkg-descr files, and they have often become stale over time. If more than one such URL was present in a pkg-descr file, only the first one was tarnsfered into the port INDEX, but for many ports only the last line did contain the port specific URL to further information. There have been several proposals to make a project URL available as a macro in the ports' Makefiles, over time. This commit implements such a proposal and moves one of the WWW: entries of each pkg-descr file into the respective port's Makefile. A heuristic attempts to identify the most relevant URL in case there is more than one WWW: entry in some pkg-descr file. URLs that are not moved into the Makefile are prefixed with "See also:" instead of "WWW:" in the pkg-descr files in order to preserve them. There are 1256 ports that had no WWW: entries in pkg-descr files. These ports will not be touched in this commit. The portlint port has been adjusted to expect a WWW entry in each port Makefile, and to flag any remaining "WWW:" lines in pkg-descr files as deprecated. Approved by: portmgr (tcberner)
81 lines
2.6 KiB
Makefile
81 lines
2.6 KiB
Makefile
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
|
|
|
|
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>
|