smartmontools.mk 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #############################################################
  2. #
  3. # smartmontools
  4. #
  5. #############################################################
  6. SMARTMONTOOLS_VERSION:=5.33
  7. SMARTMONTOOLS_SOURCE:=smartmontools-$(SMARTMONTOOLS_VERSION).tar.gz
  8. SMARTMONTOOLS_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/smartmontools
  9. SMARTMONTOOLS_DIR:=$(BUILD_DIR)/smartmontools-$(SMARTMONTOOLS_VERSION)
  10. SMARTMONTOOLS_CAT:=$(ZCAT)
  11. SMARTMONTOOLS_BINARY:=smartctl
  12. SMARTMONTOOLS_BINARY2:=smartd
  13. SMARTMONTOOLS_TARGET_BINARY:=usr/sbin/smartctl
  14. SMARTMONTOOLS_TARGET_BINARY2:=usr/sbin/smartd
  15. $(DL_DIR)/$(SMARTMONTOOLS_SOURCE):
  16. $(call DOWNLOAD,$(SMARTMONTOOLS_SITE),$(SMARTMONTOOLS_SOURCE))
  17. smartmontools-source: $(DL_DIR)/$(SMARTMONTOOLS_SOURCE)
  18. $(SMARTMONTOOLS_DIR)/.unpacked: $(DL_DIR)/$(SMARTMONTOOLS_SOURCE)
  19. $(SMARTMONTOOLS_CAT) $(DL_DIR)/$(SMARTMONTOOLS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  20. toolchain/patch-kernel.sh $(SMARTMONTOOLS_DIR) package/smartmontools/ \*.patch
  21. touch $(SMARTMONTOOLS_DIR)/.unpacked
  22. $(SMARTMONTOOLS_DIR)/.configured: $(SMARTMONTOOLS_DIR)/.unpacked
  23. (cd $(SMARTMONTOOLS_DIR); rm -rf config.cache; \
  24. $(TARGET_CONFIGURE_OPTS) \
  25. $(TARGET_CONFIGURE_ARGS) \
  26. ./configure \
  27. --target=$(GNU_TARGET_NAME) \
  28. --host=$(GNU_TARGET_NAME) \
  29. --build=$(GNU_HOST_NAME) \
  30. --prefix=/usr \
  31. --exec-prefix=/usr \
  32. --bindir=/usr/bin \
  33. --sbindir=/usr/sbin \
  34. --libdir=/lib \
  35. --libexecdir=/usr/lib \
  36. --sysconfdir=/etc \
  37. --datadir=/usr/share \
  38. --localstatedir=/var \
  39. --mandir=/usr/man \
  40. --infodir=/usr/info \
  41. $(DISABLE_NLS) \
  42. $(DISABLE_LARGEFILE) \
  43. )
  44. touch $(SMARTMONTOOLS_DIR)/.configured
  45. $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY): $(SMARTMONTOOLS_DIR)/.configured
  46. $(MAKE) -C $(SMARTMONTOOLS_DIR)
  47. $(STRIPCMD) $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY)
  48. $(STRIPCMD) $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY2)
  49. touch -c $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY)
  50. $(TARGET_DIR)/$(SMARTMONTOOLS_TARGET_BINARY): $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY)
  51. cp $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY) $(TARGET_DIR)/usr/sbin/
  52. $(TARGET_DIR)/$(SMARTMONTOOLS_TARGET_BINARY2): $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY)
  53. cp $(SMARTMONTOOLS_DIR)/$(SMARTMONTOOLS_BINARY2) $(TARGET_DIR)/usr/sbin/
  54. smartmontools: uclibc $(TARGET_DIR)/$(SMARTMONTOOLS_TARGET_BINARY)
  55. smartmontools-clean:
  56. $(MAKE) DESTDIR=$(TARGET_DIR) -C $(SMARTMONTOOLS_DIR) uninstall
  57. -$(MAKE) -C $(SMARTMONTOOLS_DIR) clean
  58. smartmontools-dirclean:
  59. rm -rf $(SMARTMONTOOLS_DIR)
  60. #############################################################
  61. #
  62. # Toplevel Makefile options
  63. #
  64. #############################################################
  65. ifeq ($(BR2_PACKAGE_SMARTMONTOOLS),y)
  66. TARGETS+=smartmontools
  67. endif