replace lots of manual install commands with INSTALL_* variables
[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 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=libnet
12 PKG_VERSION:=1.1.2.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME).tar.gz
16 PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/
17 PKG_MD5SUM:=be845c41170d72c7db524f3411b50256
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/libnet
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/libnet1
26 SECTION:=libs
27 CATEGORY:=Libraries
28 DEPENDS:=+libpcap
29 TITLE:=Low-level packet creation library (v1.1.x)
30 URL:=http://www.packetfactory.net/libnet/
31 endef
32
33 ENDIANESS:=lil
34 ifeq ($(CONFIG_BIG_ENDIAN),y)
35 ENDIANESS:=big
36 endif
37
38 define Build/Configure
39 (cd $(PKG_BUILD_DIR); touch \
40 configure.in \
41 include.m4 \
42 aclocal.m4 \
43 Makefile.in \
44 configure \
45 );
46 $(call Build/Configure/Default, \
47 --enable-shared \
48 --enable-static \
49 --with-pf_packet=yes, \
50 ac_cv_libnet_endianess=$(ENDIANESS) \
51 ac_libnet_have_pf_packet=yes \
52 ac_libnet_have_packet_socket=yes \
53 )
54 endef
55
56 define Build/Compile
57 $(MAKE) -C $(PKG_BUILD_DIR) \
58 DESTDIR="$(PKG_INSTALL_DIR)" \
59 all install
60 endef
61
62 define Build/InstallDev
63 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.1.x/bin
64 $(CP) $(PKG_INSTALL_DIR)/usr/bin/libnet-config $(STAGING_DIR)/usr/lib/libnet-1.1.x/bin/
65 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.1.x/include
66 $(CP) $(PKG_INSTALL_DIR)/usr/include/libnet* $(STAGING_DIR)/usr/lib/libnet-1.1.x/include/
67 mkdir -p $(STAGING_DIR)/usr/lib/libnet-1.1.x/lib
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.{a,so*} $(STAGING_DIR)/usr/lib/libnet-1.1.x/lib/
69 endef
70
71 define Build/UninstallDev
72 rm -rf $(STAGING_DIR)/usr/lib/libnet-1.1.x
73 endef
74
75 define Package/libnet1/install
76 $(INSTALL_DIR) $(1)/usr/lib
77 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnet.so.* $(1)/usr/lib/
78 endef
79
80 $(eval $(call BuildPackage,libnet1))