diff options
author | schmonz <schmonz@pkgsrc.org> | 2017-10-03 00:43:22 +0000 |
---|---|---|
committer | schmonz <schmonz@pkgsrc.org> | 2017-10-03 00:43:22 +0000 |
commit | beb0b6b738509607dd2678ea26bf1d430e728470 (patch) | |
tree | 04ab3c2f91f1e7dbc354d358851d21b1c54425d5 /sysutils | |
parent | b68c98fbb743b9d8ac99ce9512c3e14bce9fd449 (diff) | |
download | pkgsrc-beb0b6b738509607dd2678ea26bf1d430e728470.tar.gz |
Initial import of fdtools, to manipulate file descriptors from shell scripts.
fdtools is a set of utilities for working with file descriptors. With
these tools, you can examine and manipulate file descriptor properties
from shell scripts, where without them you might have resorted to a
different language. These tools can rewind file descriptors, switch them
between blocking and nonblocking mode, and examine their inode
information. On some systems (currently only Linux, as far as I know)
they can also allocate, lock, and switch virtual consoles.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/fdtools/DESCR | 7 | ||||
-rw-r--r-- | sysutils/fdtools/Makefile | 32 | ||||
-rw-r--r-- | sysutils/fdtools/PLIST | 12 | ||||
-rw-r--r-- | sysutils/fdtools/distinfo | 10 | ||||
-rw-r--r-- | sysutils/fdtools/patches/patch-conf-compile_defaults_host__compile.sh | 13 | ||||
-rw-r--r-- | sysutils/fdtools/patches/patch-conf-compile_defaults_host__link.sh | 12 | ||||
-rw-r--r-- | sysutils/fdtools/patches/patch-src_recvfd.c | 16 | ||||
-rw-r--r-- | sysutils/fdtools/patches/patch-src_sigsched.c | 21 |
8 files changed, 123 insertions, 0 deletions
diff --git a/sysutils/fdtools/DESCR b/sysutils/fdtools/DESCR new file mode 100644 index 00000000000..1ac7a636fa5 --- /dev/null +++ b/sysutils/fdtools/DESCR @@ -0,0 +1,7 @@ +fdtools is a set of utilities for working with file descriptors. With +these tools, you can examine and manipulate file descriptor properties +from shell scripts, where without them you might have resorted to a +different language. These tools can rewind file descriptors, switch them +between blocking and nonblocking mode, and examine their inode +information. On some systems (currently only Linux, as far as I know) +they can also allocate, lock, and switch virtual consoles. diff --git a/sysutils/fdtools/Makefile b/sysutils/fdtools/Makefile new file mode 100644 index 00000000000..47ea7a66774 --- /dev/null +++ b/sysutils/fdtools/Makefile @@ -0,0 +1,32 @@ +# $NetBSD: Makefile,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +DISTNAME= fdtools-2015.03.28 +CATEGORIES= sysutils +MASTER_SITES= http://code.dogmap.org/fdtools/releases/ +EXTRACT_SUFX= .tar.bz2 + +MAINTAINER= schmonz@NetBSD.org +HOMEPAGE= http://code.dogmap.org/fdtools/ +COMMENT= Manipulate file descriptor properties from shell scripts +LICENSE= gnu-gpl-v2 + +DJB_RESTRICTED= no + +WRKSRC= ${WRKDIR}/misc/${PKGNAME_NOREV} +DJB_SLASHPACKAGE= YES + +INSTALLATION_DIRS+= bin + +do-configure: + ${ECHO} ${PREFIX} > ${WRKSRC}/conf-compile/defaults/package_home + ${ECHO} ${PREFIX}/lib/skalibs/sysdeps > ${WRKSRC}/conf-compile/defaults/depend_skalibs_sysdeps + +do-install: + cd ${WRKSRC}/command; \ + for i in *; do \ + ${INSTALL_PROGRAM} $${i} ${DESTDIR}${PREFIX}/bin; \ + done + +.include "../../devel/skalibs/buildlink3.mk" +.include "../../mk/djbware.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/fdtools/PLIST b/sysutils/fdtools/PLIST new file mode 100644 index 00000000000..1857d9fe847 --- /dev/null +++ b/sysutils/fdtools/PLIST @@ -0,0 +1,12 @@ +@comment $NetBSD: PLIST,v 1.1 2017/10/03 00:43:22 schmonz Exp $ +bin/grabconsole +bin/multitee +bin/pipecycle +bin/recvfd +bin/seek0 +bin/sendfd +bin/setblock +bin/statfile +bin/vc-get +bin/vc-lock +bin/vc-switch diff --git a/sysutils/fdtools/distinfo b/sysutils/fdtools/distinfo new file mode 100644 index 00000000000..9ceedb6e53c --- /dev/null +++ b/sysutils/fdtools/distinfo @@ -0,0 +1,10 @@ +$NetBSD: distinfo,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +SHA1 (fdtools-2015.03.28.tar.bz2) = 7bd1c9e067df8297e1f4bc430c33903899585aee +RMD160 (fdtools-2015.03.28.tar.bz2) = d1bfed8c1718b5ec178cc763416f677f4cc26f0d +SHA512 (fdtools-2015.03.28.tar.bz2) = e6b5665869538758edd90876c1696d753aa5859e9dc2ceffbcac98ea682e730424ea972126d20d90945d554a833278059558d85ce5290c09b3f339d0191f565c +Size (fdtools-2015.03.28.tar.bz2) = 40057 bytes +SHA1 (patch-conf-compile_defaults_host__compile.sh) = 07d7dcb943e664f838c7b1a72f8bb92d4ad994a0 +SHA1 (patch-conf-compile_defaults_host__link.sh) = d7e2ba5574885e4f09158678681f58e457a14732 +SHA1 (patch-src_recvfd.c) = 4fe086cae8fa9623e29954cb03ee5a63a72d25af +SHA1 (patch-src_sigsched.c) = ed4cf2111ab65fb80f5cbcfd6aa0c49db12a845a diff --git a/sysutils/fdtools/patches/patch-conf-compile_defaults_host__compile.sh b/sysutils/fdtools/patches/patch-conf-compile_defaults_host__compile.sh new file mode 100644 index 00000000000..80cdbfaac3d --- /dev/null +++ b/sysutils/fdtools/patches/patch-conf-compile_defaults_host__compile.sh @@ -0,0 +1,13 @@ +$NetBSD: patch-conf-compile_defaults_host__compile.sh,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +Find skalibs. + +--- conf-compile/defaults/host_compile.sh.orig 2015-03-28 22:14:58.000000000 +0000 ++++ conf-compile/defaults/host_compile.sh +@@ -4,5 +4,5 @@ + # create, respectively. The arguments are -I search directives; make sure to + # include them in the compilation command. + +-gcc -O2 ${1+"$@"} -c "${input?}" -o "${output?}" \ ++gcc -O2 -I ${PREFIX}/include ${1+"$@"} -c "${input?}" -o "${output?}" \ + -Wall -W -Wpointer-arith -Wcast-align -Wwrite-strings diff --git a/sysutils/fdtools/patches/patch-conf-compile_defaults_host__link.sh b/sysutils/fdtools/patches/patch-conf-compile_defaults_host__link.sh new file mode 100644 index 00000000000..3fa22cb50e4 --- /dev/null +++ b/sysutils/fdtools/patches/patch-conf-compile_defaults_host__link.sh @@ -0,0 +1,12 @@ +$NetBSD: patch-conf-compile_defaults_host__link.sh,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +Find skalibs. + +--- conf-compile/defaults/host_link.sh.orig 2015-03-28 22:14:58.000000000 +0000 ++++ conf-compile/defaults/host_link.sh +@@ -3,4 +3,4 @@ + # variable $output names the library file to create. The arguments are -L + # search directives and the input object files and libraries. + +-gcc -o "${output?}" -s ${1+"$@"} ++gcc -o "${output?}" -s -L ${PREFIX}/lib/skalibs ${1+"$@"} diff --git a/sysutils/fdtools/patches/patch-src_recvfd.c b/sysutils/fdtools/patches/patch-src_recvfd.c new file mode 100644 index 00000000000..6ed14fd4e7f --- /dev/null +++ b/sysutils/fdtools/patches/patch-src_recvfd.c @@ -0,0 +1,16 @@ +$NetBSD: patch-src_recvfd.c,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +Avoid "invalid operands to binary expression" with clang. + +--- src/recvfd.c.orig 2015-03-16 06:02:40.000000000 +0000 ++++ src/recvfd.c +@@ -65,7 +65,8 @@ int main(int argc, char** argv) { + if (named_fd<10) { + type_fd duped=fcntl(named_fd, F_DUPFD, 10); + if (duped<0) DIE0(dup); +- if (fd_close(named_fd)!=0) DIE1(close, "descriptor"); ++ //if (fd_close(named_fd)!=0) DIE1(close, "descriptor"); ++ fd_close(named_fd); + named_fd=duped; + } + buf[int_fmt(buf, named_fd)]='\0'; diff --git a/sysutils/fdtools/patches/patch-src_sigsched.c b/sysutils/fdtools/patches/patch-src_sigsched.c new file mode 100644 index 00000000000..e409e67f459 --- /dev/null +++ b/sysutils/fdtools/patches/patch-src_sigsched.c @@ -0,0 +1,21 @@ +$NetBSD: patch-src_sigsched.c,v 1.1 2017/10/03 00:43:22 schmonz Exp $ + +Provide a default definition, needed on at least OS X. + +--- src/sigsched.c.orig 2015-03-16 03:55:56.000000000 +0000 ++++ src/sigsched.c +@@ -36,11 +36,9 @@ XXX: how well do we clean up upon ss_exe + #define sigc_block(x) (sigblock(*(x))) + */ + +-/* +-//#ifndef NSIG +-//#define NSIG 64 / * it's not as if any sane system has more than 32 * / +-//#endif +-*/ ++#ifndef NSIG ++#define NSIG 64 /* it's not as if any sane system has more than 32 */ ++#endif + + #define NUMSIGS NSIG + |