[packages] Use default templates instead of custom reimplementations where applicable
[openwrt/svn-archive/archive.git] / libs / libnet-1.1.x / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libnet
11 PKG_VERSION:=1.1.2.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME).tar.gz
15 PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/
16 PKG_MD5SUM:=be845c41170d72c7db524f3411b50256
17
18 PKG_BUILD_DIR:=$(BUILD_DIR)/libnet
19
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/libnet1
25 SECTION:=libs
26 CATEGORY:=Libraries
27 DEPENDS:=+libpcap
28 TITLE:=Low-level packet creation library (v1.1.x)
29 URL:=http://www.packetfactory.net/libnet/
30 endef
31
32 ENDIANESS:=lil
33 ifeq ($(CONFIG_BIG_ENDIAN),y)
34 ENDIANESS:=big
35 endif
36
37 TARGET_CFLAGS += $(FPIC)
38
39 CONFIGURE_ARGS += \
40 --enable-shared \
41 --enable-static \
42 --with-pf_packet=yes
43
44 CONFIGURE_VARS += \
45 ac_cv_libnet_endianess=$(ENDIANESS) \
46 ac_libnet_have_pf_packet=yes \
47 LL_INT_TYPE=linux
48
49 define Build/Configure
50 (cd $(PKG_BUILD_DIR); touch \
51 configure.in \
52 include.m4 \
53 aclocal.m4 \
54 Makefile.in \
55 configure \
56 );
57 $(call Build/Configure/Default)
58 endef
59
60 define Build/InstallDev
61 $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/bin
62 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(1)/usr/lib/libnet-1.1.x/bin/
63 $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/include
64 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(1)/usr/lib/libnet-1.1.x/include/
65 $(INSTALL_DIR) $(1)/usr/lib/libnet-1.1.x/lib
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(1)/usr/lib/libnet-1.1.x/lib/
67 endef
68
69 define Package/libnet1/install
70 $(INSTALL_DIR) $(1)/usr/lib
71 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/
72 endef
73
74 $(eval $(call BuildPackage,libnet1))