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