Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / utils / slide-switch / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=slide-switch
11 PKG_VERSION:=0.9.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=git
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
20
21 PKG_BUILD_PARALLEL:=1
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24
25 PKG_LICENSE:=GPL-2.0
26 PKG_LICENSE_FILES:=COPYING
27 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
28
29 include $(INCLUDE_DIR)/package.mk
30
31 define Package/slide-switch
32 SECTION:=utils
33 CATEGORY:=Utilities
34 DEPENDS:=+jshn +jsonfilter
35 TITLE:=Translate switch position change to button press
36 URL:=https://github.com/jefferyto/openwrt-slide-switch
37 endef
38
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.
42 endef
43
44 CONFIGURE_ARGS += --with-platform=$(BOARD)
45
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; \
54 fi
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
59 endef
60
61 $(eval $(call BuildPackage,slide-switch))