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.

109 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2010-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. PKG_NAME:=flashrom
  9. PKG_VERSION:=0.9.8
  10. PKG_RELEASE:=5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=http://download.flashrom.org/releases
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_MD5SUM:=ac513076b63ab7eb411a7694bb8f6fda
  15. PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
  17. PKG_LICENSE:=GPL-2.0
  18. PKG_LICENSE_FILES:=COPYING
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. include flashrom.mk
  22. TARGET_CFLAGS+= \
  23. -std=gnu89
  24. MAKE_FLAGS+= \
  25. PREFIX="/usr"
  26. define Package/flashrom/default
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. TITLE:=FlashROM Utility
  30. URL:=http://www.flashrom.org/
  31. endef
  32. define Package/flashrom
  33. $(Package/flashrom/default)
  34. TITLE+= (full)
  35. DEPENDS+= \
  36. +(PACKAGE_flashrom&&(TARGET_x86||TARGET_x86_64)):dmidecode \
  37. +PACKAGE_flashrom:libftdi \
  38. +PACKAGE_flashrom:libusb-compat \
  39. +PACKAGE_flashrom:pciutils
  40. VARIANT:=full
  41. DEFAULT_VARIANT:=1
  42. endef
  43. define Package/flashrom-pci
  44. $(Package/flashrom/default)
  45. TITLE+= (pci)
  46. DEPENDS+= \
  47. +(PACKAGE_flashrom-pci&&(TARGET_x86||TARGET_x86_64)):dmidecode \
  48. +PACKAGE_flashrom-pci:pciutils
  49. VARIANT:=pci
  50. endef
  51. define Package/flashrom-spi
  52. $(Package/flashrom/default)
  53. TITLE+= (spi)
  54. VARIANT:=spi
  55. endef
  56. define Package/flashrom-usb
  57. $(Package/flashrom/default)
  58. TITLE+= (usb)
  59. DEPENDS+= \
  60. +PACKAGE_flashrom-usb:libftdi \
  61. +PACKAGE_flashrom-usb:libusb-compat
  62. VARIANT:=usb
  63. endef
  64. define Package/flashrom/default/description
  65. flashrom is an utility for identifying, reading, writing, verifying
  66. and erasing flash chips. It's often used to flash BIOS/EFI/coreboot
  67. /firmware images.
  68. endef
  69. Package/flashrom/description = $(Package/flashrom/default/description)
  70. Package/flashrom-pci/description = $(Package/flashrom/default/description)
  71. Package/flashrom-spi/description = $(Package/flashrom/default/description)
  72. Package/flashrom-usb/description = $(Package/flashrom/default/description)
  73. define Package/flashrom/install
  74. $(INSTALL_DIR) $(1)/usr/sbin
  75. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom
  76. endef
  77. define Package/flashrom-pci/install
  78. $(INSTALL_DIR) $(1)/usr/sbin
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-pci
  80. endef
  81. define Package/flashrom-spi/install
  82. $(INSTALL_DIR) $(1)/usr/sbin
  83. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-spi
  84. endef
  85. define Package/flashrom-usb/install
  86. $(INSTALL_DIR) $(1)/usr/sbin
  87. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/flashrom $(1)/usr/sbin/flashrom-usb
  88. endef
  89. $(eval $(call BuildPackage,flashrom))
  90. $(eval $(call BuildPackage,flashrom-pci))
  91. $(eval $(call BuildPackage,flashrom-spi))
  92. $(eval $(call BuildPackage,flashrom-usb))