rpms/bing/devel bing-1.1.3-debian.patch, NONE, 1.1 bing.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Thu Feb 21 17:51:15 UTC 2008


Author: ajax

Update of /cvs/pkgs/rpms/bing/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23181/devel

Modified Files:
	.cvsignore sources 
Added Files:
	bing-1.1.3-debian.patch bing.spec 
Log Message:
Initial revision.


bing-1.1.3-debian.patch:

--- NEW FILE bing-1.1.3-debian.patch ---
--- bing-1.1.3.orig/bing.c
+++ bing-1.1.3/bing.c
@@ -104,7 +104,9 @@
 #include <math.h>
 
 /* More specific includes/declarations */
+#ifndef __GNU__
 #include <limits.h>
+#endif /* __GNU__ */
 #include <ctype.h>
 #include <string.h>
 #include <memory.h>
@@ -152,7 +154,9 @@
  * standard libraries.
  */
 #include <netinet/ip.h>
+#ifndef __GNU__
 #include <netinet/ip_var.h>
+#endif /* __GNU__ */
 #include <netinet/ip_icmp.h>
 
 #include "mod_icmp.h"
@@ -320,7 +324,6 @@
 
 struct hoststats {
 	/* Host info */
-	char hnamebuf[MAXHOSTNAMELEN];
 	char *hostname;
 	struct sockaddr_in whereto;
 	struct sockaddr_in *to;
@@ -373,7 +376,7 @@
 	hs->to->sin_family = AF_INET;
 	hs->to->sin_addr.s_addr = inet_addr(target);
 	if (hs->to->sin_addr.s_addr != (u_int)-1)
-		hs->hostname = target;
+		hs->hostname = strdup(target);
 	else {
 		hp = gethostbyname(target);
 		if (!hp) {
@@ -383,9 +386,12 @@
 		}
 		hs->to->sin_family = hp->h_addrtype;
 		memcpy((caddr_t)&hs->to->sin_addr, hp->h_addr, hp->h_length);
-		strncpy(hs->hnamebuf, hp->h_name, sizeof(hs->hnamebuf) - 1);
-		hs->hnamebuf[sizeof(hs->hnamebuf)-1] = '\0';
-		hs->hostname = hs->hnamebuf;
+		hs->hostname = strdup(hp->h_name);
+		if(!hs->hostname) {
+			(void)fprintf(stderr,
+				"bing: unable to allocate memory\n");
+			exit(1);
+		}
 	}
 }
 
@@ -678,7 +684,7 @@
 	u_long l;
 {
 	struct hostent *hp;
-	static char buf[80];
+	static char buf[MAXHOSTNAMELEN+19];
 
 	if ((options & F_NUMERIC) ||
 	    !(hp = gethostbyaddr((char *)&l, 4, AF_INET)))


--- NEW FILE bing.spec ---
Name:           bing
Version:        1.1.3
Release:        1%{?dist}
Summary:        Bandwidth ping

Group:          System Environment/Base
License:        BSD with advertising
URL:            http://fgouget.free.fr/bing/index-en.shtml
Source0:        http://fgouget.free.fr/bing/bing_src-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Patch0:		bing-1.1.3-debian.patch

%description
Bing is a point-to-point bandwidth measurement tool (hence the 'b'), based on
ping.

Bing determines the real (raw, as opposed to available or average) throughput
on a link by measuring ICMP echo requests' round trip times for different
packet sizes at each end of the link. 

%prep
%setup -q -n %{name}_src-%{version}
%patch0 -p1 -b .debian

%build
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D__GNU__"
iconv -f 863 -t UTF-8 Readme.txt > foo && mv foo Readme.txt || exit 1

%install
rm -rf $RPM_BUILD_ROOT
# not worth patching the Makefile, just hand-pick
install -d $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_mandir}/man8
install -m 755 bing $RPM_BUILD_ROOT%{_bindir}
install -m 444 unix/bing.8 $RPM_BUILD_ROOT%{_mandir}/man8

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc Readme.1st Readme.txt
%{_bindir}/bing
%{_mandir}/man8/bing.8*

%changelog
* Tue Jan 22 2008 Adam Jackson <ajax at redhat.com> 1.1.3-1
- Initial version.  %%description and patches lift from the Debian
  packaging.


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/bing/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	18 Feb 2008 17:28:40 -0000	1.1
+++ .cvsignore	21 Feb 2008 17:50:38 -0000	1.2
@@ -0,0 +1 @@
+bing_src-1.1.3.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/bing/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	18 Feb 2008 17:28:40 -0000	1.1
+++ sources	21 Feb 2008 17:50:38 -0000	1.2
@@ -0,0 +1 @@
+0ccd96cc01351c0562f1e4b94aaa2790  bing_src-1.1.3.tar.gz




More information about the fedora-extras-commits mailing list