Browse Source

split tzdata and tzcode, using multiple DISTFILES no longer supported

Waldemar Brodkorb 10 years ago
parent
commit
04c36baff7

+ 36 - 0
package/tzcode/Makefile

@@ -0,0 +1,36 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+PKG_NAME:=		tzcode
+PKG_VERSION:=		2014d
+PKG_RELEASE:=		1
+PKG_HASH:=		e9c775bb76c9700521ada77776277c25f8650a22b56d46c9f00f4147970ef13e
+PKG_DESCR:=		date utility
+PKG_SECTION:=		base/apps
+PKG_URL:=		http://www.iana.org/time-zones/
+PKG_SITES:=		http://www.iana.org/time-zones/repository/releases/
+PKG_NOPARALLEL:=	1
+
+PKG_LIBC_DEPENDS:=	glibc musl
+
+DISTFILES:=             $(PKG_NAME)$(PKG_VERSION).tar.gz
+WRKDIST=		$(WRKDIR)
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,DATE,date,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKGSD_DATE),$(PKG_SECTION)))
+
+CONFIG_STYLE:=		manual
+HOST_CFLAGS+=		-DSTD_INSPIRED=1 -DHAVE_STDINT_H=1
+TARGET_CFLAGS+=		-DHAVE_INTTYPES_H=1
+XAKE_FLAGS+=		TZDIR="/usr/share/zoneinfo" cc="$(TARGET_CC)"
+ALL_TARGET:=		ALL
+INSTALL_TARGET:=	INSTALL
+
+date-install:
+	$(INSTALL_DIR) $(IDIR_DATE)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/date $(IDIR_DATE)/usr/bin/
+
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 107 - 0
package/tzcode/patches/patch-Makefile

@@ -0,0 +1,107 @@
+--- w-tzdata-2014d-1.orig/Makefile	2014-05-28 06:35:46.000000000 +0200
++++ w-tzdata-2014d-1/Makefile	2014-05-30 09:15:54.792171067 +0200
+@@ -45,33 +45,33 @@ POSIXRULES=	America/New_York
+ 
+ # Everything gets put in subdirectories of. . .
+ 
+-TOPDIR=		/usr/local
++TZTOPDIR=	/usr
+ 
+ # "Compiled" time zone information is placed in the "TZDIR" directory
+ # (and subdirectories).
+ # Use an absolute path name for TZDIR unless you're just testing the software.
+ 
+ TZDIR_BASENAME=	zoneinfo
+-TZDIR=		$(TOPDIR)/etc/$(TZDIR_BASENAME)
++TZDIR=		$(TZTOPDIR)/etc/$(TZDIR_BASENAME)
+ 
+ # Types to try, as an alternative to time_t.  int64_t should be first.
+ TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t
+ 
+ # The "tzselect", "zic", and "zdump" commands get installed in. . .
+ 
+-ETCDIR=		$(TOPDIR)/etc
++ETCDIR=		$(TZTOPDIR)/etc
+ 
+ # If you "make INSTALL", the "date" command gets installed in. . .
+ 
+-BINDIR=		$(TOPDIR)/bin
++BINDIR=		$(TZTOPDIR)/bin
+ 
+ # Manual pages go in subdirectories of. . .
+ 
+-MANDIR=		$(TOPDIR)/man
++MANDIR=		$(TZTOPDIR)/man
+ 
+ # Library functions are put in an archive in LIBDIR.
+ 
+-LIBDIR=		$(TOPDIR)/lib
++LIBDIR=		$(TZTOPDIR)/lib
+ 
+ # If you always want time values interpreted as "seconds since the epoch
+ # (not counting leap seconds)", use
+@@ -224,7 +224,7 @@ GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-co
+ # before the first Monday in January when a "%V" format is used and January 1
+ # falls on a Friday, Saturday, or Sunday.
+ 
+-CFLAGS=
++CFLAGS?=
+ 
+ # Linker flags.  Default to $(LFLAGS) for backwards compatibility
+ # to tzcode2012h and earlier.
+@@ -232,7 +232,7 @@ CFLAGS=
+ LDFLAGS=	$(LFLAGS)
+ 
+ zic=		./zic
+-ZIC=		$(zic) $(ZFLAGS)
++ZIC=		./zic_for_build $(ZFLAGS)
+ 
+ ZFLAGS=
+ 
+@@ -338,7 +338,7 @@ SHELL=		/bin/sh
+ 
+ all:		tzselect zic zdump libtz.a $(TABDATA)
+ 
+-ALL:		all date
++ALL:		zic_for_build date
+ 
+ install:	all $(DATA) $(REDO) $(MANS)
+ 		mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \
+@@ -371,6 +371,14 @@ zdump:		$(TZDOBJS)
+ zic:		$(TZCOBJS) yearistype
+ 		$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
+ 
++zic_for_build: version.h
++		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) zic.c -o zic_build.o
++		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) localtime.c -o localtime_build.o
++		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) asctime.c -o asctime_build.o
++		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) scheck.c -o scheck_build.o
++		$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) ialloc.c -o ialloc_build.o
++		$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ zic_build.o localtime_build.o asctime_build.o scheck_build.o ialloc_build.o 
++
+ yearistype:	yearistype.sh
+ 		cp yearistype.sh yearistype
+ 		chmod +x yearistype
+@@ -378,11 +386,11 @@ yearistype:	yearistype.sh
+ leapseconds:	$(LEAP_DEPS)
+ 		$(AWK) -f leapseconds.awk leap-seconds.list >$@
+ 
+-posix_only:	zic $(TDATA)
++posix_only:	zic_for_build $(TDATA)
+ 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
+ 			-L /dev/null $(TDATA)
+ 
+-right_only:	zic leapseconds $(TDATA)
++right_only:	zic_for_build leapseconds $(TDATA)
+ 		$(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) \
+ 			-L leapseconds $(TDATA)
+ 
+@@ -520,7 +528,7 @@ check_time_t_alternatives:
+ 		for type in $(TIME_T_ALTERNATIVES); do \
+ 		  mkdir -p tzpublic/$$type && \
+ 		  make clean_misc && \
+-		  make TOPDIR=`pwd`/tzpublic/$$type \
++		  make TZTOPDIR=`pwd`/tzpublic/$$type \
+ 		    CFLAGS='$(CFLAGS) -Dtime_tz='"'$$type'" \
+ 		    install && \
+ 		  diff -qr tzpublic/int64_t/etc/zoneinfo tzpublic/$$type/etc/zoneinfo && \

+ 38 - 0
package/tzcode/patches/patch-localtime_c

@@ -0,0 +1,38 @@
+--- w-tzdata-2014d-1.orig/localtime.c	2014-01-18 07:42:22.000000000 +0100
++++ w-tzdata-2014d-1/localtime.c	2014-05-30 09:09:35.130879741 +0200
+@@ -1329,7 +1329,7 @@ localsub(const time_t *const timep, cons
+ }
+ 
+ struct tm *
+-localtime(const time_t *const timep)
++localtime_tz(const time_t *const timep)
+ {
+ 	tzset();
+ 	return localsub(timep, 0L, &tm);
+@@ -1550,7 +1550,7 @@ ctime(const time_t *const timep)
+ **	to local time in the form of a string. It is equivalent to
+ **		asctime(localtime(timer))
+ */
+-	return asctime(localtime(timep));
++	return asctime(localtime_tz(timep));
+ }
+ 
+ char *
+@@ -1929,7 +1929,7 @@ time1(struct tm *const tmp,
+ }
+ 
+ time_t
+-mktime(struct tm *const tmp)
++mktime_tz(struct tm *const tmp)
+ {
+ 	tzset();
+ 	return time1(tmp, localsub, 0L);
+@@ -1973,7 +1973,7 @@ timeoff(struct tm *const tmp, const long
+ long
+ gtime(struct tm *const tmp)
+ {
+-	const time_t	t = mktime(tmp);
++	const time_t	t = mktime_tz(tmp);
+ 
+ 	if (t == WRONG)
+ 		return -1;

+ 9 - 20
package/tzdata/Makefile

@@ -6,7 +6,7 @@ include $(ADK_TOPDIR)/rules.mk
 PKG_NAME:=		tzdata
 PKG_VERSION:=		2014d
 PKG_RELEASE:=		1
-PKG_HASH:=		4b4966912f5d4a299b0bdf47e6f3103d82dc6a0b5a6b321e2b9d5662597a62f0 e9c775bb76c9700521ada77776277c25f8650a22b56d46c9f00f4147970ef13e
+PKG_HASH:=		4b4966912f5d4a299b0bdf47e6f3103d82dc6a0b5a6b321e2b9d5662597a62f0
 PKG_DESCR:=		timezone data (/usr/share/zoneinfo)
 PKG_SECTION:=		base/apps
 PKG_URL:=		http://www.iana.org/time-zones/
@@ -15,36 +15,29 @@ PKG_NOPARALLEL:=	1
 
 PKG_LIBC_DEPENDS:=	glibc musl
 
-DISTFILES:=             ${PKG_NAME}${PKG_VERSION}.tar.gz tzcode${PKG_VERSION}.tar.gz
-# both archives do not extract into subdirectories
-WRKDIST=		${WRKDIR}
-
-# no use for tzselect, since that is a ksh-script
-PKG_SUBPKGS:=		TZDATA DATE
-PKGSD_DATE:=		famous date utility
+DISTFILES:=             $(PKG_NAME)$(PKG_VERSION).tar.gz
+WRKDIST=		$(WRKDIR)
 
 include $(ADK_TOPDIR)/mk/package.mk
 
-$(eval $(call PKG_template,TZDATA,tzdata,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
-$(eval $(call PKG_template,DATE,date,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_DATE},${PKG_SECTION}))
+$(eval $(call PKG_template,TZDATA,tzdata,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
 
 CONFIG_STYLE:=		manual
 HOST_CFLAGS+=		-DSTD_INSPIRED=1 -DHAVE_STDINT_H=1
 TARGET_CFLAGS+=		-DHAVE_INTTYPES_H=1
-XAKE_FLAGS+=		TZDIR="/usr/share/zoneinfo" cc="${TARGET_CC}"
-# the uppercase targets enable building and installation of the date utility
+XAKE_FLAGS+=		TZDIR="/usr/share/zoneinfo" cc="$(TARGET_CC)"
 ALL_TARGET:=		ALL
 INSTALL_TARGET:=	INSTALL
 
 tzdata-install:
 	$(INSTALL_DIR) $(IDIR_TZDATA)/usr/share/zoneinfo $(IDIR_TZDATA)/etc
-	cd ${WRKINST} && for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
+	cd $(WRKINST) && for f in UTC $(ADK_RUNTIME_TIMEZONE); do \
 		test -s usr/share/zoneinfo/"$$f" || continue; \
 		echo usr/share/zoneinfo/"$$f" | \
-		${STAGING_HOST_DIR}/usr/bin/cpio -pdu ${IDIR_TZDATA}/; \
+		$(STAGING_HOST_DIR)/usr/bin/cpio -pdu $(IDIR_TZDATA)/; \
 	done
 	tz=; cd $(IDIR_TZDATA)/usr/share/zoneinfo || exit 1; \
-		for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
+		for f in UTC $(ADK_RUNTIME_TIMEZONE); do \
 			test -s "$$f" || continue; \
 			tz=$$f; \
 	done; if test x"$$tz" = x""; then \
@@ -55,8 +48,4 @@ tzdata-install:
 		$(IDIR_TZDATA)/etc/localtime; \
 	fi	
 
-date-install:
-	${INSTALL_DIR} ${IDIR_DATE}/usr/bin
-	${INSTALL_BIN} ${WRKINST}/usr/bin/date ${IDIR_DATE}/usr/bin/
-
-include ${ADK_TOPDIR}/mk/pkg-bottom.mk
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk