rpms/driftnet/devel driftnet-0.1.6-no-makedepend.patch, NONE, 1.1 driftnet-0.1.6-pam.config, NONE, 1.1 driftnet-0.1.6-security.config, NONE, 1.1 driftnet-dont-use-tmpnam.patch, NONE, 1.1 driftnet-gtk2-port.patch, NONE, 1.1 driftnet.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Bastien Nocera (hadess) fedora-extras-commits at redhat.com
Mon Apr 3 12:15:00 UTC 2006


Author: hadess

Update of /cvs/extras/rpms/driftnet/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12233/devel

Modified Files:
	.cvsignore sources 
Added Files:
	driftnet-0.1.6-no-makedepend.patch driftnet-0.1.6-pam.config 
	driftnet-0.1.6-security.config driftnet-dont-use-tmpnam.patch 
	driftnet-gtk2-port.patch driftnet.spec 
Log Message:
auto-import driftnet-0.1.6-7 on branch devel from driftnet-0.1.6-7.src.rpm

driftnet-0.1.6-no-makedepend.patch:

--- NEW FILE driftnet-0.1.6-no-makedepend.patch ---
diff -urN driftnet-0.1.6.old/endian.c driftnet-0.1.6/endian.c
--- driftnet-0.1.6.old/endian.c	2002-07-09 20:26:41.000000000 +0100
+++ driftnet-0.1.6/endian.c	1970-01-01 01:00:00.000000000 +0100
@@ -1,37 +0,0 @@
-/*
- * endian.c:
- * Determine platform endianness.
- *
- * Copyright (c) 2002 . All rights reserved.
- * Email: chris at ex-parrot.com; WWW: http://www.ex-parrot.com/~chris/
- *
- */
-
-static const char rcsid[] = "$Id: endian.c,v 1.5 2002/06/10 21:25:48 chris Exp $";
-
-#include <stdio.h>
-#ifdef USE_SYS_TYPES_H
-#   include <sys/types.h>       /* Solaris etc. */
-#else
-#   include <stdint.h>          /* C99 standard. */
-#endif
-
-int main(void) {
-#if defined(LITTLE_ENDIAN) || defined(_LITTLE_ENDIAN)
-    printf("-DDRIFTNET_LITTLE_ENDIAN\n");
-	return 0;
-#elif defined(BIG_ENDIAN) || defined(_BIG_ENDIAN)
-    printf("-DDRIFTNET_BIG_ENDIAN\n");
-	return 0;
-#else
-    uint32_t a = 0;
-    *((uint8_t*)&a) = 0xff;
-    if (a == 0xff000000)
-        printf("-DDRIFTNET_BIG_ENDIAN\n");
-    else if (a == 0x000000ff)
-        printf("-DDRIFTNET_LITTLE_ENDIAN\n");
-    else
-        return -1; /* don't know. */
-#endif  /* endianness test */
-    return 0;
-}
diff -urN driftnet-0.1.6.old/img.h driftnet-0.1.6/img.h
--- driftnet-0.1.6.old/img.h	2002-07-09 20:26:41.000000000 +0100
+++ driftnet-0.1.6/img.h	2006-04-03 13:05:04.000000000 +0100
@@ -21,12 +21,13 @@
 #endif
 
 #include <stdio.h>
+#include <glib.h>
 
 typedef uint8_t chan;
 typedef uint32_t pel;
 
 /* Yuk. GDKRGB expects data in a specific ordering. */
-#if defined(DRIFTNET_LITTLE_ENDIAN)
+#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
 #   define PEL(r, g, b)        ((pel)((chan)(r) | ((chan)(g) << 8) | ((chan)(b) << 16)))
 #   define PELA(r, g, b, a)    ((pel)((chan)(r) | ((chan)(g) << 8) | ((chan)(b) << 16) | ((chan)(a) << 24)))
 
@@ -34,7 +35,7 @@
 #   define GETG(p)             ((chan)(((p) & (pel)0x0000ff00) >>  8))
 #   define GETB(p)             ((chan)(((p) & (pel)0x00ff0000) >> 16))
 #   define GETA(p)             ((chan)(((p) & (pel)0xff000000) >> 24))
-#elif defined(DRIFTNET_BIG_ENDIAN)
+#elif defined(G_BYTE_ORDER == G_BIG_ENDIAN)
 #   define PEL(r, g, b)        ((pel)(((chan)(r) << 24) | ((chan)(g) << 16) | ((chan)(b) << 8)))
 #   define PELA(r, g, b, a)    ((pel)(((chan)(r) << 24) | ((chan)(g) << 16) | ((chan)(b) << 8) | ((chan)(a))))
 
diff -urN driftnet-0.1.6.old/Makefile driftnet-0.1.6/Makefile
--- driftnet-0.1.6.old/Makefile	2006-04-03 13:02:13.000000000 +0100
+++ driftnet-0.1.6/Makefile	2006-04-03 13:06:00.000000000 +0100
@@ -67,7 +67,7 @@
 
 SUBDIRS = 
 
-TXTS = README TODO COPYING CHANGES CREDITS driftnet.1 driftnet.1.in endian.c
+TXTS = README TODO COPYING CHANGES CREDITS driftnet.1 driftnet.1.in
 SRCS = audio.c mpeghdr.c gif.c img.c jpeg.c png.c driftnet.c image.c \
        display.c playaudio.c connection.c media.c
 HDRS = img.h driftnet.h mpeghdr.h
@@ -77,41 +77,26 @@
 
 default: driftnet driftnet.1
 
-driftnet:   depend $(OBJS)
+driftnet:   $(OBJS)
 	$(CC) -o driftnet $(OBJS) $(LDFLAGS) $(LDLIBS)
 
 driftnet.1: driftnet.1.in Makefile
 	( echo '.\" DO NOT EDIT THIS FILE-- edit driftnet.1.in instead' ; sed s/@@@VERSION@@@/$(VERSION)/ ) < driftnet.1.in > driftnet.1
 
-endianness: endian
-	./endian > endianness
+%.o:    %.c Makefile
+	$(CC) $(CFLAGS) -c -o $@ $<
 
-endian: endian.c
-	$(CC) $(CFLAGS) -o endian endian.c
-
-%.o:    %.c Makefile endianness
-	$(CC) $(CFLAGS) `cat endianness` -c -o $@ $<
-
-clean:  nodepend
-	rm -f *~ *.bak *.o core $(BINS) TAGS driftnet.1 endian endianness
+clean:
+	rm -f *~ *.bak *.o core $(BINS) TAGS driftnet.1
 
 tags:
 	etags *.c *.h
 
-tarball: nodepend $(SRCS) $(HDRS) $(TXTS)
+tarball: $(SRCS) $(HDRS) $(TXTS)
 	mkdir driftnet-$(VERSION)
 	set -e ; for i in Makefile $(SRCS) $(HDRS) $(TXTS) ; do cp $$i driftnet-$(VERSION)/$$i ; done
 	tar cvzf driftnet-$(VERSION).tar.gz driftnet-$(VERSION)
 	rm -rf driftnet-$(VERSION)
 	mv driftnet-$(VERSION).tar.gz ..
 	
-depend: endianness
-	makedepend -- $(CFLAGS) `cat endianness` -- $(SRCS)
-	touch depend
-	rm -f Makefile.bak
-
-nodepend:
-	makedepend -- --
-	rm -f depend Makefile.bak
-
 # DO NOT DELETE


--- NEW FILE driftnet-0.1.6-pam.config ---
#%PAM-1.0
auth       sufficient   pam_rootok.so
auth       sufficient   pam_timestamp.so
auth       include      system-auth
session    required     pam_permit.so
session    optional     pam_xauth.so
session    optional     pam_timestamp.so
account    required     pam_permit.so


--- NEW FILE driftnet-0.1.6-security.config ---
USER=root
PROGRAM=/usr/sbin/driftnet
SESSION=true

driftnet-dont-use-tmpnam.patch:

--- NEW FILE driftnet-dont-use-tmpnam.patch ---
diff -urp driftnet-0.1.6.old/driftnet.c driftnet-0.1.6/driftnet.c
--- driftnet-0.1.6.old/driftnet.c	2002-07-09 20:26:41.000000000 +0100
+++ driftnet-0.1.6/driftnet.c	2005-12-13 16:52:04.000000000 +0000
@@ -11,6 +11,8 @@ static const char rcsid[] = "$Id: driftn
 
 #undef NDEBUG
 
+#include <glib.h>
+
 #include <assert.h>
 #include <dirent.h>
 #include <errno.h>
@@ -585,10 +587,15 @@ int main(int argc, char *argv[]) {
     } else {
         /* need to make a temporary directory. */
         for (;;) {
-            tmpdir = strdup(tmpnam(NULL));
-            if (mkdir(tmpdir, 0700) == 0)
-                break;
-            free(tmpdir);
+            const char *tmp;
+	    char *template;
+
+	    tmp = g_get_tmp_dir();
+	    template = g_build_filename(tmp, "drifnet-XXXXXX", NULL);
+	    tmpdir = mkdtemp (template);
+	    g_free (template);
+	    if (tmpdir)
+		break;
         }
     }
 

driftnet-gtk2-port.patch:

--- NEW FILE driftnet-gtk2-port.patch ---
diff -urN driftnet-0.1.6/display.c driftnet-0.1.6.bak/display.c
--- driftnet-0.1.6/display.c	2002-07-09 20:26:41.000000000 +0100
+++ driftnet-0.1.6.bak/display.c	2004-04-17 22:08:25.373349299 +0100
@@ -20,6 +20,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
+#include <time.h>
 
 #include <sys/stat.h>
 
@@ -104,7 +105,7 @@
         GdkGC *gc;
         gc = gdk_gc_new(drawable);
         gdk_draw_rgb_32_image(drawable, gc, 0, 0, width, height, GDK_RGB_DITHER_NORMAL, (guchar*)backing_image->flat, sizeof(pel) * width);
-        gdk_gc_destroy(gc);
+        g_object_unref(gc);
     }
 }
 
@@ -172,7 +173,7 @@
  * React to an expose event, perhaps changing the backing image size. */
 void expose_event(GtkWidget *widget, GdkEvent *event, gpointer data) {
     if (darea) drawable = darea->window;
-    gdk_window_get_size(drawable, &width, &height);
+    gdk_drawable_get_size(GDK_DRAWABLE(drawable), &width, &height);
     if (!backing_image || backing_image->width != width || backing_image->height != height)
         make_backing_image();
 
@@ -183,7 +184,7 @@
  * React to a configure event, perhaps changing the backing image size. */
 void configure_event(GtkWidget *widget, GdkEvent *event, gpointer data) {
     if (darea) drawable = darea->window;
-    gdk_window_get_size(drawable, &width, &height);
+    gdk_drawable_get_size(GDK_DRAWABLE(drawable), &width, &height);
     if (!backing_image || backing_image->width != width || backing_image->height != height)
         make_backing_image();
 
@@ -387,28 +388,26 @@
        
     /* do some init thing */
     gtk_init(&argc, &argv);
-    gdk_rgb_init();
 
-    gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
-    gtk_widget_set_default_visual(gdk_rgb_get_visual());
+    gtk_widget_push_colormap(gdk_rgb_get_colormap());
 
     /* Make our own window. */
     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-    gtk_widget_set_usize(window, 0, 0);
+    gtk_widget_set_size_request(window, 0, 0);
 
     darea = gtk_drawing_area_new();
     gtk_container_add(GTK_CONTAINER(window), darea);
     gtk_widget_set_events(darea, GDK_EXPOSURE_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK);
 
-    gtk_signal_connect(GTK_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(delete_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(destroy), NULL);
+    g_signal_connect(G_OBJECT(window), "delete_event", GTK_SIGNAL_FUNC(delete_event), NULL);
+    g_signal_connect(G_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(destroy), NULL);
 
-    gtk_signal_connect(GTK_OBJECT(darea), "expose-event", GTK_SIGNAL_FUNC(expose_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(darea), "configure_event", GTK_SIGNAL_FUNC(expose_event), NULL);
+    g_signal_connect(G_OBJECT(darea), "expose-event", GTK_SIGNAL_FUNC(expose_event), NULL);
+    g_signal_connect(G_OBJECT(darea), "configure_event", GTK_SIGNAL_FUNC(expose_event), NULL);
     
     /* mouse button press/release for saving images */
-    gtk_signal_connect(GTK_OBJECT(darea), "button_press_event", GTK_SIGNAL_FUNC(button_press_event), NULL);
-    gtk_signal_connect(GTK_OBJECT(darea), "button_press_event", GTK_SIGNAL_FUNC(button_release_event), NULL);
+    g_signal_connect(G_OBJECT(darea), "button_press_event", GTK_SIGNAL_FUNC(button_press_event), NULL);
+    g_signal_connect(G_OBJECT(darea), "button_press_event", GTK_SIGNAL_FUNC(button_release_event), NULL);
 
     gtk_widget_show_all(window);
 
diff -urN driftnet-0.1.6/Makefile driftnet-0.1.6.bak/Makefile
--- driftnet-0.1.6/Makefile	2004-04-17 21:57:20.454251440 +0100
+++ driftnet-0.1.6.bak/Makefile	2004-04-17 22:08:31.654607973 +0100
@@ -31,8 +31,11 @@
 
 # Optional C compiler and linker flags. Typical driftnet builds have support
 # for displaying captured images in an X window, and need the following flags:
-CFLAGS  += `gtk-config --cflags`
-LDLIBS  += -ljpeg -lungif `gtk-config --libs`
+CFLAGS  += `pkg-config --cflags gtk+-2.0`
+LDLIBS  += -ljpeg -lungif `pkg-config --libs gtk+-2.0`
+
+# For development, disable the deprecated shite
+CFLAGS += -DGTK_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED
 
 # Alternatively, you can build a version of driftnet which can only be used
 # in `adjunct' mode as the back end for some other image-processing program. To


--- NEW FILE driftnet.spec ---
Name: driftnet
License: GPL
Group: Applications/Internet
Version: 0.1.6
Release: 7
Summary: Network image sniffer
URL: http://www.ex-parrot.com/~chris/driftnet/
Source0: http://www.ex-parrot.com/~chris/driftnet/driftnet-0.1.6.tar.gz
Source1: %name-%{version}-pam.config
Source2: %name-%{version}-security.config
Patch0: driftnet-gtk2-port.patch
Patch1: driftnet-dont-use-tmpnam.patch
Patch2: driftnet-0.1.6-no-makedepend.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libpcap gtk2-devel libungif-devel libjpeg-devel
Requires: %{_bindir}/consolehelper

%description
Driftnet is a program which listens to network traffic and picks out images 
from TCP streams it observes. Fun to run on a host which sees lots of web 
traffic.

%prep
%setup -q
%patch0 -p1 -b .gtk2
%patch1 -p1 -b .tmpnam
%patch2 -p1 -b .makedep

%build
CFLAGS="$RPM_OPT_FLAGS" make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -Dpm 0755 driftnet  \
	$RPM_BUILD_ROOT%{_sbindir}/driftnet
install -Dpm 0644 driftnet.1 \
	$RPM_BUILD_ROOT/%{_mandir}/man1/driftnet.1
ln -sf consolehelper $RPM_BUILD_ROOT%{_bindir}/driftnet
install -Dpm 644 %{SOURCE1} \
	$RPM_BUILD_ROOT%{_sysconfdir}/pam.d/driftnet
install -Dpm 644 %{SOURCE2} \
	$RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/driftnet

%files
%defattr(-,root,root,-)
%doc CHANGES COPYING CREDITS README TODO
%{_bindir}/driftnet
%{_sbindir}/driftnet
%config(noreplace) %{_sysconfdir}/pam.d/driftnet
%config %{_sysconfdir}/security/console.apps/driftnet
%{_mandir}/man1/driftnet.1*

%clean
rm -rf $RPM_BUILD_ROOT

%changelog
* Mon Apr 03 2006 - Bastien Nocera <hadess at hadess.net> - 0.1.6-7
- spell "driftnet" correctly in driftnet-dont-use-tmpnam.patch
  Add patch2 to remove imake dependency
  update the PAM config to be more like existing ones
  move buildroot deletion to install from prep
  Thanks to Adrian Reber <adrian at lisas.de> for pointing to those last 2

* Tue Dec 13 2005 - Bastien Nocera <hadess at hadess.net> - 0.1.6-6
- update for FC5, don't use tmpnam

* Fri Nov 11 2005 - Bastien Nocera <hadess at hadess.net> - 0.1.6-5
- Major cleanups by Adrian Reber <adrian at lisas.de>

* Sat Apr 17 2004 - Bastien Nocera <hadess at hadess.net> - 0.1.6-4
- Oops, it wasn't a GTK2 application, ended up porting it

* Sat Apr 10 2004 - Bastien Nocera <hadess at hadess.net> - 0.1.6-3
- Recompile against a newer libpcap

* Fri Jun 20 2003 - Bastien Nocera <hadess at hadess.net> - 0.1.6-2
- Added a PAM configuration file

* Fri Jun 20 2003 - Bastien Nocera <hadess at hadess.net> - 0.1.6-1
- First release


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/driftnet/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	3 Apr 2006 12:12:41 -0000	1.1
+++ .cvsignore	3 Apr 2006 12:15:00 -0000	1.2
@@ -0,0 +1 @@
+driftnet-0.1.6.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/driftnet/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	3 Apr 2006 12:12:41 -0000	1.1
+++ sources	3 Apr 2006 12:15:00 -0000	1.2
@@ -0,0 +1 @@
+8e11d77770452f97bb3c23f510489815  driftnet-0.1.6.tar.gz




More information about the fedora-extras-commits mailing list