From f7d536673cb24fade0aaa84298ac84297a616832 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 26 Apr 2005 12:30:18 +0000 Subject: [PATCH] add nmap SVN-Revision: 726 --- openwrt/package/Config.in | 1 + openwrt/package/Makefile | 2 + openwrt/package/nmap/Config.in | 9 ++ openwrt/package/nmap/Makefile | 89 +++++++++++++++++++ openwrt/package/nmap/nmap.control | 7 ++ .../package/nmap/patches/cross-compile.patch | 41 +++++++++ 6 files changed, 149 insertions(+) create mode 100644 openwrt/package/nmap/Config.in create mode 100644 openwrt/package/nmap/Makefile create mode 100644 openwrt/package/nmap/nmap.control create mode 100644 openwrt/package/nmap/patches/cross-compile.patch diff --git a/openwrt/package/Config.in b/openwrt/package/Config.in index 93f500f667..86c2d795f4 100644 --- a/openwrt/package/Config.in +++ b/openwrt/package/Config.in @@ -52,6 +52,7 @@ source "package/snort/Config.in" source "package/olsrd/Config.in" source "package/usbutils/Config.in" source "package/kismet/Config.in" +source "package/nmap/Config.in" comment "Libraries" source "package/libgcc/Config.in" diff --git a/openwrt/package/Makefile b/openwrt/package/Makefile index 5250a8bf99..eebce7e3d6 100644 --- a/openwrt/package/Makefile +++ b/openwrt/package/Makefile @@ -36,6 +36,7 @@ package-$(BR2_PACKAGE_MICROPERL) += microperl package-$(BR2_PACKAGE_MONIT) += monit package-$(BR2_PACKAGE_NCURSES) += ncurses package-$(BR2_PACKAGE_NFSD) += nfs-server +package-$(BR2_PACKAGE_NMAP) += nmap package-$(BR2_PACKAGE_NOCATSPLASH) += nocatsplash package-$(BR2_PACKAGE_NTPCLIENT) += ntpclient package-$(BR2_PACKAGE_OLSRD) += olsrd @@ -105,6 +106,7 @@ lcd4linux-compile: ncurses-compile libnet-compile: libpcap-compile mysql-compile: ncurses-compile zlib-compile postgresql-compile: zlib-compile +nmap-compile: uclibc++-compile pcre-compile libpcap-compile snort-compile: libnet-compile libpcap-compile pcre-compile ifeq ($(BR2_PACKAGE_SNORT_MYSQL),y) diff --git a/openwrt/package/nmap/Config.in b/openwrt/package/nmap/Config.in new file mode 100644 index 0000000000..d26a100fbf --- /dev/null +++ b/openwrt/package/nmap/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_NMAP + tristate "Nmap" + select BR2_PACKAGE_LIBGCC + select BR2_PACKAGE_LIBPCRE + select BR2_PACKAGE_LIBPCAP + select BR2_PACKAGE_UCLIBCXX + default m if CONFIG_DEVEL + help + A free open source utility for network exploration or security auditing. diff --git a/openwrt/package/nmap/Makefile b/openwrt/package/nmap/Makefile new file mode 100644 index 0000000000..d7aff84d64 --- /dev/null +++ b/openwrt/package/nmap/Makefile @@ -0,0 +1,89 @@ +# $Id$ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=nmap +PKG_VERSION:=3.81 +PKG_RELEASE:=1 +PKG_MD5SUM:=0713306dda85aee2c95ef31b4b7d2838 + +PKG_SOURCE_URL:=http://download.insecure.org/nmap/dist +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_CAT:=bzcat + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +IPKG_NMAP:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk +IDIR_NMAP:=$(PKG_BUILD_DIR)/ipkg/$(PKG_NAME) +INFO_NMAP:=$(IPKG_STATE_DIR)/info/$(PKG_NAME).list + +$(DL_DIR)/$(PKG_SOURCE): + $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL) + +$(PKG_BUILD_DIR)/.prepared: $(DL_DIR)/$(PKG_SOURCE) + $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + $(PATCH) $(PKG_BUILD_DIR) ./patches + touch $(PKG_BUILD_DIR)/.prepared + +$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared + (cd $(PKG_BUILD_DIR); rm -rf config.cache; \ + $(TARGET_CONFIGURE_OPTS) \ + libpcapdir="$(STAGING_DIR)/usr/lib" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -nostdinc++ -nodefaultlibs " \ + CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ + LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -fno-builtin -nostdinc++ -nodefaultlibs -luClibc++ -lc -lm" \ + ac_cv_prog_CXX="$(TARGET_CXX)" \ + ./configure \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --program-prefix="" \ + --program-suffix="" \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --infodir=/usr/share/info \ + --libdir=/usr/lib \ + --libexecdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --without-openssl \ + --with-libpcap="$(STAGING_DIR)/usr" \ + --with-libpcre="$(STAGING_DIR)/usr" \ + $(DISABLE_NLS) \ + $(DISABLE_LARGEFILE) \ + ); + touch $(PKG_BUILD_DIR)/.configured + +$(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.configured + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CCOPT="-fno-builtin -nostdinc++ -nodefaultlibs $(TARGET_CFLAGS)" + +$(IPKG_NMAP): $(PKG_BUILD_DIR)/$(PKG_NAME) + $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_NMAP) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) + mkdir -p $(IDIR_NMAP)/usr/share/nmap + for file in mac-prefixes os-fingerprints protocols rpc service-probes services; do \ + cp $(PKG_BUILD_DIR)/nmap-$$file $(IDIR_NMAP)/usr/share/nmap; \ + done + mkdir -p $(IDIR_NMAP)/usr/sbin + cp $(PKG_BUILD_DIR)/$(PKG_NAME) $(IDIR_NMAP)/usr/sbin/ + $(STRIP) $(IDIR_NMAP)/usr/sbin/* + mkdir -p $(PACKAGE_DIR) + $(IPKG_BUILD) $(IDIR_NMAP) $(PACKAGE_DIR) + +$(INFO_NMAP): $(IPKG_NMAP) + $(IPKG) install $(IPKG_NMAP) + +source: $(DL_DIR)/$(PKG_SOURCE) +prepare: $(PKG_BUILD_DIR)/.prepared +compile: $(IPKG_NMAP) +install: $(INFO_NMAP) + +clean: + rm -rf $(PKG_BUILD_DIR) $(IPKG_NMAP) diff --git a/openwrt/package/nmap/nmap.control b/openwrt/package/nmap/nmap.control new file mode 100644 index 0000000000..45698bf224 --- /dev/null +++ b/openwrt/package/nmap/nmap.control @@ -0,0 +1,7 @@ +Package: nmap +Priority: optional +Section: net +Maintainer: Felix Fietkau +Source: buildroot internal +Depends: libpcap, libpcre, uclibc++ +Description: Nmap is a free open source utility for network exploration or security auditing. diff --git a/openwrt/package/nmap/patches/cross-compile.patch b/openwrt/package/nmap/patches/cross-compile.patch new file mode 100644 index 0000000000..4319a6b0e7 --- /dev/null +++ b/openwrt/package/nmap/patches/cross-compile.patch @@ -0,0 +1,41 @@ +diff -urN nmap-3.81.old/configure nmap-3.81.dev/configure +--- nmap-3.81.old/configure 2004-10-17 05:49:33.000000000 +0200 ++++ nmap-3.81.dev/configure 2005-04-26 14:47:42.000000000 +0200 +@@ -1339,12 +1339,6 @@ + fi + fi + +-libpcapdir=libpcap-possiblymodified +- +- +-pcredir=libpcre +- +- + ac_config_headers="$ac_config_headers config.h" + + +diff -urN nmap-3.81.old/Makefile.in nmap-3.81.dev/Makefile.in +--- nmap-3.81.old/Makefile.in 2005-02-07 07:14:03.000000000 +0100 ++++ nmap-3.81.dev/Makefile.in 2005-04-26 14:52:39.000000000 +0200 +@@ -29,7 +29,7 @@ + # CFLAGS = $(DEFS) $(INCLS) + STATIC = + LDFLAGS = @LDFLAGS@ $(STATIC) +-LIBS = @LIBNBASE_LIBS@ @LIBNSOCK_LIBS@ @LIBPCRE_LIBS@ @LIBPCAP_LIBS@ @OPENSSL_LIBS@ @LIBS@ ++LIBS = @LIBNBASE_LIBS@ @LIBNSOCK_LIBS@ -lpcre -lpcap @OPENSSL_LIBS@ @LIBS@ + # LIBS = -lefence @LIBS@ + # LIBS = -lrmalloc @LIBS@ + SHTOOL = ./shtool +@@ -69,12 +69,6 @@ + # all of the prerequisites (e.g. recursive makes and such) + FORCE: + +-$(LIBPCREDIR)/libpcre.a: $(LIBPCREDIR)/Makefile FORCE +- @echo Compiling libpcre; cd $(LIBPCREDIR) && $(MAKE) +- +-$(LIBPCAPDIR)/libpcap.a: $(LIBPCAPDIR)/Makefile FORCE +- @echo Compiling libpcap; cd $(LIBPCAPDIR) && $(MAKE) +- + $(NBASEDIR)/libnbase.a: $(NBASEDIR)/Makefile FORCE + @echo Compiling libnbase; + cd $(NBASEDIR) && $(MAKE)