-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
70 lines (57 loc) · 1.98 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (c) 2016, prpl Foundation
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without
# fee is hereby granted, provided that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
# FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Author: Nils Koenig <[email protected]>
include $(TOPDIR)/rules.mk
PKG_NAME:=wifischedule
PKG_VERSION:=1
PKG_RELEASE:=5
PKG_LICENSE:=PRPL
PKG_MAINTAINER:=Nils Koenig <[email protected]>
include $(INCLUDE_DIR)/package.mk
define Package/wifischedule
SUBMENU:=Wireless
TITLE:=Turns WiFi on and off according to a schedule
SECTION:=net
CATEGORY:=Network
PKGARCH:=all
endef
define Package/wifischedule/description
Turns WiFi on and off according to a schedule defined in UCI.
endef
define Package/wifischedule/conffiles
/etc/config/wifi_schedule
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/wifischedule/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./net/usr/bin/wifi_schedule.sh $(1)/usr/bin/wifi_schedule.sh
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./net/etc/config/wifi_schedule $(1)/etc/config/wifi_schedule
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./net/etc/init.d/wifi_schedule $(1)/etc/init.d/wifi_schedule
endef
define Package/wifischedule/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Enabling rc.d symlink for wifischedule"
/etc/init.d/wifi_schedule enable
fi
exit 0
endef
$(eval $(call BuildPackage,wifischedule))