Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2001 19:55:59 -0700 (PDT)
From:      Dima Dorfman <dima@unixfreak.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/28089: New port: shuffle(1) from NetBSD
Message-ID:  <200106120255.f5C2txq48244@hornet.unixfreak.org>

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

>Number:         28089
>Category:       ports
>Synopsis:       New port: shuffle(1) from NetBSD
>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:   Mon Jun 11 20:00:18 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dima Dorfman
>Release:        FreeBSD 4.3-20010602-STABLE i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD hornet.unixfreak.org 4.3-20010602-STABLE FreeBSD 4.3-20010602-STABLE #6: Wed Jun 6 18:55:33 PDT 2001 dima@hornet.unixfreak.org:/a/home/dima/w/f/4/sys/compile/HORNET i386

>Description:

New port of shuffle(1) from NetBSD.  From pkg-descr:

	The shuffle program prints a random permutation (or ``shuffle'') of
	its input lines. This can be useful in shell scripts for selecting a
	random order in which to do a set of tasks, view a set of files, etc.

>How-To-Repeat:
	
>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:
#
#	shuffle
#	shuffle/files
#	shuffle/files/tarignore
#	shuffle/files/patch-aa
#	shuffle/distinfo
#	shuffle/pkg-descr
#	shuffle/pkg-plist
#	shuffle/pkg-comment
#	shuffle/Makefile
#
echo c - shuffle
mkdir -p shuffle > /dev/null 2>&1
echo c - shuffle/files
mkdir -p shuffle/files > /dev/null 2>&1
echo x - shuffle/files/tarignore
sed 's/^X//' >shuffle/files/tarignore << 'END-of-shuffle/files/tarignore'
XCVS
END-of-shuffle/files/tarignore
echo x - shuffle/files/patch-aa
sed 's/^X//' >shuffle/files/patch-aa << 'END-of-shuffle/files/patch-aa'
XIndex: shuffle.c
X===================================================================
XRCS file: /stl/src/NetBSD/basesrc/usr.bin/shuffle/shuffle.c,v
Xretrieving revision 1.9
Xdiff -u -r1.9 shuffle.c
X--- shuffle.c	2001/03/16 08:02:32	1.9
X+++ shuffle.c	2001/06/03 22:21:49
X@@ -37,6 +37,7 @@
X #endif /* not lint */
X 
X #include <err.h>
X+#include <limits.h>
X #include <stdio.h>
X #include <stdlib.h>
X #include <string.h>
X@@ -255,7 +256,7 @@
X 		nlines = pick;
X 	}
X 
X-	for (i = 0; i < nlines; i++) {
X+	for (i = 0; (unsigned)i < nlines; i++) {
X 		if (nflag)
X 			printf("%ld\n", (long)shuffle[i]);
X 		else
END-of-shuffle/files/patch-aa
echo x - shuffle/distinfo
sed 's/^X//' >shuffle/distinfo << 'END-of-shuffle/distinfo'
XMD5 (shuffle-20010603.tar.gz) = efd0c6290d0369ce6ec404e95dc39911
END-of-shuffle/distinfo
echo x - shuffle/pkg-descr
sed 's/^X//' >shuffle/pkg-descr << 'END-of-shuffle/pkg-descr'
XThe shuffle program prints a random permutation (or ``shuffle'') of
Xits input lines. This can be useful in shell scripts for selecting a
Xrandom order in which to do a set of tasks, view a set of files, etc.
END-of-shuffle/pkg-descr
echo x - shuffle/pkg-plist
sed 's/^X//' >shuffle/pkg-plist << 'END-of-shuffle/pkg-plist'
Xbin/shuffle
END-of-shuffle/pkg-plist
echo x - shuffle/pkg-comment
sed 's/^X//' >shuffle/pkg-comment << 'END-of-shuffle/pkg-comment'
XProduce random permutations
END-of-shuffle/pkg-comment
echo x - shuffle/Makefile
sed 's/^X//' >shuffle/Makefile << 'END-of-shuffle/Makefile'
X# New ports collection makefile for:	shuffle
X# Date created:			3 June 2001
X# Whom:				Dima Dorfman <dima@unixfreak.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	shuffle
XPORTVERSION=	20010603
XCATEGORIES=	misc
XMASTER_SITES=	${MASTER_SITE_LOCAL} \
X		http://www.unixfreak.org/~dima/distfiles/
XMASTER_SITE_SUBDIR=	dd
X
XMAINTAINER=	dima@unixfreak.org
X
XMAN1=		shuffle.1
XMANCOMPRESSED=	maybe
X
X# This isn't very scalable, but I'm lazy..
X.if defined(NOMANCOMPRESS)
XMANNAME=	shuffle.1
X.else
XMANNAME=	shuffle.1.gz
X.endif
X
Xdo-install:
X	@${INSTALL_PROGRAM} ${WRKSRC}/shuffle ${PREFIX}/bin/shuffle
X	@${INSTALL_MAN} ${WRKSRC}/${MANNAME} ${PREFIX}/man/man1
X
X#
X# Ports build/install stuff stops here.  Tarball creation stuff begins here.
X#
X.include <bsd.port.pre.mk>
XCVS_CMD?=	cvs -z3
XCVS_DATE=	Sun Jun  3 15:58:14 PDT 2001
XCVS_SITES?=	anoncvs@anoncvs.netbsd.org:/cvsroot
XCVS_MODULE=	basesrc/usr.bin/shuffle
X
X#
X# CVS checkout stuff mostly stolen from security/openssh-askpass port by
X# kris@freebsd.org
X#
Xtarball:
X	@${MKDIR} ${DISTDIR}/${PKGNAME} && \
X	cd ${DISTDIR}/${PKGNAME}; \
X	for CVS_SITE in ${CVS_SITES}; do \
X		${ECHO_MSG} ">> Attempting to check out from $${CVS_SITE}."; \
X		if ${CVS_CMD} -d $${CVS_SITE} co -D "${CVS_DATE}" \
X		    ${CVS_MODULE}; then \
X			cd ${DISTDIR}; \
X			${ECHO_MSG} ">> Creating dist tarball in ${DISTDIR}"; \
X			${ECHO_MSG} ">> \"${PKGNAME}.tar.gz\"."; \
X			${MV} ${PKGNAME}/${CVS_MODULE} \
X				${PKGNAME}/${CVS_MODULE:H}/${PKGNAME}; \
X			${TAR} -cz \
X				-X ${FILESDIR}/tarignore \
X				-f ${PKGNAME}.tar.gz \
X				-C ${PKGNAME}/${CVS_MODULE:H} \
X				${PKGNAME}; \
X			exit; \
X		fi \
X	done; \
X	${RMDIR} ${DISTDIR}/${PKGNAME}; \
X	${ECHO_MSG} ">> CVS checkout failed."; \
X	exit 1;
X
X.include <bsd.port.post.mk>
END-of-shuffle/Makefile
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?200106120255.f5C2txq48244>