Author: oden
Date: Wed Oct 25 17:46:12 2006
New Revision: 72797
Added:
packages/cooker/nmap/current/SOURCES/nmap-4.00-libpcap-filter.diff
packages/cooker/nmap/current/SOURCES/nmap-4.00-noreturn.diff
packages/cooker/nmap/current/SOURCES/nmap-4.00-nostrip.diff
Modified:
packages/cooker/nmap/current/SPECS/nmap.spec
Log:
- synced with opensuse patches; P0,P1,P2
- use bundled libpcap and libdnet, fixes #22559
- fix the xdg menu stuff
Added: packages/cooker/nmap/current/SOURCES/nmap-4.00-libpcap-filter.diff
==============================================================================
--- (empty file)
+++ packages/cooker/nmap/current/SOURCES/nmap-4.00-libpcap-filter.diff Wed Oct
25 17:46:12 2006
@@ -0,0 +1,52 @@
+--- libpcap/pcap-bpf.c
++++ libpcap/pcap-bpf.c
+@@ -468,7 +468,7 @@
+ do {
+ (void)snprintf(device, sizeof(device), "/dev/bpf%d", n++);
+ fd = open(device, O_RDONLY);
+- } while (fd < 0 && errno == EBUSY);
++ } while (fd < 0 && errno == EBUSY && n < 1000);
+
+ /*
+ * XXX better message for all minors used
+--- libpcap/pcap-linux.c
++++ libpcap/pcap-linux.c
+@@ -96,6 +96,7 @@
+ #include <netinet/in.h>
+ #include <linux/if_ether.h>
+ #include <net/if_arp.h>
++#include <sys/poll.h>
+ #include <assert.h>
+
+ /*
+@@ -909,8 +910,30 @@
+ if (can_filter_in_kernel) {
+ if ((err = set_kernel_filter(handle, &fcode)) == 0)
+ {
++ char buf[1024];
++ int oldflags;
++ int ret;
++ unsigned int received = 0, rec_len = 0;
++ socklen_t optlen = sizeof(rec_len);
+ /* Installation succeded - using kernel filter. */
+ handle->md.use_bpf = 1;
++
++ oldflags = fcntl(handle->fd, F_GETFL, 0);
++ oldflags |= O_NONBLOCK;
++ fcntl(handle->fd, F_SETFL, oldflags);
++ getsockopt(handle->fd, SOL_SOCKET, SO_RCVBUF,
++ (char *)&rec_len, &optlen);
++
++ /* now read all packets received until now */
++ while((ret = read(handle->fd, buf, 1024)) > 0
++ && received < rec_len) {
++ received += ret;
++ }
++
++ if(oldflags > 0) {
++ oldflags &= ~O_NONBLOCK;
++ fcntl(handle->fd, F_SETFL, oldflags);
++ }
+ }
+ else if (err == -1) /* Non-fatal error */
+ {
Added: packages/cooker/nmap/current/SOURCES/nmap-4.00-noreturn.diff
==============================================================================
--- (empty file)
+++ packages/cooker/nmap/current/SOURCES/nmap-4.00-noreturn.diff Wed Oct
25 17:46:12 2006
@@ -0,0 +1,11 @@
+--- nmap-3.81/libpcap/gencode.c.xx 2005-02-08 14:18:07.779615468 +0100
++++ nmap-3.81/libpcap/gencode.c 2005-02-08 14:18:26.729381201 +0100
+@@ -108,7 +108,7 @@
+ #endif
+
+ /* VARARGS */
+-void
++void __attribute__((__noreturn__))
+ bpf_error(const char *fmt, ...)
+
+ {
Added: packages/cooker/nmap/current/SOURCES/nmap-4.00-nostrip.diff
==============================================================================
--- (empty file)
+++ packages/cooker/nmap/current/SOURCES/nmap-4.00-nostrip.diff Wed Oct 25
17:46:12 2006
@@ -0,0 +1,20 @@
+--- nmap-3.90/Makefile.in
++++ nmap-3.90/Makefile.in
+@@ -142,7 +142,7 @@
+
+ install-nmap: $(TARGET)
+ $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
$(DESTDIR)$(mandir)/man1 $(DESTDIR)$(nmapdatadir)
+- $(INSTALL) -c -m 755 -s nmap $(DESTDIR)$(bindir)/nmap
++ $(INSTALL) -c -m 755 nmap $(DESTDIR)$(bindir)/nmap
+ $(INSTALL) -c -m 644 docs/$(TARGET).1
$(DESTDIR)$(mandir)/man1/$(TARGET).1
+ $(INSTALL) -c -m 644 docs/nmap.xsl $(DESTDIR)$(nmapdatadir)/
+ $(INSTALL) -c -m 644 docs/nmap.dtd $(DESTDIR)$(nmapdatadir)/
+@@ -156,7 +156,7 @@
+ install-nmapfe: $(TARGETNMAPFE)
+ $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
$(DESTDIR)$(mandir)/man1 $(DESTDIR)$(nmapdatadir) $(DESTDIR)$(deskdir)
+ @echo "If the next command fails -- you cannot use the X front end"
+- -test -f nmapfe/nmapfe && $(INSTALL) -c -m 755 -s nmapfe/nmapfe
$(DESTDIR)$(bindir)/nmapfe && rm -f $(DESTDIR)$(bindir)/xnmap && $(SHTOOL) mkln
-f -s $(DESTDIR)$(bindir)/nmapfe $(DESTDIR)$(bindir)/xnmap && $(INSTALL) -c -m
644 nmapfe.desktop $(DESTDIR)$(deskdir)/nmapfe.desktop && $(INSTALL) -c -m 644
docs/nmapfe.1 $(DESTDIR)$(mandir)/man1/nmapfe.1 && $(INSTALL) -c -m 644
docs/xnmap.1 $(DESTDIR)$(mandir)/man1/xnmap.1
++ -test -f nmapfe/nmapfe && $(INSTALL) -c -m 755 nmapfe/nmapfe
$(DESTDIR)$(bindir)/nmapfe && rm -f $(DESTDIR)$(bindir)/xnmap && $(SHTOOL) mkln
-f -s $(DESTDIR)$(bindir)/nmapfe $(DESTDIR)$(bindir)/xnmap && $(INSTALL) -c -m
644 nmapfe.desktop $(DESTDIR)$(deskdir)/nmapfe.desktop && $(INSTALL) -c -m 644
docs/nmapfe.1 $(DESTDIR)$(mandir)/man1/nmapfe.1 && $(INSTALL) -c -m 644
docs/xnmap.1 $(DESTDIR)$(mandir)/man1/xnmap.1
+
+ install: install-nmap $(INSTALLNMAPFE)
+
Modified: packages/cooker/nmap/current/SPECS/nmap.spec
==============================================================================
--- packages/cooker/nmap/current/SPECS/nmap.spec (original)
+++ packages/cooker/nmap/current/SPECS/nmap.spec Wed Oct 25 17:46:12 2006
@@ -7,7 +7,7 @@
Release: %mkrel 0.%beta.1
%define theirversion %{version}%beta
%else
-Release: %mkrel 1
+Release: %mkrel 2
%define theirversion %{version}
%endif
Epoch: 1
@@ -16,11 +16,12 @@
URL: http://www.insecure.org/nmap/
Source0:
http://download.insecure.org/nmap/dist/%{name}-%theirversion.tar.bz2
Source1: %{name}_icons.tar.bz2
+Patch0: nmap-4.00-libpcap-filter.diff
+Patch1: nmap-4.00-noreturn.diff
+Patch2: nmap-4.00-nostrip.diff
BuildRequires: gtk2-devel
BuildRequires: libpcre-devel
-BuildRequires: libpcap-devel
BuildRequires: openssl-devel
-BuildRequires: libdnet-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%description
@@ -36,6 +37,8 @@
Summary: Gtk+ frontend for nmap
Group: Networking/Other
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
+Requires(post): desktop-file-utils
+Requires(postun): desktop-file-utils
%description frontend
This package includes nmapfe, a Gtk+ frontend for nmap. The nmap package must
@@ -44,6 +47,9 @@
%prep
%setup -q -a1 -n %{name}-%theirversion
+%patch0 -p0
+%patch1 -p1
+%patch2 -p1
# lib64 fix
perl -pi -e "s|/lib\b|/%{_lib}|g" configure*
@@ -54,11 +60,7 @@
#%{?__cputoolize: %{__cputoolize} -c libpcre}
%{?__cputoolize: %{__cputoolize} -c nsock/src}
-%configure2_5x \
- --with-openssl=%{_prefix} \
- --with-libpcap=%{_prefix} \
- --with-libpcre=%{_prefix} \
- --with-libdnet=%{_prefix}
+%configure2_5x
%make
@@ -70,12 +72,13 @@
mkdir -p %{buildroot}%{_menudir}
cat > %{buildroot}%{_menudir}/nmap-frontend <<EOF
?package(nmap-frontend): \
- command="%{_bindir}/nmapfe" \
- title="Nmap" \
- icon="%{name}.png" \
- longtitle="A frontend for the nmap port scanner" \
- needs="x11" \
- section="System/Monitoring"
+command="%{_bindir}/nmapfe" \
+title="Nmap" \
+icon="%{name}.png" \
+longtitle="A frontend for the nmap port scanner" \
+needs="x11" \
+section="System/Monitoring" \
+xdg="true"
EOF
mkdir -p %{buildroot}{%_miconsdir,%_liconsdir}
@@ -83,11 +86,28 @@
install -m 644 %{name}32.png %{buildroot}%{_iconsdir}/%{name}.png
install -m 644 %{name}48.png %{buildroot}%{_liconsdir}/%{name}.png
+rm -f %{buildroot}%{_datadir}/applications/*.desktop
+
+# XDG menu
+install -d %{buildroot}%{_datadir}/applications
+cat > %{buildroot}%{_datadir}/applications/mandriva-%{name}.desktop << EOF
+[Desktop Entry]
+Name=Nmap
+Comment="A frontend for the nmap port scanner"
+Exec="%{_bindir}/nmapfe"
+Icon=%{name}
+Terminal=false
+Type=Application
+Categories=X-MandrivaLinux-System-Monitoring;System;Monitor;
+EOF
+
%post frontend
%update_menus
+%update_desktop_database
%postun frontend
%clean_menus
+%clean_desktop_database
%clean
rm -rf %{buildroot}
@@ -110,3 +130,4 @@
%{_miconsdir}/%{name}.png
%{_mandir}/man1/nmapfe*
%{_mandir}/man1/xnmap*
+