| 1 | # $Id: Makefile 3112 2006-02-01 23:53:19Z mbm $
|
|---|
| 2 |
|
|---|
| 3 | include $(TOPDIR)/rules.mk
|
|---|
| 4 |
|
|---|
| 5 | PKG_NAME:=libnet
|
|---|
| 6 | PKG_VERSION:=1.0.2a
|
|---|
| 7 | PKG_RELEASE:=7
|
|---|
| 8 | PKG_MD5SUM:=ddf53f0f484184390e8c2a1bd0853667
|
|---|
| 9 |
|
|---|
| 10 | PKG_SOURCE_URL:=http://www.packetfactory.net/libnet/dist/deprecated/
|
|---|
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|---|
| 12 |
|
|---|
| 13 | WRKSRC:=${WRKDIR}/Libnet-$(PKG_VERSION)
|
|---|
| 14 |
|
|---|
| 15 | include $(TOPDIR)/package/rules.mk
|
|---|
| 16 |
|
|---|
| 17 | ENDIAN:=lil
|
|---|
| 18 | ifeq ($(ARCH),mips)
|
|---|
| 19 | ENDIAN:=big
|
|---|
| 20 | endif
|
|---|
| 21 |
|
|---|
| 22 | $(eval $(call PKG_template,LIBNET,libnet,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
|
|---|
| 23 |
|
|---|
| 24 | $(WRKBUILD)/.configured:
|
|---|
| 25 | (cd $(WRKBUILD); rm -rf config.{cache,status} ; \
|
|---|
| 26 | touch configure.in; \
|
|---|
| 27 | touch include.m4; \
|
|---|
| 28 | touch aclocal.m4; \
|
|---|
| 29 | touch Makefile.in; \
|
|---|
| 30 | touch configure; \
|
|---|
| 31 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 32 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 33 | CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
|
|---|
| 34 | LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
|
|---|
| 35 | ac_libnet_have_pf_packet=yes \
|
|---|
| 36 | ac_cv_lbl_unaligned_fail=no \
|
|---|
| 37 | ac_cv_libnet_endianess=$(ENDIAN) \
|
|---|
| 38 | ./configure \
|
|---|
| 39 | --target=$(GNU_TARGET_NAME) \
|
|---|
| 40 | --host=$(GNU_TARGET_NAME) \
|
|---|
| 41 | --build=$(GNU_HOST_NAME) \
|
|---|
| 42 | --program-prefix="" \
|
|---|
| 43 | --program-suffix="" \
|
|---|
| 44 | --prefix=/usr \
|
|---|
| 45 | --exec-prefix=/usr \
|
|---|
| 46 | --bindir=/usr/bin \
|
|---|
| 47 | --datadir=/usr/share \
|
|---|
| 48 | --includedir=/usr/include \
|
|---|
| 49 | --infodir=/usr/share/info \
|
|---|
| 50 | --libdir=/usr/lib \
|
|---|
| 51 | --libexecdir=/usr/lib \
|
|---|
| 52 | --localstatedir=/var \
|
|---|
| 53 | --mandir=/usr/share/man \
|
|---|
| 54 | --sbindir=/usr/sbin \
|
|---|
| 55 | --sysconfdir=/etc \
|
|---|
| 56 | --disable-nls \
|
|---|
| 57 | --enable-largefile \
|
|---|
| 58 | --enable-shared \
|
|---|
| 59 | --enable-static \
|
|---|
| 60 | --with-pf_packet=yes \
|
|---|
| 61 | );
|
|---|
| 62 | touch $@
|
|---|
| 63 |
|
|---|
| 64 | $(WRKBUILD)/.built:
|
|---|
| 65 | rm -rf $(WRKINST)
|
|---|
| 66 | mkdir -p $(WRKINST)
|
|---|
| 67 | $(MAKE) -C $(WRKBUILD) \
|
|---|
| 68 | $(TARGET_CONFIGURE_OPTS) \
|
|---|
| 69 | CFLAGS="$(TARGET_CFLAGS)" \
|
|---|
| 70 | DESTDIR="$(WRKINST)" \
|
|---|
| 71 | all install
|
|---|
| 72 | touch $@
|
|---|
| 73 |
|
|---|
| 74 | $(IPKG_LIBNET):
|
|---|
| 75 | install -m0755 -d $(IDIR_LIBNET)/usr/lib
|
|---|
| 76 | $(CP) $(WRKINST)/usr/lib/libnet.so.* $(IDIR_LIBNET)/usr/lib/
|
|---|
| 77 | $(RSTRIP) $(IDIR_LIBNET)
|
|---|
| 78 | $(IPKG_BUILD) $(IDIR_LIBNET) $(PACKAGE_DIR)
|
|---|
| 79 |
|
|---|
| 80 | $(STAGING_DIR)/usr/lib/libnet.so: $(WRKBUILD)/.built
|
|---|
| 81 | mkdir -p $(STAGING_DIR)/usr/bin
|
|---|
| 82 | $(CP) $(WRKINST)/usr/bin/libnet-config $(STAGING_DIR)/usr/bin/
|
|---|
| 83 | mkdir -p $(STAGING_DIR)/usr/include
|
|---|
| 84 | $(CP) $(WRKINST)/usr/include/libnet* $(STAGING_DIR)/usr/include/
|
|---|
| 85 | mkdir -p $(STAGING_DIR)/usr/lib
|
|---|
| 86 | $(CP) $(WRKINST)/usr/lib/libnet.{a,so*} $(STAGING_DIR)/usr/lib/
|
|---|
| 87 | touch $@
|
|---|
| 88 |
|
|---|
| 89 | install-dev: $(STAGING_DIR)/usr/lib/libnet.so
|
|---|
| 90 |
|
|---|
| 91 | uninstall-dev:
|
|---|
| 92 | rm -rf \
|
|---|
| 93 | $(STAGING_DIR)/usr/bin/libnet-config \
|
|---|
| 94 | $(STAGING_DIR)/usr/include/libnet* \
|
|---|
| 95 | $(STAGING_DIR)/usr/lib/libnet.{a,so*} \
|
|---|
| 96 |
|
|---|
| 97 | compile-targets: install-dev
|
|---|
| 98 | clean-targets: uninstall-dev
|
|---|