fix conflicting libnet versions mess
[packages.git] / net / scanlogd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=scanlogd
12 PKG_VERSION:=2.2.6
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.openwall.com/scanlogd/ \
17                 ftp://ftp.wiretapped.net/pub/openwall/ \
18                 http://distro.ibiblio.org/pub/linux/distributions/openwall/
19 PKG_MD5SUM:=7b8187ea718ebe47f22805b921b909ab
20 PKG_CAT:=zcat
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
23 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
24
25 PKG_INIT_PRIO:=60
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/scanlogd
30   SECTION:=net
31   CATEGORY:=Network
32   DEPENDS:=+libpcap +libnet0 +libnids
33   TITLE:=Port scan detection tool
34   DESCRIPTION:=\
35         Scanlogd is a TCP port scan detection tool, originally designed \\\
36         to illustrate various attacks an IDS developer has to deal with.\\\
37         Thus, unlike some of the other port scan detection tools out there, \\\
38         scanlogd is designed to be totally safe to use.
39   URL:=http://www.openwall.com/scanlogd
40 endef
41
42 define Build/Configure  
43         $(SED) "s,/var/empty,/tmp/.scanlogd," $(PKG_BUILD_DIR)/params.h
44         $(SED) "s,#undef SCANLOGD_DEVICE,#define SCANLOGD_DEVICE \"all\"," $(PKG_BUILD_DIR)/params.h
45 endef
46
47 define Build/Compile    
48         $(MAKE) -C $(PKG_BUILD_DIR) \
49                 $(TARGET_CONFIGURE_OPTS) \
50                 CC="$(TARGET_CC)" LD="$(TARGET_CC)" CFLAGS="-c $(TARGET_CFLAGS)" \
51                 LDFLAGS= \
52                 PCAP_H="-I$(STAGING_DIR)/usr/include" \
53                 NIDS_H="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/lib/libnet-1.0.x/include" \
54                 NIDS_L="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib -lnids -lnet -lpcap" \
55                 libnids
56 endef
57
58 define Package/scanlogd/install 
59         install -d -m0755 $(1)/usr/sbin
60         install -m0755 $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
61         install -d -m0755 $(1)/etc/init.d
62         install -m0755 ./files/scanlogd.init $(1)/etc/init.d/scanlogd
63         ln -sf scanlogd $(1)/etc/init.d/S$(PKG_INIT_PRIO)scanlogd
64 endef
65
66 $(eval $(call BuildPackage,scanlogd))