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.

61 lines
1.9 KiB

  1. #
  2. # Copyright (C) 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:=slide-switch
  9. PKG_VERSION:=0.9.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/jefferyto/openwrt-slide-switch.git
  13. PKG_SOURCE_VERSION:=9171c2ea9cc9cbfb6f27b7bc25a535c8c35ee534
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. PKG_MIRROR_HASH:=9eb2c599b6b8cd8529f7b25455ac2ac3fe97a9ae2e7eec28aea1e971f4d9112b
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_FIXUP:=autoreconf
  19. PKG_INSTALL:=1
  20. PKG_LICENSE:=GPL-2.0
  21. PKG_LICENSE_FILES:=COPYING
  22. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/slide-switch
  25. SECTION:=utils
  26. CATEGORY:=Utilities
  27. DEPENDS:=+jshn +jsonfilter
  28. TITLE:=Translate switch position change to button press
  29. URL:=https://github.com/jefferyto/openwrt-slide-switch
  30. endef
  31. define Package/slide-switch/description
  32. slide-switch translates slide switch position changes into normal button
  33. presses and releases for OpenWrt / LEDE devices.
  34. endef
  35. CONFIGURE_ARGS += --with-platform=$(BOARD)
  36. define Package/slide-switch/install
  37. $(INSTALL_DIR) $(1)/etc/hotplug.d/button
  38. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/hotplug.d/button/50-slide-switch $(1)/etc/hotplug.d/button
  39. $(INSTALL_DIR) $(1)/etc/init.d
  40. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/init.d/zzz-slide-switch $(1)/etc/init.d
  41. if [ -d $(PKG_INSTALL_DIR)/usr/lib/slide-switch ]; then \
  42. $(INSTALL_DIR) $(1)/usr/lib/slide-switch; \
  43. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/slide-switch/* $(1)/usr/lib/slide-switch; \
  44. fi
  45. $(INSTALL_DIR) $(1)/usr/sbin
  46. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/slide-switch $(1)/usr/sbin
  47. $(INSTALL_DIR) $(1)/usr/share/slide-switch
  48. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/slide-switch/functions.sh $(1)/usr/share/slide-switch
  49. endef
  50. $(eval $(call BuildPackage,slide-switch))