Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.7
  8. PKG_RELEASE:=34
  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"x == "1"x ]; 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. fi
  56. exit 0
  57. endef
  58. $(eval $(call BuildPackage,luci-app-adguardhome))