Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright (C) 2018-2019 Lienol
  2. #
  3. # This is free software, licensed under the Apache License, Version 2.0 .
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=luci-app-adguardhome
  7. PKG_VERSION:=1.8
  8. PKG_RELEASE:=10
  9. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
  10. include $(INCLUDE_DIR)/package.mk
  11. define Package/luci-app-adguardhome
  12. SECTION:=luci
  13. CATEGORY:=LuCI
  14. SUBMENU:=3. Applications
  15. TITLE:=LuCI app for adguardhome
  16. PKG_MAINTAINER:=<https://github.com/rufengsuixing/luci-app-adguardhome>
  17. PKGARCH:=all
  18. DEPENDS:=+wget
  19. endef
  20. define Package/luci-app-adguardhome/description
  21. LuCI support for adguardhome
  22. endef
  23. define Build/Prepare
  24. endef
  25. define Build/Compile
  26. endef
  27. define Package/luci-app-adguardhome/conffiles
  28. /usr/share/AdGuardHome/links.txt
  29. /etc/config/AdGuardHome
  30. endef
  31. define Package/luci-app-adguardhome/install
  32. $(INSTALL_DIR) $(1)/usr/lib/lua/luci
  33. cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
  34. $(INSTALL_DIR) $(1)/
  35. cp -pR ./root/* $(1)/
  36. $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
  37. po2lmo ./po/zh-cn/AdGuardHome.po $(1)/usr/lib/lua/luci/i18n/AdGuardHome.zh-cn.lmo
  38. endef
  39. define Package/luci-app-adguardhome/postinst
  40. #!/bin/sh
  41. /etc/init.d/AdGuardHome enable >/dev/null 2>&1
  42. enable=$(uci get AdGuardHome.AdGuardHome.enabled 2>/dev/null)
  43. if [ "$enable" == "1" ]; then
  44. /etc/init.d/AdGuardHome reload
  45. fi
  46. rm -f /tmp/luci-indexcache
  47. rm -f /tmp/luci-modulecache/*
  48. exit 0
  49. endef
  50. define Package/luci-app-adguardhome/prerm
  51. #!/bin/sh
  52. if [ -z "$${IPKG_INSTROOT}" ]; then
  53. /etc/init.d/AdGuardHome disable
  54. /etc/init.d/AdGuardHome stop
  55. uci -q batch <<-EOF >/dev/null 2>&1
  56. delete ucitrack.@AdGuardHome[-1]
  57. commit ucitrack
  58. EOF
  59. fi
  60. exit 0
  61. endef
  62. $(eval $(call BuildPackage,luci-app-adguardhome))