CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
patch: update to 2.6.1
authorVictor Martinez <pitillo@ono.com>
Tue, 15 Mar 2011 08:07:34 +0000 (08:07 +0000)
committerVictor Martinez <pitillo@ono.com>
Tue, 15 Mar 2011 08:07:34 +0000 (08:07 +0000)
patch/.footprint
patch/.md5sum
patch/Pkgfile
patch/patch-2.6.1-strnlen.patch [new file with mode: 0644]
patch/safe-read.m4 [new file with mode: 0644]
patch/strnlen.c [new file with mode: 0644]
patch/strnlen.m4 [new file with mode: 0644]

index 21758defe0b56deff4af405d5f73eec4c2b7ec29..b8675f22ce8cde69cf8ebb471152d2669c0fc775 100644 (file)
@@ -1,7 +1,6 @@
 drwxr-xr-x     root/root       usr/
 drwxr-xr-x     root/root       usr/bin/
 -rwxr-xr-x     root/root       usr/bin/patch
-drwxr-xr-x     root/root       usr/share/
-drwxr-xr-x     root/root       usr/share/man/
-drwxr-xr-x     root/root       usr/share/man/man1/
--rw-r--r--     root/root       usr/share/man/man1/patch.1.gz
+drwxr-xr-x     root/root       usr/man/
+drwxr-xr-x     root/root       usr/man/man1/
+-rw-r--r--     root/root       usr/man/man1/patch.1.gz
index 424036b7b40f5e25c57544ad9c4b3420ef90f7e9..248824c1f05b7356a8459955246313b377dee46c 100644 (file)
@@ -1 +1,5 @@
-bc71d33c35004db3768465bcaf9ed23c  patch-2.6.tar.gz
+afa193f8c358c5b0a520851bdf45d539  patch-2.6.1-strnlen.patch
+057d78436e858c3ed086a544f5e1fe7e  patch-2.6.1.tar.xz
+617cc0a45b47a515ea3ae415e4f13072  safe-read.m4
+8520b59d8a70df0af8b1395df76c9aaf  strnlen.c
+192cc9a1273d7d32cf953a8bee88aebc  strnlen.m4
index 0f7b191ba1080de1da08cc738099136e2533c627..d2184a01f9542ebb7de601cabf774dbe3ecf5721 100644 (file)
@@ -5,17 +5,23 @@
 # Depends on:
 
 name=patch
-version=2.6
+version=2.6.1
 release=1
-source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz)
+source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.xz
+        $name-$version-strnlen.patch 
+        strnlen.c strnlen.m4 safe-read.m4)
 
 build() {
   cd $name-$version
+  patch -p1 -i $SRC/$name-$version-strnlen.patch
+  cp $SRC/*.m4 gl/m4/
+  cp $SRC/strnlen.c gl/lib/
 
   ./configure --build=$CHOST \
               --host=$CTARGET \
-              --prefix=/usr
+              --prefix=/usr \
+              --mandir=/usr/man
 
-  make
-  make prefix=$PKG/usr install
+  make 
+  make DESTDIR=$PKG install
 }
diff --git a/patch/patch-2.6.1-strnlen.patch b/patch/patch-2.6.1-strnlen.patch
new file mode 100644 (file)
index 0000000..aa60686
--- /dev/null
@@ -0,0 +1,24 @@
+--- patch-2.6.1.orig/Makefile.in       2011-02-18 12:55:01.000000000 +0000
++++ patch-2.6.1/Makefile.in    2011-02-18 12:59:29.000000000 +0000
+@@ -91,6 +91,7 @@
+       gl/lib/stripslash.c \
+       gl/lib/strncasecmp.c \
+       gl/lib/strndup.c \
++      gl/lib/strnlen.c \
+       gl/lib/xmalloc.c \
+       gl/lib/xstrndup.c
+@@ -302,11 +303,13 @@
+       gl/m4/quote.m4 \
+       gl/m4/realloc.m4 \
+       gl/m4/rename.m4 \
++      gl/m4/safe-read.m4 \
+       gl/m4/safe-write.m4 \
+       gl/m4/ssize_t.m4 \
+       gl/m4/stdbool.m4 \
+       gl/m4/strcase.m4 \
+       gl/m4/strndup.m4 \
++      gl/m4/strnlen.m4 \
+       gl/m4/unlocked-io.m4 \
+       gl/m4/utimbuf.m4 \
+       gl/m4/xalloc.m4 \
diff --git a/patch/safe-read.m4 b/patch/safe-read.m4
new file mode 100644 (file)
index 0000000..7a89d0a
--- /dev/null
@@ -0,0 +1,18 @@
+# safe-read.m4 serial 5
+dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SAFE_READ],
+[
+  AC_LIBOBJ([safe-read])
+
+  gl_PREREQ_SAFE_READ
+])
+
+# Prerequisites of lib/safe-read.c.
+AC_DEFUN([gl_PREREQ_SAFE_READ],
+[
+  AC_REQUIRE([gt_TYPE_SSIZE_T])
+])
diff --git a/patch/strnlen.c b/patch/strnlen.c
new file mode 100644 (file)
index 0000000..d346d32
--- /dev/null
@@ -0,0 +1,31 @@
+/* Find the length of STRING, but scan at most MAXLEN characters.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+#include <string.h>
+
+/* Find the length of STRING, but scan at most MAXLEN characters.
+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
+
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+  const char *end = memchr (string, '\0', maxlen);
+  return end ? (size_t) (end - string) : maxlen;
+}
diff --git a/patch/strnlen.m4 b/patch/strnlen.m4
new file mode 100644 (file)
index 0000000..b3787de
--- /dev/null
@@ -0,0 +1,31 @@
+# strnlen.m4 serial 10
+dnl Copyright (C) 2002-2003, 2005-2007, 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRNLEN],
+[
+  dnl Persuade glibc <string.h> to declare strnlen().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_CHECK_DECLS_ONCE([strnlen])
+  if test $ac_cv_have_decl_strnlen = no; then
+    HAVE_DECL_STRNLEN=0
+  fi
+
+  AC_FUNC_STRNLEN
+  if test $ac_cv_func_strnlen_working = no; then
+    # This is necessary because automake-1.6.1 doesn't understand
+    # that the above use of AC_FUNC_STRNLEN means we may have to use
+    # lib/strnlen.c.
+    AC_LIBOBJ([strnlen])
+    AC_DEFINE([strnlen], [rpl_strnlen],
+      [Define to rpl_strnlen if the replacement function should be used.])
+    gl_PREREQ_STRNLEN
+  fi
+])
+
+# Prerequisites of lib/strnlen.c.
+AC_DEFUN([gl_PREREQ_STRNLEN], [:])