07c3bf0b100eec3a93c65ec5128d9d070bf9239e
[openwrt/svn-archive/archive.git] / libs / libnids / 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:=libnids
12 PKG_VERSION:=1.18
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=http://www.packetfactory.net/projects/libnids/dist/
18 PKG_MD5SUM:=9ee6dcdfac97bae6fe611aa27d2594a5
19 PKG_CAT:=zcat
20
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libnids
26 SECTION:=libs
27 CATEGORY:=Libraries
28 TITLE:=A network intrusion detection library
29 DESCRIPTION:=A network intrusion detection library.\\\
30 An implementation of an E-component of Network Intrusion Detection \\\
31 System.
32 URL:=http://www.packetfactory.net/projects/libnids/
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
37 $(TARGET_CONFIGURE_OPTS) \
38 CFLAGS="$(TARGET_CFLAGS)" \
39 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
40 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
41 ./configure \
42 --target=$(GNU_TARGET_NAME) \
43 --host=$(GNU_TARGET_NAME) \
44 --build=$(GNU_HOST_NAME) \
45 --program-prefix="" \
46 --program-suffix="" \
47 --prefix=/usr \
48 --exec-prefix=/usr \
49 --bindir=/usr/bin \
50 --datadir=/usr/share \
51 --includedir=/usr/include \
52 --infodir=/usr/share/info \
53 --libdir=/usr/lib \
54 --libexecdir=/usr/lib \
55 --localstatedir=/var \
56 --mandir=/usr/share/man \
57 --sbindir=/usr/sbin \
58 --sysconfdir=/etc \
59 $(DISABLE_NLS) \
60 $(DISABLE_LARGEFILE) \
61 --enable-shared \
62 --enable-static \
63 --with-libnet="$(STAGING_DIR)/usr" \
64 --with-libpcap="$(STAGING_DIR)/usr" \
65 );
66 endef
67
68 define Build/Compile
69 rm -rf $(PKG_INSTALL_DIR)
70 mkdir -p $(PKG_INSTALL_DIR)
71 $(MAKE) -C $(PKG_BUILD_DIR) \
72 $(TARGET_CONFIGURE_OPTS) \
73 install_prefix="$(PKG_INSTALL_DIR)" \
74 all install
75 endef
76
77 define Package/libnids/install
78 install -m0755 -d $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.so.* $(1)/usr/lib/
80 endef
81
82 define Build/InstallDev
83 mkdir -p $(STAGING_DIR)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/nids.h $(STAGING_DIR)/usr/include/
85 mkdir -p $(STAGING_DIR)/usr/lib
86 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.{a,so*} $(STAGING_DIR)/usr/lib/
87 endef
88
89 define Build/UninstallDev
90 rm -rf \
91 $(STAGING_DIR)/usr/include/nids.h \
92 $(STAGING_DIR)/usr/lib/libnids.{a,so*}
93 endef
94
95 $(eval $(call BuildPackage,libnids))