Add libnfnetlink (#2798)
[openwrt/svn-archive/archive.git] / libs / libnfnetlink / Makefile
1 #
2 # Copyright (C) 2007 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:=libnfnetlink
12 PKG_VERSION:=0.0.30
13 PKG_RELEASE:=0
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=ftp://ftp.netfilter.org/pub/libnfnetlink/
17 PKG_MD5SUM:=7fd3c8ddc03d42fa9f0177a17a38f163
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libnfnetlink
25 SECTION:=libs
26 CATEGORY:=Libraries
27 DEPENDS:=@LINUX_2_6
28 TITLE:=libnfnetlink
29 URL:=http://netfilter.org/projects/libnfnetlink/index.html
30 endef
31
32 define Package/libnfnetlink/description
33 libnfnetlink is is the low-level library for netfilter related kernel/userspace communication.
34 It provides a generic messaging infrastructure for in-kernel netfilter subsystems
35 (such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users
36 and/or management tools in userspace.
37 endef
38
39 CONFIGURE_ARGS += \
40 --enable-static \
41 --enable-shared
42
43 MAKE_FLAGS += \
44 CFLAGS="$(TARGET_CFLAGS)"
45
46
47 define Build/Compile
48 # pass CFLAGS again to override -O2 set by configure
49 $(MAKE) -C $(PKG_BUILD_DIR) \
50 CFLAGS="$(TARGET_CFLAGS)" \
51 DESTDIR="$(PKG_INSTALL_DIR)" \
52 all install
53 endef
54
55
56 define Build/InstallDev
57 mkdir -p $(1)/usr/include/libnfnetlink
58 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnfnetlink/{libnfnetlink,linux_nfnetlink}.h $(1)/usr/include/libnfnetlink/
59 mkdir -p $(1)/usr/lib
60 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.{a,so*} $(1)/usr/lib/
61 endef
62
63 define Build/UninstallDev
64 rm -rf $(1)/usr/include/libnfnetlink \
65 $(1)/usr/lib/libnfnetlink.{a,so*}
66 endef
67
68 define Package/libnfnetlink/install
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfnetlink.so.* $(1)/usr/lib/
71 endef
72
73 $(eval $(call BuildPackage,libnfnetlink))