Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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.5
  8. PKG_RELEASE:=4
  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 Support for adguardhome
  16. PKGARCH:=all
  17. DEPENDS:=
  18. endef
  19. define Package/luci-app-adguardhome/description
  20. LuCI support for adguardhome
  21. endef
  22. define Build/Prepare
  23. endef
  24. define Build/Compile
  25. endef
  26. define Package/luci-app-adguardhome/conffiles
  27. /etc/AdGuardHome.yaml
  28. /etc/config/AdGuardHome
  29. endef
  30. define Package/luci-app-adguardhome/install
  31. $(INSTALL_DIR) $(1)/usr/lib/lua/luci
  32. cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
  33. $(INSTALL_DIR) $(1)/
  34. cp -pR ./root/* $(1)/
  35. endef
  36. define Package/luci-app-adguardhome/postinst
  37. #!/bin/sh
  38. /etc/init.d/AdGuardHome enable >/dev/null 2>&1
  39. enable=$(uci get AdGuardHome.AdGuardHome.enabled)
  40. if [ "$enable"x == "1"x ]; then
  41. /etc/init.d/AdGuardHome start
  42. fi
  43. exit 0
  44. endef
  45. define Package/luci-app-adguardhome/prerm
  46. #!/bin/sh
  47. if [ -z "$${IPKG_INSTROOT}" ]; then
  48. /etc/init.d/AdGuardHome disable
  49. /etc/init.d/AdGuardHome stop
  50. fi
  51. exit 0
  52. endef
  53. $(eval $(call BuildPackage,luci-app-adguardhome))