Makefile 2.0 KB

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