aboutsummaryrefslogtreecommitdiff
path: root/misc/bogosort
diff options
context:
space:
mode:
authorPeter Pentchev <roam@FreeBSD.org>2004-08-11 13:57:27 +0000
committerPeter Pentchev <roam@FreeBSD.org>2004-08-11 13:57:27 +0000
commitb549a1416b3f1f6d83daf84464caec603d151d93 (patch)
tree51f84d8a7c35444b470cf7f48000982b153dad90 /misc/bogosort
parent61321e9fffc64187bb11ab09d1ad5db9a29987bf (diff)
downloadports-b549a1416b3f1f6d83daf84464caec603d151d93.tar.gz
ports-b549a1416b3f1f6d83daf84464caec603d151d93.zip
A whole lotta fixes:
- fix build with gcc-3.4; - fix sortedp.c and zbogotest to handle empty files properly; - add a 'test' target; - use INFO and PLIST_FILES and nuke pkg-plist. And yes, I know that adding HAVE_STRING_H to config.h.in is somewhat hackish; the proper fix - a string.h check in configure.in - is on its way to the bogosort developers :)
Notes
Notes: svn path=/head/; revision=115921
Diffstat (limited to 'misc/bogosort')
-rw-r--r--misc/bogosort/Makefile18
-rw-r--r--misc/bogosort/files/patch-config.h.in7
-rw-r--r--misc/bogosort/files/patch-sortedp.c11
-rw-r--r--misc/bogosort/files/patch-xmalloc.c24
-rw-r--r--misc/bogosort/pkg-plist4
5 files changed, 60 insertions, 4 deletions
diff --git a/misc/bogosort/Makefile b/misc/bogosort/Makefile
index cc049c483465..0d08beb8c10c 100644
--- a/misc/bogosort/Makefile
+++ b/misc/bogosort/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bogosort
PORTVERSION= 0.4.2
+PORTREVISION= 1
CATEGORIES= misc
MASTER_SITES= http://www.lysator.liu.se/~qha/bogosort/ \
ftp://l82.ryd.student.liu.se/pub/unix/bogosort/
@@ -21,5 +22,22 @@ WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
GNU_CONFIGURE= yes
MAN1= bogosort.1
+INFO= bogosort
+PLIST_FILES= bin/bogosort
+
+test: all
+ ${PRINTF} "a\nb\nc\nd\n" > ${WRKDIR}/sorted
+ ${PRINTF} "c\na\n\d\nb\n" > ${WRKDIR}/unsorted
+ @${ECHO_MSG} "Testing bogosort"
+ @${WRKSRC}/bogosort ${WRKDIR}/unsorted | diff - ${WRKDIR}/sorted && ${ECHO_MSG} "ok"
+ @${ECHO_MSG} "Testing zbogotest"
+ @${ECHO_MSG} " ${WRKSRC}/bogosort.c"
+ @${WRKSRC}/zbogotest ${WRKSRC}/bogosort.c || ${ECHO_MSG} "ok"
+ @${ECHO_MSG} " /dev/null"
+ @${WRKSRC}/zbogotest /dev/null && ${ECHO_MSG} "ok"
+ @${ECHO_MSG} " ${WRKDIR}/unsorted"
+ @${WRKSRC}/zbogotest ${WRKDIR}/unsorted || ${ECHO_MSG} "ok"
+ @${ECHO_MSG} " ${WRKDIR}/sorted"
+ @${WRKSRC}/zbogotest ${WRKDIR}/sorted && ${ECHO_MSG} "ok"
.include <bsd.port.mk>
diff --git a/misc/bogosort/files/patch-config.h.in b/misc/bogosort/files/patch-config.h.in
new file mode 100644
index 000000000000..f9227f0c1a70
--- /dev/null
+++ b/misc/bogosort/files/patch-config.h.in
@@ -0,0 +1,7 @@
+--- config.h.in.orig Wed Aug 11 16:11:07 2004
++++ config.h.in Wed Aug 11 16:11:13 2004
+@@ -51,3 +51,4 @@
+ /* Version number of package */
+ #undef VERSION
+
++#define HAVE_STRING_H 1
diff --git a/misc/bogosort/files/patch-sortedp.c b/misc/bogosort/files/patch-sortedp.c
new file mode 100644
index 000000000000..bdea40dd489f
--- /dev/null
+++ b/misc/bogosort/files/patch-sortedp.c
@@ -0,0 +1,11 @@
+--- sortedp.c.orig Wed Aug 11 15:30:34 2004
++++ sortedp.c Wed Aug 11 15:30:49 2004
+@@ -38,6 +38,8 @@
+ {
+ int i;
+
++ if (lines[0] == NULL)
++ return 1;
+ for (i = 1; lines[i] != NULL; i++)
+ if (strcmp(lines[i - 1], lines[i]) > 0)
+ return 0;
diff --git a/misc/bogosort/files/patch-xmalloc.c b/misc/bogosort/files/patch-xmalloc.c
new file mode 100644
index 000000000000..0a6c6581e450
--- /dev/null
+++ b/misc/bogosort/files/patch-xmalloc.c
@@ -0,0 +1,24 @@
+--- xmalloc.c.orig Wed Aug 11 15:25:47 2004
++++ xmalloc.c Wed Aug 11 15:26:35 2004
+@@ -54,6 +54,8 @@
+ # define EXIT_FAILURE 1
+ #endif
+
++#include "system.h"
++
+ /* Prototypes for functions defined here. */
+ #if defined (__STDC__) && __STDC__
+ static VOID *fixup_null_alloc (size_t n);
+@@ -67,12 +69,6 @@
+ /* Exit value when the requested amount of memory is not available.
+ The caller may set it to some other value. */
+ int xmalloc_exit_failure = EXIT_FAILURE;
+-
+-#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
+-void error (int, int, const char *, ...);
+-#else
+-void error ();
+-#endif
+
+ static VOID *
+ fixup_null_alloc (n)
diff --git a/misc/bogosort/pkg-plist b/misc/bogosort/pkg-plist
deleted file mode 100644
index bf96d04d827e..000000000000
--- a/misc/bogosort/pkg-plist
+++ /dev/null
@@ -1,4 +0,0 @@
-bin/bogosort
-@unexec install-info --delete %D/info/bogosort.info %D/info/dir
-info/bogosort.info
-@exec install-info %D/info/bogosort.info %D/info/dir