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
1.8 KiB

  1. #
  2. # Copyright (C) 2016, 2018-2019 Jeffery To
  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.4
  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:=0.9.4
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
  16. PKG_MIRROR_HASH:=52a93506c994b1babf174aec8ac8aebbf94f27263125d144f6d86db001dd24d6
  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. TITLE:=Translate switch position change to button press
  28. URL:=https://github.com/jefferyto/openwrt-slide-switch
  29. DEPENDS:=+jshn +jsonfilter
  30. PKGARCH:=all
  31. endef
  32. define Package/slide-switch/description
  33. slide-switch translates slide switch position changes into normal button
  34. presses and releases for OpenWrt devices.
  35. endef
  36. define Package/slide-switch/install
  37. $(INSTALL_DIR) $(1)/etc/hotplug.d/button
  38. $(INSTALL_DATA) \
  39. $(PKG_INSTALL_DIR)/etc/hotplug.d/button/50-slide-switch \
  40. $(1)/etc/hotplug.d/button
  41. $(INSTALL_DIR) $(1)/etc/init.d
  42. $(INSTALL_BIN) \
  43. $(PKG_INSTALL_DIR)/etc/init.d/zzz-slide-switch \
  44. $(1)/etc/init.d
  45. $(INSTALL_DIR) $(1)/usr/sbin
  46. $(INSTALL_BIN) \
  47. $(PKG_INSTALL_DIR)/usr/sbin/slide-switch \
  48. $(1)/usr/sbin
  49. $(INSTALL_DIR) $(1)/usr/share/slide-switch
  50. $(INSTALL_DATA) \
  51. $(PKG_INSTALL_DIR)/usr/share/slide-switch/functions.sh \
  52. $(PKG_INSTALL_DIR)/usr/share/slide-switch/switch-data.json \
  53. $(1)/usr/share/slide-switch
  54. endef
  55. $(eval $(call BuildPackage,slide-switch))