You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.1 KiB

  1. # SPDX-License-Identifier: MIT
  2. #
  3. # Copyright (C) 2021-2022 Gerald Kerma
  4. #
  5. include $(TOPDIR)/rules.mk
  6. PKG_NAME:=lua-cs-bouncer
  7. PKG_SOURCE_DATE:=2022-01-18
  8. PKG_SOURCE_VERSION:=e0f68b1265c386715c1d6ab79fe9063c0a9e3d3a
  9. PKG_RELEASE:=$(AUTORELEASE)
  10. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
  11. PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/$(PKG_NAME)/tar.gz/$(PKG_SOURCE_VERSION)?
  12. PKG_HASH:=c7e92cc9dc023ebcd84f3632d6cf0e38a7d9f5e7bba15367247753a306b89829
  13. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  14. PKG_LICENSE:=MIT
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_MAINTAINER:=Gerald Kerma <gandalf@gk2.net>
  17. HOST_BUILD_DEPENDS:=lua/host
  18. PKG_BUILD_DEPENDS:=luarocks/host
  19. include $(INCLUDE_DIR)/host-build.mk
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/lua-cs-bouncer
  22. SUBMENU:=Lua
  23. SECTION:=lang
  24. CATEGORY:=Languages
  25. TITLE:=Lua Crowdsec Bouncer module
  26. URL:=https://github.com/crowdsecurity/lua-cs-bouncer
  27. DEPENDS:=+lua \
  28. +luasec
  29. endef
  30. define Package/lua-cs-bouncer/description
  31. Lua module to allow ip (or not) from CrowdSec API.
  32. endef
  33. define Build/Compile
  34. endef
  35. define Package/lua-cs-bouncer/install
  36. $(INSTALL_DIR) $(1)/usr/lib/lua/crowdsec
  37. $(INSTALL_DATA) \
  38. $(PKG_BUILD_DIR)/lib/*.lua \
  39. $(1)/usr/lib/lua/crowdsec/
  40. $(INSTALL_DATA) \
  41. $(PKG_BUILD_DIR)/template.conf \
  42. $(1)/usr/lib/lua/crowdsec/crowdsec.conf
  43. $(INSTALL_DIR) $(1)/usr/lib/crowdsec/lua/plugins/crowdsec
  44. $(INSTALL_DATA) \
  45. $(PKG_BUILD_DIR)/nginx/config.lua \
  46. $(1)/usr/lib/crowdsec/lua/plugins/crowdsec/
  47. $(INSTALL_DATA) \
  48. $(PKG_BUILD_DIR)/nginx/crowdsec.lua \
  49. $(1)/usr/lib/crowdsec/lua/
  50. $(INSTALL_DATA) \
  51. $(PKG_BUILD_DIR)/nginx/recaptcha.lua \
  52. $(1)/usr/lib/crowdsec/lua/
  53. $(INSTALL_DATA) \
  54. $(PKG_BUILD_DIR)/nginx/access.lua \
  55. $(1)/usr/lib/crowdsec/lua/
  56. $(INSTALL_DIR) $(1)/etc/uci-defaults
  57. $(INSTALL_BIN) \
  58. ./files/lua-cs-bouncer.defaults \
  59. $(1)/etc/uci-defaults/99_lua-cs-bouncer
  60. endef
  61. define Package/lua-cs-bouncer/conffiles
  62. /usr/lib/lua/crowdsec/crowdsec.conf
  63. endef
  64. $(eval $(call BuildPackage,lua-cs-bouncer))