aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2010-12-16 16:31:52 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2010-12-16 16:31:52 +0000
commit5065ade88aa78a3a833d81276b8c5c9a13ed8a55 (patch)
treec669021dfff38739b455f4c77896987c76b22cb8 /sysutils
parent872654feb263e5bb75ef56fcd3fd1facb1e5f878 (diff)
downloadports-5065ade88aa78a3a833d81276b8c5c9a13ed8a55.tar.gz
ports-5065ade88aa78a3a833d81276b8c5c9a13ed8a55.zip
Notes
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/moreutils-parallel/Makefile33
-rw-r--r--sysutils/moreutils-parallel/distinfo2
-rw-r--r--sysutils/moreutils-parallel/files/parallel.1105
-rw-r--r--sysutils/moreutils-parallel/files/patch-Makefile63
-rw-r--r--sysutils/moreutils-parallel/files/patch-parallel.c29
-rw-r--r--sysutils/moreutils-parallel/pkg-descr10
7 files changed, 243 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 0d712c921d17..b947f317948f 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -515,6 +515,7 @@
SUBDIR += moosefs-client
SUBDIR += moosefs-master
SUBDIR += moreutils
+ SUBDIR += moreutils-parallel
SUBDIR += most
SUBDIR += mount.app
SUBDIR += mountsmb2
diff --git a/sysutils/moreutils-parallel/Makefile b/sysutils/moreutils-parallel/Makefile
new file mode 100644
index 000000000000..f3d59e18131e
--- /dev/null
+++ b/sysutils/moreutils-parallel/Makefile
@@ -0,0 +1,33 @@
+# ex:ts=8
+# New ports collection makefile for: moreutils-parallel
+# Date created: 2010-12-09
+# Whom: Charlie Kester <corky1951@comcast.net>
+#
+# $FreeBSD$
+#
+
+PORTNAME= moreutils-parallel
+PORTVERSION= 0.43
+CATEGORIES= sysutils
+MASTER_SITES= ${MASTER_SITE_DEBIAN_POOL}
+DISTNAME= moreutils_${PORTVERSION}
+
+MAINTAINER= corky1951@comcast.net
+COMMENT= Run programs in parallel
+
+CONFLICTS= parallel-[0-9]*
+
+ALL_TARGET= bins
+WRKSRC= ${WRKDIR}/moreutils
+
+MAN1= parallel.1
+MANCOMPRESSED= no
+PLIST_FILES= bin/parallel
+
+post-patch:
+ cd ${FILESDIR} && ${CP} ${MAN1} ${WRKSRC}/
+
+post-install:
+ cd ${WRKSRC} && ${INSTALL_MAN} ${MAN1} ${MANPREFIX}/man/man1/
+
+.include <bsd.port.mk>
diff --git a/sysutils/moreutils-parallel/distinfo b/sysutils/moreutils-parallel/distinfo
new file mode 100644
index 000000000000..7ffe946af31b
--- /dev/null
+++ b/sysutils/moreutils-parallel/distinfo
@@ -0,0 +1,2 @@
+SHA256 (moreutils_0.43.tar.gz) = 09e31e4f308bb1e8f9ab4f7d57f9e3c8246e3e3824015534af59763114a85c7d
+SIZE (moreutils_0.43.tar.gz) = 44233
diff --git a/sysutils/moreutils-parallel/files/parallel.1 b/sysutils/moreutils-parallel/files/parallel.1
new file mode 100644
index 000000000000..a206a8b0640d
--- /dev/null
+++ b/sysutils/moreutils-parallel/files/parallel.1
@@ -0,0 +1,105 @@
+.\" -*- coding: us-ascii -*-
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH parallel 1 2009-07-02 "" ""
+.SH NAME
+parallel \- run programs in parallel
+.SH SYNOPSIS
+'nh
+.fi
+.ad l
+\fBparallel\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+[options] [command] \fB--\fR [argument ...]
+'in \n(.iu-\nxu
+.ad b
+'hy
+'nh
+.fi
+.ad l
+\fBparallel\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+[options] \fB--\fR [command ...]
+'in \n(.iu-\nxu
+.ad b
+'hy
+.SH DESCRIPTION
+\fBparallel\fR runs the specified command,
+passing it a single one of the specified arguments. This is
+repeated for each argument. Jobs may be run in
+parallel. The default is to run one job per CPU.
+.PP
+If no command is specified before the --,
+the commands after it are instead run in parallel.
+.SH OPTIONS
+.TP
+\*(T<\fB\-j maxjobs\fR\*(T>
+Use to limit the number of jobs
+that are run at the same time.
+.TP
+\*(T<\fB\-l maxload\fR\*(T>
+Avoid starting new jobs when
+the system's load average is not below
+the specified limit.
+.TP
+\*(T<\fB\-i\fR\*(T>
+Normally the command is passed the
+argument at the end of its command line. With
+this option, the first instance of "{}" in
+the command is replaced with the argument.
+.TP
+\*(T<\fB\-n\fR\*(T>
+Number of arguments to pass to a
+command at a time. Default is 1.
+Incompatible with -i
+.SH EXAMPLE
+'nh
+.fi
+.ad l
+\fBparallel sh -c "echo hi; sleep 2; echo bye" -- 1 2 3\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+'in \n(.iu-\nxu
+.ad b
+'hy
+.PP
+This runs three subshells that each print a message, delay,
+and print another message. If your system has multiple
+CPUs, parallel will run some of the jobs in parallel,
+which should be clear from the order the messages are
+output.
+.PP
+'nh
+.fi
+.ad l
+\fBparallel -j 3 ufraw -o processed -- *.NEF\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+'in \n(.iu-\nxu
+.ad b
+'hy
+.PP
+This runs three ufraw processes at the same time until
+all of the NEF files have been processed.
+.PP
+'nh
+.fi
+.ad l
+\fBparallel -j 3 -- ls df "echo hi"\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+'in \n(.iu-\nxu
+.ad b
+'hy
+.PP
+This runs three independent commands in parallel.
+.SH "EXIT STATUS"
+Its exit status is the combination of the exit statuses of each
+command ran, ORed together. (Thus, if any one command
+exits nonzero, \fBparallel\fR as a whole will exit nonzero.)
diff --git a/sysutils/moreutils-parallel/files/patch-Makefile b/sysutils/moreutils-parallel/files/patch-Makefile
new file mode 100644
index 000000000000..8c833ab1bd19
--- /dev/null
+++ b/sysutils/moreutils-parallel/files/patch-Makefile
@@ -0,0 +1,63 @@
+--- ./Makefile.orig 2010-10-29 12:47:09.000000000 -0700
++++ ./Makefile 2010-12-09 13:08:46.000000000 -0800
+@@ -1,51 +1,18 @@
+-BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel
+-PERLSCRIPTS=vidir vipe ts combine zrun chronic
+-MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 chronic.1 mispipe.1 lckdo.1 parallel.1
+-CFLAGS=-O2 -g -Wall
++BINS=parallel
++MANS=parallel.1
++CFLAGS+= -Wall
+ INSTALL_BIN?=install -s
+-PREFIX=/usr
+-
+-DOCBOOK2XMAN=docbook2x-man
+
+ all: $(BINS) $(MANS)
++
++bins: ${BINS}
++
++mans: ${MANS}
+
+ clean:
+ rm -f $(BINS) $(MANS)
+
+ install:
+- mkdir -p $(DESTDIR)$(PREFIX)/bin
+- $(INSTALL_BIN) $(BINS) $(DESTDIR)$(PREFIX)/bin
+- install $(PERLSCRIPTS) $(DESTDIR)$(PREFIX)/bin
++ mkdir -p $(PREFIX)/bin
++ $(INSTALL_BIN) $(BINS) $(PREFIX)/bin
+
+- mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
+- install $(MANS) $(DESTDIR)$(PREFIX)/share/man/man1
+-
+-check: isutf8
+- ./check-isutf8
+-
+-isutf8.1: isutf8.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-ifdata.1: ifdata.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-ifne.1: ifne.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-pee.1: pee.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-sponge.1: sponge.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-mispipe.1: mispipe.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-lckdo.1: lckdo.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-parallel.1: parallel.docbook
+- $(DOCBOOK2XMAN) $<
+-
+-%.1: %
+- pod2man --center=" " --release="moreutils" $< > $@;
diff --git a/sysutils/moreutils-parallel/files/patch-parallel.c b/sysutils/moreutils-parallel/files/patch-parallel.c
new file mode 100644
index 000000000000..5e096a506693
--- /dev/null
+++ b/sysutils/moreutils-parallel/files/patch-parallel.c
@@ -0,0 +1,29 @@
+--- ./parallel.c.orig 2010-07-06 12:06:47.000000000 -0700
++++ ./parallel.c 2010-11-17 15:49:57.000000000 -0800
+@@ -87,6 +87,7 @@
+ return;
+ }
+
++#ifdef HAVE_WAITID
+ int wait_for_child(int options) {
+ id_t id_ignored = 0;
+ siginfo_t infop;
+@@ -101,6 +102,18 @@
+ }
+ return 1;
+ }
++#else
++int wait_for_child(int options) {
++ int status;
++
++ if(waitpid(-1, &status, options) == -1)
++ return -1; /* nothing to wait for */
++ if(WIFEXITED(status))
++ return WEXITSTATUS(status);
++ return 1;
++}
++#endif
++
+
+ int main(int argc, char **argv) {
+ int maxjobs = -1;
diff --git a/sysutils/moreutils-parallel/pkg-descr b/sysutils/moreutils-parallel/pkg-descr
new file mode 100644
index 000000000000..195a343de7b6
--- /dev/null
+++ b/sysutils/moreutils-parallel/pkg-descr
@@ -0,0 +1,10 @@
+The 'parallel' utility from the moreutils suite. Runs multiple jobs
+at once.
+
+Made available as a seperate port so the rest of the suite can be
+installed without conflicting with sysutils/parallel.
+
+moreutils is a growing collection of the unix tools that nobody
+thought to write thirty years ago.
+
+WWW: http://kitenet.net/~joey/code/moreutils/