Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #
  2. # Copyright (C) 2007-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/kernel.mk
  9. PKG_NAME:=lsof
  10. PKG_VERSION:=4.89
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=https://www.mirrorservice.org/sites/lsof.itap.purdue.edu/pub/tools/unix/lsof/ ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ ftp://ftp.fu-berlin.de/pub/unix/tools/lsof
  14. PKG_MD5SUM:=1b9cd34f3fb86856a125abbf2be3a386
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION)
  16. PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
  17. PKG_LICENSE:=Unique
  18. PKG_LICENSE_FILES:=00README
  19. include $(INCLUDE_DIR)/package.mk
  20. TARGET_LDFLAGS += $(LIBRPC)
  21. define Package/lsof
  22. SECTION:=utils
  23. CATEGORY:=Utilities
  24. DEPENDS:=$(LIBRPC_DEPENDS)
  25. TITLE:=LiSt Open Files - a diagnostic tool
  26. URL:=http://people.freebsd.org/~abe/
  27. endef
  28. ifneq ($(CONFIG_IPV6),n)
  29. LINUX_CLIB_IPV6=-DHASIPv6
  30. else
  31. LINUX_CLIB_IPV6=
  32. endif
  33. define Build/Prepare
  34. $(PKG_UNPACK)
  35. (cd $(PKG_BUILD_DIR) && tar -xf $(PKG_NAME)_$(PKG_VERSION)_src.tar && mv $(PKG_NAME)_$(PKG_VERSION)_src/* .)
  36. $(Build/Patch)
  37. endef
  38. define Build/Configure
  39. cd $(PKG_BUILD_DIR); \
  40. LINUX_CLIB="-DGLIBCV=2 $(LINUX_CLIB_IPV6)" \
  41. LSOF_CC="$(TARGET_CC)" \
  42. LSOF_VSTR="$(LINUX_VERSION)" \
  43. LSOF_CFGF="$(TARGET_CFLAGS)" \
  44. LSOF_CFGL="$(TARGET_LDFLAGS)" \
  45. LSOF_AR="$(TARGET_CROSS)ar cr" \
  46. LSOF_RANLIB="$(TARGET_CROSS)ranlib" \
  47. ./Configure -n linux
  48. endef
  49. define Build/Compile
  50. $(MAKE) -C $(PKG_BUILD_DIR)
  51. endef
  52. define Package/lsof/install
  53. $(INSTALL_DIR) $(1)/usr/bin
  54. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin
  55. endef
  56. $(eval $(call BuildPackage,lsof))