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.

69 lines
1.9 KiB

  1. # This is free software, licensed under the GNU General Public License v2.
  2. # See /LICENSE for more information.
  3. #
  4. include $(TOPDIR)/rules.mk
  5. PKG_NPM_NAME:=homebridge
  6. PKG_NAME:=node-$(PKG_NPM_NAME)
  7. PKG_VERSION:=0.4.46
  8. PKG_RELEASE:=1
  9. PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
  10. PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
  11. PKG_HASH:=c648a5a6f6bfb79b1d2eaac71d12ee2f6cd2221f33dacd5de2e6734004f19646
  12. PKG_BUILD_DEPENDS:=node/host
  13. PKG_USE_MIPS16:=0
  14. PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
  15. PKG_LICENSE:=ISC Apache-2.0
  16. PKG_LICENSE_FILES:=LICENSE
  17. include $(INCLUDE_DIR)/package.mk
  18. define Package/node-homebridge
  19. SUBMENU:=Node.js
  20. SECTION:=lang
  21. CATEGORY:=Languages
  22. TITLE:=Node.js HomeKit Server
  23. URL:=https://www.npmjs.org/package/homebridge
  24. DEPENDS:=+node +node-npm
  25. USERID:=homebridge:homebridge
  26. endef
  27. define Package/node-homebridge/description
  28. Homebridge is a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API
  29. endef
  30. NODEJS_CPU:=$(subst powerpc,ppc,$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))))
  31. define Build/Prepare
  32. $(INSTALL_DIR) $(PKG_BUILD_DIR)
  33. endef
  34. define Build/Compile
  35. $(MAKE_VARS) \
  36. $(MAKE_FLAGS) \
  37. npm_config_arch=$(NODEJS_CPU) \
  38. npm_config_target_arch=$(NODEJS_CPU) \
  39. npm_config_build_from_source=true \
  40. npm_config_nodedir=$(STAGING_DIR)/usr/ \
  41. npm_config_prefix=$(PKG_INSTALL_DIR)/usr/ \
  42. npm_config_cache=$(TMP_DIR)/npm-cache \
  43. npm_config_tmp=$(TMP_DIR)/npm-tmp \
  44. npm install -g $(DL_DIR)/$(PKG_SOURCE)
  45. rm -rf $(TMP_DIR)/npm-tmp
  46. rm -rf $(TMP_DIR)/npm-cache
  47. endef
  48. define Package/node-homebridge/install
  49. $(INSTALL_DIR) $(1)/usr/lib/node
  50. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/* $(1)/usr/lib/node/
  51. $(INSTALL_DIR) $(1)/usr/bin
  52. $(LN) ../lib/node/homebridge/bin/homebridge $(1)/usr/bin/homebridge
  53. $(INSTALL_DIR) $(1)/etc/init.d
  54. $(INSTALL_BIN) ./files/homebridge.init $(1)/etc/init.d/homebridge
  55. endef
  56. $(eval $(call BuildPackage,node-homebridge))