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.

75 lines
2.1 KiB

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