-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (57 loc) · 1.85 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
# Copyright 2017-2024 MOSSDeF, Stan Grishin ([email protected]).
# This is free software, licensed under AGPL-3.0-or-later.
include $(TOPDIR)/rules.mk
PKG_NAME:=fakeinternet
PKG_VERSION:=0.1.4
PKG_RELEASE:=5
PKG_LICENSE:=AGPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <[email protected]>
include $(INCLUDE_DIR)/package.mk
define Package/fakeinternet
SECTION:=net
CATEGORY:=Network
DEPENDS:=+uhttpd +uhttpd-mod-ubus
DEPENDS+=+!BUSYBOX_DEFAULT_GREP:grep
TITLE:=Fakeinternet Service
URL:=https://github.com/stangri/fakeinternet/
PKGARCH:=all
endef
define Package/fakeinternet/description
This service can be used to fake internet connectivity for local devices.
Can be used on routers with no internet access to suppress warnings on local devices of no internet connectivity.
endef
define Package/fakeinternet/conffiles
/etc/config/fakeinternet
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/fakeinternet/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/www_fakeinternet
$(INSTALL_BIN) ./files/fakeinternet.init $(1)/etc/init.d/fakeinternet
$(SED) "s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-r$(PKG_RELEASE)'|" $(1)/etc/init.d/fakeinternet
$(INSTALL_CONF) ./files/fakeinternet.config $(1)/etc/config/fakeinternet
$(INSTALL_BIN) ./files/fakeinternet.cgi $(1)/www_fakeinternet/error.cgi
endef
define Package/fakeinternet/postinst
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
/etc/init.d/fakeinternet enable
fi
exit 0
endef
define Package/fakeinternet/prerm
#!/bin/sh
# check if we are on real system
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Stopping service and removing rc.d symlink for fakeinternet"
/etc/init.d/fakeinternet stop || true
/etc/init.d/fakeinternet disable || true
fi
exit 0
endef
$(eval $(call BuildPackage,fakeinternet))