Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

24
misc/dync/DESCR Normal file
View File

@@ -0,0 +1,24 @@
The dync utility is a small, but quite useful utility, which allows
the use of C as a scripting language. This can be quite useful
****SOMETIMES****, allowing access to system calls and library functions
from the command line. For example, there are occasions when I want
to see the struct stat for a directory entry, and want to be able to
access st_mtime values, without having to parse output from "ls -l".
A simple:
int main(int argc, char **argv)
{
struct stat st;
if (stat(argv[1], &st) == 0) {
printf("%lld\n", st.st_mtime);
}
exit(0);
}
will do the job. If I was to try this by other means, I would either
have to install all of Perl, and then learn its idiosyncratic syntax,
or write a custom C program, which I would then have to compile on
each architecture I need.
This utility relies on there being a C compiler on the target machine,
and a working dlopen(3).

25
misc/dync/Makefile Normal file
View File

@@ -0,0 +1,25 @@
# $NetBSD: Makefile,v 1.19 2013/04/06 03:45:17 rodent Exp $
#
DISTNAME= dync-1.1
PKGREVISION= 2
CATEGORIES= misc
MASTER_SITES= http://www.westley.demon.co.uk/src/
MAINTAINER= agc@NetBSD.org
HOMEPAGE= http://www.alistaircrooks.co.uk/software.html
COMMENT= C language awk-like utility
GNU_CONFIGURE= yes
BUILD_TARGET= tst
USE_TOOLS+= file_cmd
CONFIGURE_ENV+= FILE_CMD=${TOOLS_FILE_CMD:Q}
CONFIGURE_ENV+= ac_cv_path_LDCONFIG=${TOOLS_LDCONFIG:Q}
INSTALLATION_DIRS+= bin ${PKGMANDIR}/man1
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/dync ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/dync.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.pkg.mk"

3
misc/dync/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.1 2001/11/01 01:27:58 zuntum Exp $
bin/dync
man/man1/dync.1

7
misc/dync/distinfo Normal file
View File

@@ -0,0 +1,7 @@
$NetBSD: distinfo,v 1.4 2005/02/24 11:02:51 agc Exp $
SHA1 (dync-1.1.tar.gz) = 58e3412a2980574d935e64f72eb45f8d017b961c
RMD160 (dync-1.1.tar.gz) = 7c9326eb5c2381e0eeb8590197c4a76e41cc01e2
Size (dync-1.1.tar.gz) = 24222 bytes
SHA1 (patch-aa) = 0d83133b2b08ed625cd33af141b3373c6a90c3be
SHA1 (patch-ab) = 384f40628562c10741988d77043af73a7f5b66d9

View File

@@ -0,0 +1,16 @@
$NetBSD: patch-aa,v 1.3 2004/10/08 23:33:35 kristerw Exp $
--- Makefile.in.orig Thu Aug 13 16:12:55 1998
+++ Makefile.in Sat Oct 9 01:25:39 2004
@@ -32,8 +32,9 @@
@./$(EXE) -f tests/1.c root > tests/1.out
@diff tests/1.exp tests/1.out
@echo "2. Testing stat(2)"
- @./$(EXE) -f tests/2.c tests/2.c > tests/2.out
- @diff tests/2.exp tests/2.out
+ @echo "<Skipped due to timezone-differences>"
+# @./$(EXE) -f tests/2.c tests/2.c > tests/2.out
+# @diff tests/2.exp tests/2.out
@echo "3. Testing program as argument"
@./$(EXE) 'int main() { printf("Hello world\n"); exit(0); }' > tests/3.out
@diff tests/3.exp tests/3.out

View File

@@ -0,0 +1,42 @@
$NetBSD: patch-ab,v 1.2 2004/10/08 23:33:35 kristerw Exp $
--- dync.c.orig Thu Aug 13 17:21:13 1998
+++ dync.c Sat Oct 9 01:21:37 2004
@@ -147,7 +147,7 @@
{
char cmd[MaxCmdLen];
- return (asystem(cmd, sizeof(cmd), "%s %s | %s ELF", FILE_CMD, prog, GREP_CMD) == 0);
+ return (asystem(cmd, sizeof(cmd), "%s %s | %s ELF > /dev/null 2>&1", FILE_CMD, prog, GREP_CMD) == 0);
}
/* print usage message and die */
@@ -166,8 +166,9 @@
main(int argc, char **argv)
{
char mainname[MaxFileNameLen];
- char basename[MaxFileNameLen];
+ char basename[MaxFileNameLen] = {0, };
char libname[MaxFileNameLen];
+ char fulllibname[MaxFileNameLen];
char file[MaxFileNameLen];
char cflags[MaxCmdLen];
char cmd[MaxCmdLen];
@@ -261,9 +262,15 @@
}
}
+ /* create absolute path to the shared lib */
+ if (getcwd(fulllibname, sizeof(fulllibname)) == NULL)
+ die("can't get working directory pathname");
+ strncat(fulllibname, "/", sizeof(fulllibname) - 1);
+ strncat(fulllibname, libname, sizeof(fulllibname) - 1);
+
/* get a handle on the shared lib */
- if ((handle = dlopen(libname, DL_LAZY)) == (void *) NULL) {
- die("can't dlopen `%s'", libname);
+ if ((handle = dlopen(fulllibname, DL_LAZY)) == (void *) NULL) {
+ die("can't dlopen `%s'", fulllibname);
}
/* remove the object file and shared object lib */