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.

75 lines
2.0 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.91
  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_HASH:=c9da946a525fbf82ff80090b6d1879c38df090556f3fe0e6d782cb44172450a3
  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. 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/Prepare
  35. $(PKG_UNPACK)
  36. (cd $(PKG_BUILD_DIR) && tar -xf $(PKG_NAME)_$(PKG_VERSION)_src.tar && mv $(PKG_NAME)_$(PKG_VERSION)_src/* .)
  37. $(Build/Patch)
  38. endef
  39. define Build/Configure
  40. $(SED) 's/rpc\/rpc/\/tirpc\/rpc\/rpc/g' $(PKG_BUILD_DIR)/Configure
  41. cd $(PKG_BUILD_DIR); \
  42. LINUX_CLIB="-DGLIBCV=2 $(LINUX_CLIB_IPV6)" \
  43. LSOF_CC="$(TARGET_CC)" \
  44. LSOF_VSTR="$(LINUX_VERSION)" \
  45. LSOF_CFGF="$(TARGET_CFLAGS)" \
  46. LSOF_CFGL="$(TARGET_LDFLAGS)" \
  47. LSOF_AR="$(TARGET_CROSS)ar cr" \
  48. LSOF_RANLIB="$(TARGET_CROSS)ranlib" \
  49. LSOF_INCLUDE="$(STAGING_DIR)/usr/include" \
  50. ./Configure -n linux
  51. endef
  52. define Build/Compile
  53. LSOF_HOST="none" \
  54. LSOF_LOGNAME="none" \
  55. LSOF_SYSINFO="none" \
  56. LSOF_USER="none" \
  57. $(MAKE) -C $(PKG_BUILD_DIR)
  58. endef
  59. define Package/lsof/install
  60. $(INSTALL_DIR) $(1)/usr/bin
  61. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lsof $(1)/usr/bin
  62. endef
  63. $(eval $(call BuildPackage,lsof))