aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/busybox
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2009-03-26 06:17:16 +0800
committerluigi <luigi@FreeBSD.org>2009-03-26 06:17:16 +0800
commit24365903915cc7e6e05722e09be524463d5a05a6 (patch)
tree98845339b9c23f67fe54ede0796ae0fbc8545bcf /sysutils/busybox
parenta3837ab4d8fc0fd4e36917a066a5bfc8b668c426 (diff)
downloadfreebsd-ports-gnome-24365903915cc7e6e05722e09be524463d5a05a6.tar.gz
freebsd-ports-gnome-24365903915cc7e6e05722e09be524463d5a05a6.tar.zst
freebsd-ports-gnome-24365903915cc7e6e05722e09be524463d5a05a6.zip
busybox is a set of common utilities built as a single
crunched binary, and sometimes stripped down in features to fit the needs of embedded systems. WWW: http://www.busybox.net/
Diffstat (limited to 'sysutils/busybox')
-rw-r--r--sysutils/busybox/Makefile31
-rw-r--r--sysutils/busybox/distinfo3
-rw-r--r--sysutils/busybox/files/patch-002174
-rw-r--r--sysutils/busybox/files/patch-networking51
-rw-r--r--sysutils/busybox/pkg-descr5
5 files changed, 264 insertions, 0 deletions
diff --git a/sysutils/busybox/Makefile b/sysutils/busybox/Makefile
new file mode 100644
index 000000000000..3b244b343173
--- /dev/null
+++ b/sysutils/busybox/Makefile
@@ -0,0 +1,31 @@
+# New ports collection makefile for: busybox
+# Date created: Aug.18, 2008
+# Whom: luigi@FreeBSD.org
+#
+# Maintainers: Luigi Rizzo <luigi@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= busybox
+PORTVERSION= 1.11.1
+CATEGORIES= sysutils misc shells
+MASTER_SITES= http://www.busybox.net/downloads/ \
+ http://distfiles.gentoo.org/distfiles/
+
+MAINTAINER= luigi@FreeBSD.org
+COMMENT= Busybox for FreeBSD
+
+USE_BZIP2= yes
+USE_GMAKE= yes
+
+PLIST_FILES= bin/busybox
+
+do-configure:
+ ${CP} ${FILESDIR}/data-.config ${WRKSRC}/.config
+ cd ${WRKSRC} && ${GMAKE} oldconfig
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/sysutils/busybox/distinfo b/sysutils/busybox/distinfo
new file mode 100644
index 000000000000..8f867e4c80ac
--- /dev/null
+++ b/sysutils/busybox/distinfo
@@ -0,0 +1,3 @@
+MD5 (busybox-1.11.1.tar.bz2) = c64bbb5c0c3e19f12892941a0ae86c48
+SHA256 (busybox-1.11.1.tar.bz2) = bf2fb5be14cb509af1153af15b8a14c143d61fc46fb50cfbcf3cf10764f3740f
+SIZE (busybox-1.11.1.tar.bz2) = 1924234
diff --git a/sysutils/busybox/files/patch-002 b/sysutils/busybox/files/patch-002
new file mode 100644
index 000000000000..c2008d6e4ef2
--- /dev/null
+++ b/sysutils/busybox/files/patch-002
@@ -0,0 +1,174 @@
+diff -ubwr ../../work.base/busybox-1.8.2/include/libbb.h ./include/libbb.h
+--- ../../work.base/busybox-1.8.2/include/libbb.h 2007-11-10 02:40:53.000000000 +0100
++++ ./include/libbb.h 2008-08-18 22:30:39.000000000 +0200
+@@ -31,7 +33,11 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <sys/socket.h>
++#if defined __FreeBSD__
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#endif
+ #include <sys/stat.h>
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+@@ -90,1 +90,3 @@
++#if !defined __FreeBSD__
+ int setgroups(size_t n, const gid_t *groups);
++#endif
+@@ -182,1 +182,3 @@
++#if !defined __FreeBSD__
+ char *dirname(char *path);
++#endif
+diff -ubwr ../../work.base/busybox-1.8.2/include/platform.h ./include/platform.h
+--- ../../work.base/busybox-1.8.2/include/platform.h 2007-11-10 02:40:53.000000000 +0100
++++ ./include/platform.h 2008-08-18 22:30:39.000000000 +0200
+@@ -102,6 +102,14 @@
+ # include <sex.h>
+ # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
+ # define __BYTE_ORDER BYTE_ORDER
++#elif defined __FreeBSD__
++char *strchrnul(const char *s, int c);
++# include <sys/resource.h> // rlimit
++# include <machine/endian.h>
++# define bswap_64 __bswap64
++# define bswap_32 __bswap32
++# define bswap_16 __bswap16
++# define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN)
+ #elif !defined __APPLE__
+ # include <byteswap.h>
+ # include <endian.h>
+@@ -142,1 +145,1 @@
+-# ifndef __socklen_t_defined
++# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
+@@ -168,2 +168,2 @@
+-#if (defined __digital__ && defined __unix__) || defined __APPLE__
++#if (defined __digital__ && defined __unix__) || defined __APPLE__ || defined __FreeBSD__
+ # undef HAVE_MNTENT_H
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/bb_askpass.c ./libbb/bb_askpass.c
+--- ../../work.base/busybox-1.8.2/libbb/bb_askpass.c 2007-11-10 02:40:52.000000000 +0100
++++ ./libbb/bb_askpass.c 2008-08-18 22:30:39.000000000 +0200
+@@ -35,6 +35,9 @@
+ tcgetattr(STDIN_FILENO, &oldtio);
+ tcflush(STDIN_FILENO, TCIFLUSH);
+ tio = oldtio;
++#if !defined IUCLC
++#define IUCLC 0
++#endif
+ tio.c_iflag &= ~(IUCLC|IXON|IXOFF|IXANY);
+ tio.c_lflag &= ~(ECHO|ECHOE|ECHOK|ECHONL|TOSTOP);
+ tcsetattr(STDIN_FILENO, TCSANOW, &tio);
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/lineedit.c ./libbb/lineedit.c
+--- ../../work.base/busybox-1.8.2/libbb/lineedit.c 2007-11-10 02:40:52.000000000 +0100
++++ ./libbb/lineedit.c 2008-08-18 22:30:39.000000000 +0200
+@@ -1213,3 +1213,4 @@
+ #if ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR
+ static const char null_str[] ALIGN1 = "";
+ #endif
++typedef void (*sighandler_t)(int signum);
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/makedev.c ./libbb/makedev.c
+--- ../../work.base/busybox-1.8.2/libbb/makedev.c 2007-11-10 02:40:52.000000000 +0100
++++ ./libbb/makedev.c 2008-08-18 22:30:39.000000000 +0200
+@@ -5,7 +5,7 @@
+ *
+ * Licensed under GPL version 2, see file LICENSE in this tarball for details.
+ */
+-
++#if !defined __FreeBSD__
+ /* We do not include libbb.h - #define makedev() is there! */
+ #include <features.h>
+ #include <sys/sysmacros.h>
+@@ -21,3 +21,4 @@
+ return makedev(major, minor);
+ }
+ #endif
++#endif /* !__FreeBSD__ */
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/match_fstype.c ./libbb/match_fstype.c
+--- ../../work.base/busybox-1.8.2/libbb/match_fstype.c 2007-11-10 02:40:52.000000000 +0100
++++ ./libbb/match_fstype.c 2008-08-18 22:30:39.000000000 +0200
+@@ -10,6 +10,7 @@
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ */
+
++#if !defined __FreeBSD__
+ #include "libbb.h"
+
+ int match_fstype(const struct mntent *mt, const char *fstype)
+@@ -42,3 +43,4 @@
+
+ return -(no + 1);
+ }
++#endif /* !__FreeBSD__ */
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/xfuncs.c ./libbb/xfuncs.c
+--- libbb/xfuncs.c.orig 2007-11-10 02:40:52.000000000 +0100
++++ libbb/xfuncs.c 2008-08-19 14:08:54.000000000 +0200
+@@ -428,8 +428,9 @@
+ long size;
+
+ // If the ioctl works for this, return it.
+-
++#if !defined __FreeBSD__
+ if (ioctl(fd, BLKGETSIZE, &size) >= 0) return size*512;
++#endif
+
+ // FIXME: explain why lseek(SEEK_END) is not used here!
+
+diff -ubwr ../../work.base/busybox-1.8.2/libbb/xfuncs_printf.c ./libbb/xfuncs_printf.c
+--- libbb/xfuncs_printf.c 2007-11-10 02:40:52.000000000 +0100
++++ libbb/xfuncs_printf.c 2008-08-19 14:08:54.000000000 +0200
+@@ -498,7 +499,7 @@
+ return string_ptr;
+ }
+
+-#if 0 /* If we will ever meet a libc which hasn't [f]dprintf... */
++#if defined(__FreeBSD__) /* If we will ever meet a libc which hasn't [f]dprintf... */
+ int fdprintf(int fd, const char *format, ...)
+ {
+ va_list p;
+@@ -529,6 +530,32 @@
+ }
+ return r;
+ }
++
++char *strchrnul(const char *s, int c)
++{
++ char *r = strchr(s, c);
++ if (r == NULL)
++ r = (char *)s + strlen(s);
++ return r;
++}
++
++void *memrchr(const void *s, int c, size_t n)
++{
++ const char *p = s;
++ for (p += n - 1; p != s; p--)
++ if (*p == c) break;
++ return (*p == c ? p : NULL);
++}
++
++size_t strnlen(const char *s, size_t maxlen)
++{
++ size_t i;
++ for (i = 0; i < maxlen; i++) {
++ if (s[i] == '\0')
++ break;
++ }
++ return i;
++}
+ #endif
+
+ // Die with an error message if we can't copy an entire FILE * to stdout, then
+diff -ubwr ../../work.base/busybox-1.8.2/libpwdgrp/pwd_grp.c ./libpwdgrp/pwd_grp.c
+--- ../../work.base/busybox-1.8.2/libpwdgrp/pwd_grp.c 2007-11-10 02:40:53.000000000 +0100
++++ ./libpwdgrp/pwd_grp.c 2008-08-18 22:30:39.000000000 +0200
+@@ -19,7 +19,9 @@
+ */
+
+ #include "libbb.h"
++#if !defined __FreeBSD__
+ #include <features.h>
++#endif
+ #include <assert.h>
+
+ #ifndef _PATH_SHADOW
diff --git a/sysutils/busybox/files/patch-networking b/sysutils/busybox/files/patch-networking
new file mode 100644
index 000000000000..60b1387cf31e
--- /dev/null
+++ b/sysutils/busybox/files/patch-networking
@@ -0,0 +1,51 @@
+diff -ubwr ../../work.base/busybox-1.8.2/networking/telnetd.c networking/telnetd.c
+--- ../../work.base/busybox-1.8.2/networking/telnetd.c 2007-11-10 02:54:22.000000000 +0100
++++ networking/telnetd.c 2008-08-19 13:05:36.000000000 +0200
+@@ -297,6 +297,9 @@
+ * cooked mode, and with XTABS CRMOD enabled (see tty(4)). */
+ tcgetattr(0, &termbuf);
+ termbuf.c_lflag |= ECHO; /* if we use readline we dont want this */
++#if defined (__FreeBSD__) && !defined(XTABS)
++#define XTABS OXTABS
++#endif
+ termbuf.c_oflag |= ONLCR | XTABS;
+ termbuf.c_iflag |= ICRNL;
+ termbuf.c_iflag &= ~IXOFF;
+Only in networking/: telnetd.o
+Only in networking/: tftp.o
+diff -ubwr ../../work.base/busybox-1.8.2/networking/traceroute.c networking/traceroute.c
+--- ../../work.base/busybox-1.8.2/networking/traceroute.c 2007-11-10 02:40:47.000000000 +0100
++++ networking/traceroute.c 2008-08-19 13:08:50.000000000 +0200
+@@ -207,7 +207,18 @@
+ //#undef CONFIG_FEATURE_TRACEROUTE_USE_ICMP
+ //#define CONFIG_FEATURE_TRACEROUTE_USE_ICMP
+
+-
++#if defined(__FreeBSD__)
++#include <sys/socket.h>
++#include <sys/types.h>
++#include <netinet/in_systm.h>
++struct udphdr {
++ u_short source;
++ u_short dest;
++ u_short len;
++ u_short check;
++};
++#define _NETINET_UDP_H_ // prevent inclusion of the real thing
++#endif
+ #include <net/if.h>
+ #include <arpa/inet.h>
+ #include <netinet/in.h>
+--- networking/nslookup.c.orig 2008-06-25 14:51:14.000000000 +0200
++++ networking/nslookup.c 2008-08-19 17:05:31.000000000 +0200
+@@ -11,6 +11,10 @@
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ */
+
++#if defined __FreeBSD__
++#include <sys/types.h>
++#include <netinet/in.h>
++#endif
+ #include <resolv.h>
+ #include "libbb.h"
+
diff --git a/sysutils/busybox/pkg-descr b/sysutils/busybox/pkg-descr
new file mode 100644
index 000000000000..5c35f87e6138
--- /dev/null
+++ b/sysutils/busybox/pkg-descr
@@ -0,0 +1,5 @@
+busybox is a set of common utilities built as a single
+crunched binary, and sometimes stripped down in features
+to fit the needs of embedded systems.
+
+WWW: http://www.busybox.net/