Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=676b9f79be21b34d97ca2b71f1827776df4995dc

commit 676b9f79be21b34d97ca2b71f1827776df4995dc
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Wed Jan 19 20:25:26 2011 +0100

netkit-ftp-0.17-4-i686

- fix build by adding arg_max.patch

diff --git a/source/network/netkit-ftp/FrugalBuild 
b/source/network/netkit-ftp/FrugalBuild
index dca0214..9e40642 100644
--- a/source/network/netkit-ftp/FrugalBuild
+++ b/source/network/netkit-ftp/FrugalBuild
@@ -4,20 +4,23 @@

pkgname=netkit-ftp
pkgver=0.17
-pkgrel=3
+pkgrel=4
pkgdesc="Basic network tools, fixed and ported from BSD code."
url="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit";
groups=('network')
archs=('i686' 'x86_64')
-depends=('glibc' 'portmap' 'readline')
+depends=('rpcbind')
up2date="wget --passive-ftp -O - -q 
ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/|grep $pkgname.*tar.gz|sed 
-n -e 's/.*>$pkgname-\(.*\)\.tar\.gz.*/\1/' -e '1 p'"
-source=(ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/$pkgname-$pkgver.tar.gz)
-sha1sums=('815541a33bf02a43b5b41194389b8435e7890935')
+source=(ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/$pkgname-$pkgver.tar.gz
 \
+       netkit-ftp-arg_max.patch)
+sha1sums=('815541a33bf02a43b5b41194389b8435e7890935' \
+          '7f62c80e162f0d5949238da733ffc600dbc613da')

build() {
-       Fcd
-       mkdir -p $startdir/pkg/usr/bin
-       mkdir -p $startdir/pkg/usr/man/man{1,5}
+       Fpatchall
+       Fmkdir /usr/bin /usr/man/man{1,5}
Fmake || return 1
Fmakeinstall INSTALLROOT=$startdir/pkg || return 1
}
+
+# optimization OK
diff --git a/source/network/netkit-ftp/netkit-ftp-arg_max.patch 
b/source/network/netkit-ftp/netkit-ftp-arg_max.patch
new file mode 100644
index 0000000..08a88bb
--- /dev/null
+++ b/source/network/netkit-ftp/netkit-ftp-arg_max.patch
@@ -0,0 +1,55 @@
+diff -up netkit-ftp-0.17/ftp/glob.c.arg_max netkit-ftp-0.17/ftp/glob.c
+--- netkit-ftp-0.17/ftp/glob.c.arg_max 2008-04-07 11:41:14.000000000 +0200
++++ netkit-ftp-0.17/ftp/glob.c 2008-04-07 12:01:53.000000000 +0200
+@@ -50,6 +50,7 @@ char glob_rcsid[] =
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #include "ftp_var.h"  /* for protos only */
+ #include "glob.h"
+@@ -57,7 +58,7 @@ char glob_rcsid[] =
+ #define       QUOTE 0200
+ #define       TRIM 0177
+ #define       eq(a,b)         (strcmp(a, b)==0)
+-#define       GAVSIZ          (ARG_MAX/6)
++#define       GAVSIZ          (sysconf(_SC_ARG_MAX)/6)
+ #define       isdir(d)        ((d.st_mode & S_IFMT) == S_IFDIR)
+
+ const char *globerr;
+@@ -115,7 +116,7 @@ char **
+ ftpglob(const char *v)
+ {
+       char agpath[BUFSIZ];
+-      entry agargv[GAVSIZ];
++      entry *agargv;
+       centry vv[2];
+       vv[0].text = v;
+       vv[1].text = NULL;
+@@ -133,6 +134,8 @@ ftpglob(const char *v)
+       /* added ()'s to sizeof, (ambigious math for the compiler) */
+       lastgpathp = agpath + (sizeof(agpath)- 2);
+
++      agargv = (entry *)malloc(sizeof (entry) * GAVSIZ);
++      if (agargv == NULL) fatal("Out of memory");
+       ginit(agargv);
+       globcnt = 0;
+       collect(v);
+@@ -156,7 +159,7 @@ ginit(entry *agargv)
+       gargv = agargv;
+       sortbas = agargv;
+       gargc = 0;
+-      gnleft = ARG_MAX - 4;
++      gnleft = sysconf(_SC_ARG_MAX) - 4;
+ }
+
+ static
+@@ -674,6 +677,7 @@ efree(entry *av)
+ {
+     int i;
+     for (i=0; av[i].text; i++) free(av[i].text);
++    free((void *)av);
+ }
+
+ static
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to