You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.7 KiB

  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.94.0
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).linux.tar.bz2
  13. PKG_SOURCE_URL:=https://github.com/lsof-org/lsof/releases/download/$(PKG_VERSION)
  14. PKG_HASH:=c41709c2543ecf9de1e950795790a9786a2f225e51c3cc53d6a9a256f872472b
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION).linux
  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. define Package/lsof
  21. SECTION:=utils
  22. CATEGORY:=Utilities
  23. DEPENDS:=+libtirpc
  24. TITLE:=LiSt Open Files - a diagnostic tool
  25. URL:=http://people.freebsd.org/~abe/
  26. endef
  27. ifneq ($(CONFIG_IPV6),n)
  28. LINUX_CLIB_IPV6=-DHASIPv6
  29. else
  30. LINUX_CLIB_IPV6=
  31. endif
  32. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/tirpc
  33. TARGET_LDFLAGS += -ltirpc
  34. define Build/Configure
  35. $(SED) 's/rpc\/rpc/\/tirpc\/rpc\/rpc/g' $(PKG_BUILD_DIR)/Configure
  36. cd $(PKG_BUILD_DIR); \
  37. LINUX_CLIB="-DGLIBCV=2 $(LINUX_CLIB_IPV6)" \
  38. LSOF_CC="$(TARGET_CC)" \
  39. LSOF_VSTR="$(LINUX_VERSION)" \
  40. LSOF_CFGF="$(TARGET_CFLAGS)" \
  41. LSOF_CFGL="$(TARGET_LDFLAGS)" \
  42. LSOF_AR="$(TARGET_CROSS)ar cr" \
  43. LSOF_RANLIB="$(TARGET_CROSS)ranlib" \
  44. LSOF_INCLUDE="$(STAGING_DIR)/usr/include" \
  45. ./Configure -n linux
  46. endef
  47. define Build/Compile
  48. LSOF_HOST="none" \
  49. LSOF_LOGNAME="none" \
  50. LSOF_SYSINFO="none" \
  51. LSOF_USER="none" \
  52. $(MAKE) -C $(PKG_BUILD_DIR)
  53. endef
  54. define Package/lsof/install
  55. $(INSTALL_DIR) $(1)/usr/bin
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin
  57. endef
  58. $(eval $(call BuildPackage,lsof))