Commit based upon d6442850bde61f0c3e7e2ae3247b4a856073c5e0
[librecmc/package-feed.git] / utils / crelay / Makefile
1 #
2 # Copyright (C) 2015-2016 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=crelay
11 PKG_VERSION:=0.10.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=https://github.com/ondrej1024/crelay
16 PKG_SOURCE_VERSION:=V$(PKG_VERSION)
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
21 PKG_LICENSE:=GPL-2.0
22 PKG_LICENSE_FILES:=LICENSE
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/nls.mk
26
27 define Package/crelay
28   SECTION:=utils
29   CATEGORY:=Utilities
30   TITLE:=USB relay remote control daemon
31   URL:=http://github.com/ondrej1024/crelay
32   DEPENDS:=+libftdi1 +hidapi +libusb-1.0
33 endef
34
35 define Package/crelay/description
36  crelay is used to control different relay cards in a unified manner. It provides
37  several interfaces for controlling the relays locally or remotely by a web browser
38  or a smartphone.  The card which is detected first will be used. A WebUI control is
39  available on port 8000 (default)
40  .
41  Currently supported relay cards:
42       - Conrad USB 4-channel relay card
43       - Sainsmart USB 4/8-channel relay board
44       - Sainsmart USB 16-channel relay control module
45       - Generic GPIO relays
46       - HID API compatible relay card
47 endef
48
49 define Build/Configure
50 endef
51
52 TARGET_CFLAGS+= \
53         -D_GNU_SOURCE \
54         -I$(STAGING_DIR)/usr/include/libftdi1 \
55         -I$(STAGING_DIR)/usr/include/hidapi
56
57 TARGET_LDFLAGS+= $(if $(ICONV_FULL),-liconv)
58
59 define Build/Compile
60         $(MAKE) -C $(PKG_BUILD_DIR)/src \
61                 CC="$(TARGET_CC)" \
62                 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
63                 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
64 endef
65
66 define Package/crelay/install
67         $(INSTALL_DIR) $(1)/usr/bin
68         $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/crelay $(1)/usr/bin/
69         $(INSTALL_DIR) $(1)/etc/init.d
70         $(INSTALL_BIN) ./files/crelay.init $(1)/etc/init.d/crelay
71         $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/crelay.conf $(1)/etc
72 endef
73
74 $(eval $(call BuildPackage,crelay))