2023-03-03 19:19:19 +08:00
|
|
|
# This is free software, licensed under the Apache License, Version 2.0 .
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=luci-app-adguardhome
|
|
|
|
PKG_MAINTAINER:=<https://github.com/rufengsuixing/luci-app-adguardhome>
|
|
|
|
|
|
|
|
LUCI_TITLE:=LuCI app for AdGuardHome
|
|
|
|
LUCI_PKGARCH:=all
|
2023-03-11 02:12:51 +08:00
|
|
|
LUCI_DEPENDS:=+!wget-ssl&&!curl:wget-ssl +xz-utils +xz
|
2023-03-03 19:19:19 +08:00
|
|
|
LUCI_DESCRIPTION:=LuCI support for AdGuardHome
|
|
|
|
|
2023-03-09 00:28:03 +08:00
|
|
|
|
2023-03-03 19:19:19 +08:00
|
|
|
define Package/$(PKG_NAME)/config
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_binary
|
|
|
|
bool "Include Binary File"
|
2023-03-09 00:28:03 +08:00
|
|
|
default n
|
2023-03-03 19:19:19 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_binary
|
|
|
|
|
|
|
|
define Package/luci-app-adguardhome/conffiles
|
|
|
|
/usr/share/AdGuardHome/links.txt
|
|
|
|
/etc/config/AdGuardHome
|
|
|
|
/etc/AdGuardHome.yaml
|
|
|
|
endef
|
|
|
|
|
2023-03-09 00:28:03 +08:00
|
|
|
|
2023-03-03 19:19:19 +08:00
|
|
|
define Package/luci-app-adguardhome/postinst
|
|
|
|
#!/bin/sh
|
2023-03-09 00:28:03 +08:00
|
|
|
chmod 755 /usr/share/AdGuardHome/*
|
2023-03-03 19:19:19 +08:00
|
|
|
/etc/init.d/AdGuardHome enable >/dev/null 2>&1
|
|
|
|
enable=$(uci get AdGuardHome.AdGuardHome.enabled 2>/dev/null)
|
|
|
|
if [ "$enable" == "1" ]; then
|
|
|
|
/etc/init.d/AdGuardHome reload
|
|
|
|
fi
|
|
|
|
rm -f /tmp/luci-indexcache
|
|
|
|
rm -f /tmp/luci-modulecache/*
|
|
|
|
exit 0
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/luci-app-adguardhome/prerm
|
|
|
|
#!/bin/sh
|
|
|
|
if [ -z "$${IPKG_INSTROOT}" ]; then
|
|
|
|
/etc/init.d/AdGuardHome disable
|
|
|
|
/etc/init.d/AdGuardHome stop
|
|
|
|
uci -q batch <<-EOF >/dev/null 2>&1
|
|
|
|
delete ucitrack.@AdGuardHome[-1]
|
|
|
|
commit ucitrack
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
endef
|
|
|
|
|
|
|
|
include $(TOPDIR)/feeds/luci/luci.mk
|
|
|
|
|
|
|
|
# call BuildPackage - OpenWrt buildroot signature
|