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.

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