Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/zoneinfo Instead of ${ZIC}-ing to ${DESTDIR}/usr/share...



details:   https://anonhg.NetBSD.org/src/rev/75942d8ce097
branches:  trunk
changeset: 540583:75942d8ce097
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Dec 19 10:56:39 2002 +0000

description:
Instead of ${ZIC}-ing to ${DESTDIR}/usr/share/zoneinfo and using chmod and
chown to frob permissions, use ${ZIC} to ${.OBJDIR}/builddir, create a
temporary mtree(8) specfile, and use "${PAX} -M -N ${NETBSDSRCDIR}/etc"
to copy to ${DESTDIR}/usr/share/zoneinfo, looking up root:wheel in
${NETBSDSRCDIR}/etc instead of the host system database.

diffstat:

 share/zoneinfo/Makefile |  61 ++++++++++++++++++++++++++++++------------------
 1 files changed, 38 insertions(+), 23 deletions(-)

diffs (91 lines):

diff -r d26a7a1352d3 -r 75942d8ce097 share/zoneinfo/Makefile
--- a/share/zoneinfo/Makefile   Thu Dec 19 10:38:28 2002 +0000
+++ b/share/zoneinfo/Makefile   Thu Dec 19 10:56:39 2002 +0000
@@ -1,6 +1,4 @@
-#      $NetBSD: Makefile,v 1.29 2002/06/10 18:47:12 mason Exp $
-
-NOOBJ= # defined
+#      $NetBSD: Makefile,v 1.30 2002/12/19 10:56:39 lukem Exp $
 
 .include <bsd.own.mk>
 
@@ -50,20 +48,30 @@
 DATA=          $(YDATA) $(NDATA) $(SDATA) leapseconds # yearistype.sh
 USNO=          usno1988 usno1989
 
-ZIC?=zic
+ZIC?=          zic
+
+TZBUILDDIR=    ${.OBJDIR}/builddir
+TZBUILDSPEC=   ${.OBJDIR}/builddir.spec
 
 .PHONY:        posix_only
 posix_only: ${TDATA}
-       ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L /dev/null ${TDATA}
+       mkdir -p ${TZBUILDDIR}
+       cd ${.CURDIR} && \
+           ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L /dev/null ${TDATA}
 
 .PHONY:        right_only
 right_only: leapseconds ${TDATA}
-       ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -L leapseconds ${TDATA}
+       mkdir -p ${TZBUILDDIR}
+       cd ${.CURDIR} && \
+           ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -L leapseconds ${TDATA}
 
 .PHONY:        other_two
 other_two: leapseconds ${TDATA}
-       ${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/posix -L /dev/null ${TDATA}
-       ${ZIC} -y ${YEARISTYPE} -d ${TZDIR}/right -L leapseconds ${TDATA}
+       mkdir -p ${TZBUILDDIR}
+       cd ${.CURDIR} && \
+           ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/posix -L /dev/null ${TDATA}
+       cd ${.CURDIR} && \
+           ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR}/right -L leapseconds ${TDATA}
 
 .PHONY:        posix_right
 posix_right: posix_only other_two
@@ -73,21 +81,28 @@
 
 .if ${MKSHARE} != "no"
 afterinstall: ${DATA} ${REDO}
-       ${ZIC} -y ${YEARISTYPE} -d ${TZDIR} -p ${POSIXRULES}
-       find ${TZDIR} -type d | xargs chmod u=rwX,go=rX
-       find ${TZDIR} -type f | xargs chmod a=r
-.if !defined(UNPRIVED)
-       chown -R ${BINOWN}:${BINGRP} ${TZDIR}
-.else
-       find ${TZDIR} -type d | xargs -n 1 printf \
-               "%s type=dir mode=0755 uname=${BINOWN} gname=${BINGRP}\n" | \
-               sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
-       find ${TZDIR} -type f | xargs -n 1 printf \
-               "%s type=file mode=0444 uname=${BINOWN} gname=${BINGRP}\n" | \
-               sed -e 's|^/|./|g' -e 's|//|/|g' | ${CAT} -l >> ${METALOG}
-.endif
-.else
-afterinstall:
+       mkdir -p ${TZBUILDDIR}
+       cd ${.CURDIR} && \
+           ${ZIC} -y ${YEARISTYPE} -d ${TZBUILDDIR} -p ${POSIXRULES}
+       cd ${TZBUILDDIR} && \
+       (   find . -type d | xargs -n 1 printf \
+               "%s type=dir mode=0755 uname=${BINOWN} gname=${BINGRP}\n" ; \
+           find . -type f | xargs -n 1 printf \
+               "%s type=file mode=0444 uname=${BINOWN} gname=${BINGRP}\n" ; \
+       ) > ${TZBUILDSPEC}
+       cd ${TZBUILDDIR} && \
+           ${PAX} -rw ${UNPRIVED:D:U-pe} -M -N ${NETBSDSRCDIR}/etc ${TZDIR} \
+           < ${TZBUILDSPEC}
+.if defined(UNPRIVED)
+       sed -e "s|^\.|./${TZDIR}|g" -e "s|//|/|g" < ${TZBUILDSPEC} | \
+           ${CAT} -l >>${METALOG}
 .endif
 
+.else  # ${MKSHARE} == "no"
+afterinstall:
+.endif # ${MKSHARE} == "no"
+
+clean:
+       -rm -rf ${TZBUILDDIR} ${TZBUILDSPEC}
+
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index