Skip site navigation (1)Skip section navigation (2)
Date:      16 Jun 2000 23:27:09 -0000
From:      "Mario Sergio Fujikawa Ferreira" <lioux@uol.com.br>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/19348: New port devel/libtai with second and ¨attosecond¨ precision
Message-ID:  <20000616232709.75159.qmail@Fedaykin.here>

next in thread | raw e-mail | index | archive | help

>Number:         19348
>Category:       ports
>Synopsis:       New port devel/libtai with second and ¨attosecond¨ precision
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 16 20:40:06 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Mario Sergio Fujikawa Ferreira
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
>Environment:

FreeBSD Here.here 4.0-STABLE FreeBSD 4.0-STABLE #2: Fri Jun  9 13:22:10 EST 2000     lioux@Here.here:/usr/src/sys/compile/LIOUX  i386

>Description:

A library for storing and manipulating dates and times in second/¨attosecond¨

>How-To-Repeat:

n/a

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	libtai
#	libtai/files
#	libtai/files/md5
#	libtai/files/patch-aa
#	libtai/files/patch-ab
#	libtai/pkg
#	libtai/pkg/COMMENT
#	libtai/pkg/DESCR
#	libtai/pkg/PLIST
#	libtai/Makefile
#	libtai/patches
#	libtai/patches/patch-aa
#	libtai/patches/patch-ad
#	libtai/patches/patch-ab
#	libtai/patches/patch-ac
#	libtai/patches/patch-ae
#
echo c - libtai
mkdir -p libtai > /dev/null 2>&1
echo c - libtai/files
mkdir -p libtai/files > /dev/null 2>&1
echo x - libtai/files/md5
sed 's/^X//' >libtai/files/md5 << 'END-of-libtai/files/md5'
XMD5 (libtai-0.60.tar.gz) = 97b581ec4aefc00f461cefe3c64be244
END-of-libtai/files/md5
echo x - libtai/files/patch-aa
sed 's/^X//' >libtai/files/patch-aa << 'END-of-libtai/files/patch-aa'
X--- leapsecs.3.orig	Fri Jun 16 22:44:24 2000
X+++ leapsecs.3	Fri Jun 16 22:44:47 2000
X@@ -52,10 +52,10 @@
X 
X .B leapsecs_read
X reads the leap-second table from
X-.BR /etc/leapsecs.dat .
X+.BR PREFIX/leapsecs.dat .
X It returns 0 on success, -1 on error.
X If
X-.B /etc/leapsecs.dat
X+.B PREFIX/leapsecs.dat
X does not exist,
X .B leapsecs_read
X treats it as an empty file.
END-of-libtai/files/patch-aa
echo x - libtai/files/patch-ab
sed 's/^X//' >libtai/files/patch-ab << 'END-of-libtai/files/patch-ab'
X--- leapsecs_read.c.orig	Fri Jun 16 22:44:31 2000
X+++ leapsecs_read.c	Fri Jun 16 22:45:17 2000
X@@ -18,7 +18,7 @@
X   int i;
X   struct tai u;
X 
X-  fd = open("/etc/leapsecs.dat",O_RDONLY | O_NDELAY);
X+  fd = open("PREFIX/leapsecs.dat",O_RDONLY | O_NDELAY);
X   if (fd == -1) {
X     if (errno != ENOENT) return -1;
X     if (leapsecs) free(leapsecs);
END-of-libtai/files/patch-ab
echo c - libtai/pkg
mkdir -p libtai/pkg > /dev/null 2>&1
echo x - libtai/pkg/COMMENT
sed 's/^X//' >libtai/pkg/COMMENT << 'END-of-libtai/pkg/COMMENT'
XA library for storing and manipulating dates and times in second/attosecond
END-of-libtai/pkg/COMMENT
echo x - libtai/pkg/DESCR
sed 's/^X//' >libtai/pkg/DESCR << 'END-of-libtai/pkg/DESCR'
Xlibtai supports two time scales: (1) TAI64, covering a few hundred
Xbillion years with 1-second precision; (2) TAI64NA, covering the same
Xperiod with 1-attosecond precision. Both scales are defined in terms of
XTAI, the current international real time standard.
X
Xlibtai provides an internal format for TAI64, struct tai, designed for
Xfast time manipulations. The tai_pack() and tai_unpack() routines
Xconvert between struct tai and a portable 8-byte TAI64 storage format.
Xlibtai provides similar internal and external formats for TAI64NA.
X
Xlibtai provides struct caldate to store dates in year-month-day form. It
Xcan convert struct caldate, under the Gregorian calendar, to a modified
XJulian day number for easy date arithmetic.
X
XThis version of libtai requires a UNIX system with gettimeofday(). It
Xwill be easy to port to other operating systems with compilers
Xsupporting 64-bit arithmetic.
X
XWWW: http://cr.yp.to/libtai.html
END-of-libtai/pkg/DESCR
echo x - libtai/pkg/PLIST
sed 's/^X//' >libtai/pkg/PLIST << 'END-of-libtai/pkg/PLIST'
Xbin/easter
Xbin/leapsecs
Xbin/nowutc
Xbin/yearcal
Xlib/%%LIBFILE%%.a
Xlib/%%LIBFILE%%.so
Xlib/%%LIBFILE%%.so.%%LIBVERSION%%
X@mode 0644
Xetc/leapsecs.dat
X@mode
END-of-libtai/pkg/PLIST
echo x - libtai/Makefile
sed 's/^X//' >libtai/Makefile << 'END-of-libtai/Makefile'
X# New ports collection makefile for: libtai
X# Date created:		15 June 2000
X# Whom:			Mario S F Ferreira <lioux@linf.unb.br> et al.
X#
X# $FreeBSD$
X#
X
XPORTNAME=	libtai
XPORTVERSION=	0.60
XCATEGORIES=	devel
XMASTER_SITES=	http://cr.yp.to/libtai/
X
XMAINTAINER=	lioux@linf.unb.br
X
XEXTRA_PATCHES=	${WRKDIR}/patch-aa ${WRKDIR}/patch-ab
XALL_TARGET=	it
XINSTALL_SHLIBS= yes
X
XMAN3=	caldate.3 caldate_mjd.3 caltime.3 caltime_tai.3 leapsecs.3 \
X	tai.3 tai_now.3 tai_pack.3 taia.3 taia_now.3 taia_pack.3
X
XPLIST_SUB=	LIBVERSION=${LIBVERSION} \
X		LIBFILE=${LIBFILE}
X
X# port information
XLIBVERSION=	1
XLIBFILE=	libtai
XPROGRAM_FILES=	easter nowutc leapsecs yearcal
XPATCH_PREPROCESSING=	patch-aa patch-ab
X
Xpre-patch:
X.for i in ${PATCH_PREPROCESSING}
X	@${SED} s!PREFIX!${PREFIX}/etc!g ${FILESDIR}/${i} > ${WRKDIR}/${i}
X.endfor
X
Xpost-patch:
X	@${ECHO} >> ${WRKSRC}/Makefile
X	@${ECHO} LIBVERSION=${LIBVERSION} >> ${WRKSRC}/Makefile
X
Xdo-configure:
X	@${ECHO} "${CC} ${CFLAGS}" > ${WRKSRC}/conf-cc
X	@${ECHO} "${CC} -s" > ${WRKSRC}/conf-ld
X	@${ECHO} -fPIC -DPIC > ${WRKSRC}/conf-ccso
X
Xdo-install:
X	@${INSTALL} ${COPY} -o ${SHAREOWN} -g ${BINGRP} -m 644 \
X		${WRKSRC}/leapsecs.dat ${PREFIX}/etc
X.for i in ${MAN3}
X	@${INSTALL_MAN} ${WRKSRC}/${i} ${PREFIX}/man/man3
X.endfor
X.for i in ${PROGRAM_FILES}
X	@${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/bin
X.endfor
X.for i in ${LIBFILE}.so.${LIBVERSION} ${LIBFILE}.a
X	@${INSTALL_DATA} ${WRKSRC}/${i} ${PREFIX}/lib
X.endfor
X	${LN} -sf ${LIBFILE}.so.${LIBVERSION} ${PREFIX}/lib/${LIBFILE}.so
X
X.include <bsd.port.mk>
END-of-libtai/Makefile
echo c - libtai/patches
mkdir -p libtai/patches > /dev/null 2>&1
echo x - libtai/patches/patch-aa
sed 's/^X//' >libtai/patches/patch-aa << 'END-of-libtai/patches/patch-aa'
X--- Makefile.orig	Tue Oct 13 14:52:20 1998
X+++ Makefile	Fri Jun 16 20:30:27 2000
X@@ -5,10 +5,11 @@
X default: it
X 
X auto-ccld.sh: \
X-conf-cc conf-ld warn-auto.sh
X+conf-cc conf-ld conf-ccso warn-auto.sh
X 	( cat warn-auto.sh; \
X 	echo CC=\'`head -1 conf-cc`\'; \
X-	echo LD=\'`head -1 conf-ld`\' \
X+	echo LD=\'`head -1 conf-ld`\'; \
X+	echo CCSO=\'`head -1 conf-ccso`\' \
X 	) > auto-ccld.sh
X 
X caldate.0: \
X@@ -69,7 +70,7 @@
X 
X check: \
X load check.o libtai.a
X-	./load check libtai.a 
X+	./load check -L. -ltai
X 
X check.o: \
X compile check.c tai.h uint64.h leapsecs.h caltime.h caldate.h
X@@ -83,7 +84,7 @@
X 
X easter: \
X load easter.o libtai.a
X-	./load easter libtai.a 
X+	./load easter -L. -ltai 
X 
X easter.o: \
X compile easter.c caldate.h
X@@ -95,11 +96,11 @@
X 	chmod 755 find-systype
X 
X it: \
X-man libtai.a leapsecs check easter yearcal nowutc
X+man libtai.so libtai.a leapsecs check easter yearcal nowutc
X 
X leapsecs: \
X load leapsecs.o libtai.a
X-	./load leapsecs libtai.a 
X+	./load leapsecs -L. -ltai 
X 
X leapsecs.0: \
X leapsecs.3
X@@ -125,22 +126,22 @@
X compile leapsecs_sub.c leapsecs.h tai.h uint64.h
X 	./compile leapsecs_sub.c
X 
X-libtai.a: \
X-makelib tai_add.o tai_now.o tai_pack.o tai_sub.o tai_unpack.o \
X+OBJS=tai_add.o tai_now.o tai_pack.o tai_sub.o tai_unpack.o \
X taia_add.o taia_approx.o taia_fmtfrac.o taia_frac.o taia_half.o \
X taia_less.o taia_now.o taia_pack.o taia_sub.o taia_tai.o \
X taia_unpack.o caldate_fmt.o caldate_scan.o caldate_fmjd.o \
X caldate_mjd.o caldate_norm.o caldate_ster.o leapsecs_read.o \
X leapsecs_init.o leapsecs_add.o leapsecs_sub.o caltime_fmt.o \
X caltime_scan.o caltime_tai.o caltime_utc.o
X-	./makelib libtai.a tai_add.o tai_now.o tai_pack.o \
X-	tai_sub.o tai_unpack.o taia_add.o taia_approx.o \
X-	taia_fmtfrac.o taia_frac.o taia_half.o taia_less.o \
X-	taia_now.o taia_pack.o taia_sub.o taia_tai.o taia_unpack.o \
X-	caldate_fmt.o caldate_scan.o caldate_fmjd.o caldate_mjd.o \
X-	caldate_norm.o caldate_ster.o leapsecs_read.o \
X-	leapsecs_init.o leapsecs_add.o leapsecs_sub.o caltime_fmt.o \
X-	caltime_scan.o caltime_tai.o caltime_utc.o
X+
X+libtai.a: \
X+makelib $(OBJS)
X+	./makelib libtai.a $(OBJS)
X+
X+libtai.so: \
X+makelibso $(OBJS) $(OBJS:S/.o$/.so/g)
X+	./makelibso libtai.so $(OBJS:S/.o$/.so/g)
X+	ln -sf libtai.so libtai.so.${LIBVERSION}
X 
X load: \
X make-load warn-auto.sh systype
X@@ -168,13 +169,24 @@
X 	makelib
X 	chmod 755 makelib
X 
X+make-makelibso: \
X+make-makelibso.sh auto-ccld.sh
X+	cat auto-ccld.sh make-makelibso.sh > make-makelibso
X+	chmod 755 make-makelibso
X+
X+makelibso: \
X+make-makelibso warn-auto.sh systype
X+	( cat warn-auto.sh; ./make-makelibso "`cat systype`" ) > \
X+	makelibso
X+	chmod 755 makelibso
X+
X man: \
X tai.0 tai_now.0 tai_pack.0 taia.0 taia_now.0 taia_pack.0 caldate.0 \
X caldate_mjd.0 caltime.0 caltime_tai.0 leapsecs.0
X 
X nowutc: \
X load nowutc.o libtai.a
X-	./load nowutc libtai.a 
X+	./load nowutc -L. -ltai 
X 
X nowutc.o: \
X compile nowutc.c leapsecs.h tai.h uint64.h taia.h caltime.h caldate.h
X@@ -291,7 +303,7 @@
X 
X yearcal: \
X load yearcal.o libtai.a
X-	./load yearcal libtai.a 
X+	./load yearcal -L. -ltai 
X 
X yearcal.o: \
X compile yearcal.c caldate.h
END-of-libtai/patches/patch-aa
echo x - libtai/patches/patch-ad
sed 's/^X//' >libtai/patches/patch-ad << 'END-of-libtai/patches/patch-ad'
X--- make-compileso.sh.orig	Wed Dec 31 21:00:00 1969
X+++ make-compileso.sh	Fri Jun 16 02:05:36 2000
X@@ -0,0 +1 @@
X+echo exec "$CC $CCSO" -o '¨$@¨' -c '${1+"$@"}'
END-of-libtai/patches/patch-ad
echo x - libtai/patches/patch-ab
sed 's/^X//' >libtai/patches/patch-ab << 'END-of-libtai/patches/patch-ab'
X--- conf-ccso.orig	Wed Dec 31 21:00:00 1969
X+++ conf-ccso	Fri Jun 16 19:17:52 2000
X@@ -0,0 +1 @@
X+-fPIC -DPIC
END-of-libtai/patches/patch-ab
echo x - libtai/patches/patch-ac
sed 's/^X//' >libtai/patches/patch-ac << 'END-of-libtai/patches/patch-ac'
X--- make-compile.sh.orig	Tue Oct 13 14:52:20 1998
X+++ make-compile.sh	Fri Jun 16 19:18:35 2000
X@@ -1 +1,2 @@
X-echo exec "$CC" -c '${1+"$@"}'
X+echo "$CC" -c '${1+"$@"}'
X+echo "$CC" $CCSO -o '${1%.c}'.so -c '${1+"$@"}'
END-of-libtai/patches/patch-ac
echo x - libtai/patches/patch-ae
sed 's/^X//' >libtai/patches/patch-ae << 'END-of-libtai/patches/patch-ae'
X--- make-makelibso.sh.orig	Wed Dec 31 21:00:00 1969
X+++ make-makelibso.sh	Fri Jun 16 19:32:24 2000
X@@ -0,0 +1,3 @@
X+echo 'main="$1"; shift'
X+echo 'rm -f "$main"'
X+echo $CC '-shared -Wl,-soname,$main -o "$main" ${1+"$@"}'
END-of-libtai/patches/patch-ae
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000616232709.75159.qmail>