Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Sep 2023 19:11:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 273641] [new port] misc/gtime: GNU version of 'time' utility
Message-ID:  <bug-273641-7788-mmbBhGBVQv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-273641-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-273641-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273641

--- Comment #4 from Ian Valentine <ivalentine@arizona.edu> ---
Comment on attachment 244860
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244860
misc/gtime: Changes per request

>>From 5353f3c8e0dd1533a5549f2d49fa324dac7965d2 Mon Sep 17 00:00:00 2001
>From: Ian Valentine <ivalentine@arizona.edu>
>Date: Fri, 15 Sep 2023 10:44:00 -0700
>Subject: [PATCH] misc/gtime: Add MAKEINFO, reformat Makefile
>
>---
> misc/gtime/Makefile                          | 51 ++++++++++++++++++++
> misc/gtime/distinfo                          |  3 ++
> misc/gtime/files/patch-tests_time-max-rss.sh | 38 +++++++++++++++
> misc/gtime/pkg-descr                         |  2 +
> 4 files changed, 94 insertions(+)
> create mode 100644 misc/gtime/Makefile
> create mode 100644 misc/gtime/distinfo
> create mode 100644 misc/gtime/files/patch-tests_time-max-rss.sh
> create mode 100644 misc/gtime/pkg-descr
>
>diff --git a/misc/gtime/Makefile b/misc/gtime/Makefile
>new file mode 100644
>index 0000000000..10d9038543
>--- /dev/null
>+++ b/misc/gtime/Makefile
>@@ -0,0 +1,51 @@
>+PORTNAME=3D	time
>+DISTVERSION=3D	1.9
>+CATEGORIES=3D	misc
>+MASTER_SITES=3D	GNU/time
>+PKGNAMEPREFIX=3D	g
>+
>+MAINTAINER=3D	ivalentine@arizona.edu
>+COMMENT=3D	GNU version of 'time' utility
>+WWW=3D		https://www.gnu.org/software/time/
>+
>+LICENSE=3D	GPLv3
>+LICENSE_FILE=3D	${WRKSRC}/COPYING
>+
>+BUILD_DEPENDS=3D	help2man:misc/help2man
>+
>+USES=3D		cpe gmake makeinfo
>+CPE_VENDOR=3D	gnu
>+
>+GNU_CONFIGURE=3D	yes
>+CONFIGURE_ARGS=3D	--program-prefix=3Dg
>+CONFIGURE_ENV+=3D	MAKEINFO=3D"${MAKEINFO} --no-split"
>+INSTALL_TARGET=3D	install-strip
>+TEST_TARGET=3D	check
>+
>+DATADIR=3D	${PREFIX}/share/${PKGBASE}
>+DOCSDIR=3D	${PREFIX}/share/doc/${PKGBASE}
>+INFO=3D		time
>+PLIST_FILES=3D	bin/gtime \
>+		man/man1/gtime.1.gz
>+PORTDOCS=3D	AUTHORS ChangeLog NEWS README
>+
>+OPTIONS_DEFINE=3D	DOCS
>+OPTIONS_SUB=3D	yes
>+
>+post-build:
>+	${MKDIR} ${WRKDIR}/man1
>+	help2man -Nn "run programs and summarize system resource usage" ${WRKSRC=
}/time -o ${WRKDIR}/man1/${PKGBASE}.1
>+
>+post-install:
>+	${INSTALL_MAN} ${WRKDIR}/man1/${PKGBASE}.1 ${STAGEDIR}${MAN1PREFIX}/man/=
man1/
>+
>+post-install-DOCS-on:
>+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
>+	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
>+
>+pre-test:
>+.for f in help-version.sh time-exit-codes.sh time-max-rss.sh time-posix-q=
uiet.sh
>+	@${REINPLACE_CMD} -e 's|env time|env ${WRKSRC}/time|g' ${WRKSRC}/tests/$=
{f}
>+.endfor
>+
>+.include <bsd.port.mk>
>diff --git a/misc/gtime/distinfo b/misc/gtime/distinfo
>new file mode 100644
>index 0000000000..1fe0e48d5b
>--- /dev/null
>+++ b/misc/gtime/distinfo
>@@ -0,0 +1,3 @@
>+TIMESTAMP =3D 1694798374
>+SHA256 (time-1.9.tar.gz) =3D fbacf0c81e62429df3e33bda4cee38756604f18e01d9=
77338e23306a3e3b521e
>+SIZE (time-1.9.tar.gz) =3D 596779
>diff --git a/misc/gtime/files/patch-tests_time-max-rss.sh b/misc/gtime/fil=
es/patch-tests_time-max-rss.sh
>new file mode 100644
>index 0000000000..7f5d8f9157
>--- /dev/null
>+++ b/misc/gtime/files/patch-tests_time-max-rss.sh
>@@ -0,0 +1,38 @@
>+--- tests/time-max-rss.sh.orig	2023-09-14 02:47:32 UTC
>++++ tests/time-max-rss.sh
>+@@ -32,13 +32,13 @@ time-aux || framework_failure_ "time-aux is missing/no
>+ env time -o mem-baseline -f "%M" time-aux \
>+   || framework_failure_ "failed to run time/time-aux (baseline max-rss)"
>+=20
>+-# Allocate 5MB of RAM
>+-env time -o mem-5MB -f "%M" time-aux -m 5M \
>+-  || framework_failure_ "failed to run time/time-aux (5M max-rss)"
>++# Allocate 400MB of RAM
>++env time -o mem-400MB -f "%M" time-aux -m 400M \
>++  || framework_failure_ "failed to run time/time-aux (400M max-rss)"
>+=20
>+ # Calculate the difference
>+ b=3D$(cat mem-baseline) || framework_failure_ "failed to read mem-baseli=
ne"
>+-c=3D$(cat mem-5MB) || framework_failure_ "failed to read mem-5MB"
>++c=3D$(cat mem-400MB) || framework_failure_ "failed to read mem-400MB"
>+ d=3D$(( c - b ))
>+=20
>+ # On some systems (e.g. OpenSolaris) getrusage(2) returns zero in ru_max=
rss.
>+@@ -48,13 +48,13 @@ test "$b" -eq "0" && test "$c" -eq 0 \
>+=20
>+ # There could be alot of variation between each invocation,
>+ # accept a reasonable range
>+-if test "$d" -ge 5000 && test "$d" -le 6000 ; then
>+-    : # acceptable values: 5000-6000 KB
>++if test "$d" -ge 400000 && test "$d" -le 500000 ; then
>++    : # acceptable values: 400000-500000 KB
>+ else
>+     cat<<EOF>&2
>+-time(1) failed to detect 5MB allcoation.
>++time(1) failed to detect 400MB allcoation.
>+   mem-baseline(kb): $b
>+-  mem-5MB(kb):      $c
>++  mem-400MB(kb):      $c
>+   delta(kb):        $d
>+ EOF
>+     fail=3D1
>diff --git a/misc/gtime/pkg-descr b/misc/gtime/pkg-descr
>new file mode 100644
>index 0000000000..57ab9872c9
>--- /dev/null
>+++ b/misc/gtime/pkg-descr
>@@ -0,0 +1,2 @@
>+GNU time runs another program, then displays information about the
>+resources used by that program.
>--=20
>2.42.0
>
>

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-273641-7788-mmbBhGBVQv>