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.

70 lines
1.9 KiB

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