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.

74 lines
1.9 KiB

  1. #
  2. # Copyright (C) 2016, 2018-2019, 2021 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.6
  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:=4a11db6954c5a8ff9eb253600de0d9b034e639f053604bae0c9a6802dd685be5
  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
  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/install
  35. $(INSTALL_DIR) $(1)/etc/hotplug.d/button
  36. $(INSTALL_DATA) \
  37. $(PKG_INSTALL_DIR)/etc/hotplug.d/button/50-slide-switch \
  38. $(1)/etc/hotplug.d/button
  39. $(INSTALL_DIR) $(1)/etc/init.d
  40. $(INSTALL_BIN) \
  41. $(PKG_INSTALL_DIR)/etc/init.d/zzz-slide-switch \
  42. $(1)/etc/init.d
  43. $(INSTALL_DIR) $(1)/usr/sbin
  44. $(INSTALL_BIN) \
  45. $(PKG_INSTALL_DIR)/usr/sbin/slide-switch \
  46. $(1)/usr/sbin
  47. $(INSTALL_DIR) $(1)/usr/share/slide-switch
  48. $(INSTALL_DATA) \
  49. $(PKG_INSTALL_DIR)/usr/share/slide-switch/functions.sh \
  50. $(PKG_INSTALL_DIR)/usr/share/slide-switch/switch-data.json \
  51. $(1)/usr/share/slide-switch
  52. endef
  53. define Package/slide-switch/postinst
  54. [ -n "$$IPKG_INSTROOT" ] || /usr/sbin/slide-switch clean
  55. endef
  56. define Package/slide-switch/prerm
  57. [ -n "$$IPKG_INSTROOT" ] || /usr/sbin/slide-switch clean
  58. endef
  59. $(eval $(call BuildPackage,slide-switch))