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.

89 lines
2.5 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=wg-installer
  3. PKG_RELEASE:=$(AUTORELEASE)
  4. PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
  5. include $(INCLUDE_DIR)/package.mk
  6. Build/Compile=
  7. define Package/wg-installer/Default
  8. SECTION:=net
  9. CATEGORY:=Network
  10. TITLE:=WireGuard Installer
  11. URL:=https://github.com/Freifunk-Spalter/
  12. PKGARCH:=all
  13. DEPENDS:=+kmod-wireguard +wireguard-tools +owipcalc
  14. endef
  15. define Package/wg-installer-server
  16. $(call Package/wg-installer/Default)
  17. TITLE+= (server)
  18. MENU:=1
  19. DEPENDS+=+rpcd +uhttpd +uhttpd-mod-ubus
  20. endef
  21. define Package/wg-installer-server/install
  22. $(INSTALL_DIR) $(1)/usr/share/wginstaller/
  23. $(INSTALL_BIN) ./wg-server/lib/install_wginstaller_user.sh $(1)/usr/share/wginstaller/install_wginstaller_user.sh
  24. $(INSTALL_BIN) ./wg-server/lib/wg_functions.sh $(1)/usr/share/wginstaller/wg_functions.sh
  25. $(INSTALL_BIN) ./common/wg.sh $(1)/usr/share/wginstaller/wg.sh
  26. $(INSTALL_DIR) $(1)/usr/libexec/rpcd/
  27. $(INSTALL_BIN) ./wg-server/wginstaller.sh $(1)/usr/libexec/rpcd/wginstaller
  28. $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
  29. $(CP) ./wg-server/config/wginstaller.json $(1)/usr/share/rpcd/acl.d/
  30. $(INSTALL_DIR) $(1)/etc/config
  31. $(INSTALL_CONF) ./wg-server/config/wgserver.conf $(1)/etc/config/wgserver
  32. endef
  33. define Package/wg-installer-server/conffiles
  34. /etc/config/wgserver
  35. endef
  36. define Package/wg-installer-server/postinst
  37. #!/bin/sh
  38. if [ -z $${IPKG_INSTROOT} ] ; then
  39. . /usr/share/wginstaller/install_wginstaller_user.sh
  40. fi
  41. endef
  42. define Package/wg-installer-server-hotplug-babeld
  43. $(call Package/wg-installer-server)
  44. DEPENDS:=wg-installer-server
  45. endef
  46. define Package/wg-installer-server-hotplug-babeld/install
  47. $(INSTALL_DIR) $(1)/etc/hotplug.d/net/
  48. $(INSTALL_BIN) ./wg-server/hotplug.d/99-mesh-babeld $(1)/etc/hotplug.d/net/99-mesh-babeld
  49. endef
  50. define Package/wg-installer-client
  51. $(call Package/wg-installer/Default)
  52. TITLE+= (client)
  53. DEPENDS+=+curl
  54. endef
  55. define Package/wg-installer-client/install
  56. $(INSTALL_DIR) $(1)/usr/share/wginstaller/
  57. $(INSTALL_BIN) ./wg-client/lib/rpcd_ubus.sh $(1)/usr/share/wginstaller/rpcd_ubus.sh
  58. $(INSTALL_BIN) ./common/wg.sh $(1)/usr/share/wginstaller/wg.sh
  59. $(INSTALL_DIR) $(1)/usr/bin
  60. $(INSTALL_BIN) ./wg-client/wg-client-installer.sh $(1)/usr/bin/wg-client-installer
  61. $(INSTALL_DIR) $(1)/etc/config
  62. $(INSTALL_CONF) ./wg-client/config/wgclient.conf $(1)/etc/config/wgclient
  63. endef
  64. define Package/wg-installer-client/conffiles
  65. /etc/config/wgclient
  66. endef
  67. $(eval $(call BuildPackage,wg-installer-server))
  68. $(eval $(call BuildPackage,wg-installer-server-hotplug-babeld))
  69. $(eval $(call BuildPackage,wg-installer-client))