2 # Copyright (C) 2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
10 PKG_NAME
:=slide-switch
15 PKG_SOURCE_URL
:=https
://github.com
/jefferyto
/openwrt-slide-switch.git
16 PKG_SOURCE_VERSION
:=9171c2ea9cc9cbfb6f27b7bc25a535c8c35ee534
17 PKG_SOURCE_SUBDIR
:=$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_SOURCE_VERSION
).
tar.gz
19 PKG_MIRROR_HASH
:=9eb2c599b6b8cd8529f7b25455ac2ac3fe97a9ae2e7eec28aea1e971f4d9112b
26 PKG_LICENSE_FILES
:=COPYING
27 PKG_MAINTAINER
:=Jeffery To
<jeffery.to@gmail.com
>
29 include $(INCLUDE_DIR
)/package.mk
31 define Package
/slide-switch
34 DEPENDS
:=+jshn
+jsonfilter
35 TITLE
:=Translate switch position change to button press
36 URL
:=https
://github.com
/jefferyto
/openwrt-slide-switch
39 define Package
/slide-switch
/description
40 slide-switch translates slide switch position changes into normal button
41 presses and releases for OpenWrt
/ LEDE devices.
44 CONFIGURE_ARGS
+= --with-platform
=$(BOARD
)
46 define Package
/slide-switch
/install
47 $(INSTALL_DIR
) $(1)/etc
/hotplug.d
/button
48 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/etc
/hotplug.d
/button
/50-slide-switch
$(1)/etc
/hotplug.d
/button
49 $(INSTALL_DIR
) $(1)/etc
/init.d
50 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/etc
/init.d
/zzz-slide-switch
$(1)/etc
/init.d
51 if
[ -d
$(PKG_INSTALL_DIR
)/usr
/lib
/slide-switch
]; then \
52 $(INSTALL_DIR
) $(1)/usr
/lib
/slide-switch
; \
53 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/slide-switch
/* $(1)/usr
/lib
/slide-switch
; \
55 $(INSTALL_DIR
) $(1)/usr
/sbin
56 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/slide-switch
$(1)/usr
/sbin
57 $(INSTALL_DIR
) $(1)/usr
/share
/slide-switch
58 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/share
/slide-switch
/functions.sh
$(1)/usr
/share
/slide-switch
61 $(eval
$(call BuildPackage
,slide-switch
))