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.

71 lines
1.8 KiB

  1. #
  2. # Copyright (C) 2016, 2018-2019, 2022 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:=1.0.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/jefferyto/openwrt-slide-switch.git
  13. PKG_MIRROR_HASH:=6afa0b444b13fc9cec23643203cfd82526007156b459a4e98b728e1b321edfbd
  14. PKG_SOURCE_VERSION:=$(PKG_VERSION)
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. PKG_LICENSE:=GPL-2.0-only
  19. PKG_LICENSE_FILES:=COPYING
  20. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/slide-switch
  23. SECTION:=utils
  24. CATEGORY:=Utilities
  25. TITLE:=Translate switch position change to button press
  26. URL:=https://github.com/jefferyto/openwrt-slide-switch
  27. DEPENDS:=+jshn +jsonfilter
  28. PKGARCH:=all
  29. endef
  30. define Package/slide-switch/description
  31. slide-switch translates slide switch position changes into normal button
  32. presses and releases for OpenWrt devices.
  33. endef
  34. define Package/slide-switch/conffiles
  35. /etc/slide-switch/switch-data.json
  36. endef
  37. define Package/slide-switch/install
  38. $(INSTALL_DIR) $(1)/etc/hotplug.d/button
  39. $(INSTALL_DATA) \
  40. $(PKG_INSTALL_DIR)/etc/hotplug.d/button/50-slide-switch \
  41. $(1)/etc/hotplug.d/button
  42. $(INSTALL_DIR) $(1)/etc/init.d
  43. $(INSTALL_BIN) \
  44. $(PKG_INSTALL_DIR)/etc/init.d/slide-switch \
  45. $(PKG_INSTALL_DIR)/etc/init.d/zzz-slide-switch-update \
  46. $(1)/etc/init.d
  47. $(INSTALL_DIR) $(1)/usr/sbin
  48. $(INSTALL_BIN) \
  49. $(PKG_INSTALL_DIR)/usr/sbin/slide-switch \
  50. $(1)/usr/sbin
  51. $(INSTALL_DIR) $(1)/usr/share/slide-switch
  52. $(INSTALL_DATA) \
  53. $(PKG_INSTALL_DIR)/usr/share/slide-switch/functions.sh \
  54. $(PKG_INSTALL_DIR)/usr/share/slide-switch/switch-data.json \
  55. $(1)/usr/share/slide-switch
  56. endef
  57. $(eval $(call BuildPackage,slide-switch))