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

commit c24ddf2b1e34ae4238f33cac15c22951b33f55be
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Wed Jan 19 22:08:20 2011 +0100

netkit-rwho-0.17-4-i686

- portmap -> rpcbind

diff --git a/source/network/netkit-rwho/FrugalBuild 
b/source/network/netkit-rwho/FrugalBuild
index 22199c1..52cabe1 100644
--- a/source/network/netkit-rwho/FrugalBuild
+++ b/source/network/netkit-rwho/FrugalBuild
@@ -4,29 +4,25 @@

pkgname=netkit-rwho
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')
-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
 rc.rwhod)
+depends=('rpcbind')
+up2date="Flasttar $url"
+source=(ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/$pkgname-$pkgver.tar.gz
 rc.rwhod \
+       netkit-rwho-0.17-gcc4.patch)
sha1sums=('19dcd517bec846c788aee6307dfd4bf451793ec6' \
-          'fb1fea9692122fd19dccd74fcd5ba9529a5647f7')
+          'fb1fea9692122fd19dccd74fcd5ba9529a5647f7' \
+          '96f3b8ce7ba5acf3dc1913107f421a3cc17d71e3')

build() {
-       cd $startdir/src/$pkgname-$pkgver
-       mkdir -p $startdir/pkg/usr/{bin,sbin}
-       mkdir -p $startdir/pkg/usr/man/man{1,8}
-       ./configure --prefix=/usr
-
-       make || return 1
-
-       make INSTALLROOT=$startdir/pkg install
-       mkdir -p $startdir/pkg/var/spool/rwho
-       mkdir -p $startdir/pkg/etc/rc.d/rc.messages
-       install -m755 $startdir/rc.rwhod $startdir/pkg/etc/rc.d/rc.rwhod
-       install -m644 $startdir/messages/rwhod.* \
-               $startdir/pkg/etc/rc.d/rc.messages
+       Fpatchall
+       Fmake
+       Fmkdir /usr/{bin,sbin} /usr/man/man{1,8} /var/spool/rwho
+       Fmakeinstall INSTALLROOT=$Fdestdir
+       Frcd rwhod
}
+
+# optimization OK
diff --git a/source/network/netkit-rwho/netkit-rwho-0.17-gcc4.patch 
b/source/network/netkit-rwho/netkit-rwho-0.17-gcc4.patch
new file mode 100644
index 0000000..b50c2ff
--- /dev/null
+++ b/source/network/netkit-rwho/netkit-rwho-0.17-gcc4.patch
@@ -0,0 +1,103 @@
+--- netkit-rwho-0.17/rwhod/rwhod.c.gcc4        2005-03-17 17:03:36.000000000 
+0100
++++ netkit-rwho-0.17/rwhod/rwhod.c     2005-03-17 17:03:36.000000000 +0100
+@@ -96,7 +96,7 @@
+ static void   broadcaster(void);
+ static int    configure(int s);
+ static int    verify(const char *name);
+-static int    getloadavg(double ptr[3], int n);
++static int    mygetloadavg(double ptr[3], int n);
+
+ /*
+  * We communicate with each neighbor in
+@@ -182,7 +182,10 @@
+               exit(1);
+       }
+ #ifndef DEBUG
+-      daemon(1, 0);
++      if (daemon(1, 0) == -1) {
++              fprintf(stderr, "rwhod: unable to start daemon\n");
++              exit(1);
++      }
+ #endif
+       if (chdir(_PATH_RWHODIR) < 0) {
+               (void)fprintf(stderr, "rwhod: %s: %s\n",
+@@ -247,8 +250,9 @@
+
+       for (;;) {
+               struct whod wd;
+-              int cc, whod;
+-              size_t len = sizeof(from);
++              ssize_t cc;
++              int whod;
++              socklen_t len = sizeof(from);
+
+               memset(&wd, 0, sizeof(wd));
+               cc = recvfrom(sk, (char *)&wd, sizeof(struct whod), 0,
+@@ -273,8 +277,8 @@
+                */
+               wd.wd_hostname[sizeof(wd.wd_hostname)-1] = 0;
+               if (!verify(wd.wd_hostname)) {
+-                      syslog(LOG_WARNING, "malformed host name from %x",
+-                              from.sin_addr);
++                      syslog(LOG_WARNING, "malformed host name from %s",
++                              inet_ntoa(from.sin_addr));
+                       continue;
+               }
+               snprintf(path, sizeof(path), "whod.%s", wd.wd_hostname);
+@@ -307,9 +311,11 @@
+               }
+ #endif
+               wd.wd_recvtime = time(NULL);
+-              write(whod, (char *)&wd, cc);
++              if (write(whod, (char *)&wd, cc) == -1)
++                      perror("Error writing to whod file");
+               if (fstat(whod, &st) < 0 || st.st_size > cc)
+-                      ftruncate(whod, cc);
++                      if (ftruncate(whod, cc) == -1)
++                              perror("Error truncating whod file");
+               (void) close(whod);
+       }
+ }
+@@ -453,7 +459,7 @@
+                       we->we_idle = htonl(now - stb.st_atime);
+               we++;
+       }
+-      getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0]));
++      mygetloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0]));
+       for (i = 0; i < 3; i++)
+               wd->wd_loadav[i] = htonl((u_long)(avenrun[i] * 100));
+       cc = (char *)we - (char *)wd;
+@@ -502,7 +508,7 @@
+  *
+  * Send comments/bug reports/fixes to: p...@signum.se or p...@lysator.liu.se
+  */
+-int getloadavg(double ptr[3], int n)
++int mygetloadavg(double ptr[3], int n)
+ {
+       FILE *fp;
+
+@@ -530,7 +536,8 @@
+       FILE *fp = fopen("/proc/uptime", "r");
+       if (!fp) return /* -1 */;
+
+-      fscanf(fp, "%ld", &uptime);
++      if (fscanf(fp, "%ld", &uptime) <= 0)
++              syslog(LOG_WARNING, "couldn't parse /proc/uptime correctly");
+
+       curtime = time(NULL);
+       curtime -= uptime;
+--- netkit-rwho-0.17/rwhod/daemon.c.gcc4       2005-03-17 17:04:03.000000000 
+0100
++++ netkit-rwho-0.17/rwhod/daemon.c    2005-03-17 17:06:15.000000000 +0100
+@@ -57,7 +57,11 @@
+       }
+
+       if (setsid() == -1) return -1;
+-      if (!nochdir) chdir("/");
++      if (!nochdir)
++              if (chdir("/") == -1) {
++                      perror("Couldn't chdir to /");
++                      return -1;
++              }
+       if (noclose) return 0;
+
+       fd = open(_PATH_DEVNULL, O_RDWR, 0);
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to