InstallDev should be using (1) and not (STAGING_DIR)
[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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://www.packetfactory.net/projects/libnids/dist/
17 PKG_MD5SUM:=9ee6dcdfac97bae6fe611aa27d2594a5
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
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 DEPENDS:=+libnet0
29 TITLE:=A network intrusion detection library
30 DESCRIPTION:=\
31 An implementation of an E-component of Network Intrusion Detection \\\
32 System.
33 URL:=http://www.packetfactory.net/projects/libnids/
34 endef
35
36 define Build/Configure
37 $(call Build/Configure/Default, \
38 --enable-shared \
39 --enable-static \
40 --with-libnet="$(STAGING_DIR)/usr/lib/libnet-1.0.x" \
41 --with-libpcap="$(STAGING_DIR)/usr" \
42 , \
43 CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
44 )
45 endef
46
47 define Build/Compile
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 LNETLIB="-L$(STAGING_DIR)/usr/lib/libnet-1.0.x/lib -lnet" \
50 PCAPLIB="-L$(STAGING_DIR)/usr/lib -lpcap" \
51 install_prefix="$(PKG_INSTALL_DIR)" \
52 all install
53 endef
54
55 define Build/InstallDev
56 mkdir -p $(1)/usr/include
57 $(CP) $(PKG_INSTALL_DIR)/usr/include/nids.h $(1)/usr/include/
58 mkdir -p $(1)/usr/lib
59 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.{a,so*} $(1)/usr/lib/
60 endef
61
62 define Build/UninstallDev
63 rm -rf \
64 $(STAGING_DIR)/usr/include/nids.h \
65 $(STAGING_DIR)/usr/lib/libnids.{a,so*}
66 endef
67
68 define Package/libnids/install
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnids.so.* $(1)/usr/lib/
71 endef
72
73 $(eval $(call BuildPackage,libnids))