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.

81 lines
2.4 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 +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 +owipcalc
  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/postinst
  34. #!/bin/sh
  35. if [ -z $${IPKG_INSTROOT} ] ; then
  36. . /usr/share/wginstaller/install_wginstaller_user.sh
  37. fi
  38. endef
  39. define Package/wg-installer-server-hotplug-babeld
  40. $(call Package/wg-installer-server)
  41. DEPENDS:=wg-installer-server
  42. endef
  43. define Package/wg-installer-server-hotplug-babeld/install
  44. $(INSTALL_DIR) $(1)/etc/hotplug.d/net/
  45. $(INSTALL_BIN) ./wg-server/hotplug.d/99-mesh-babeld $(1)/etc/hotplug.d/net/99-mesh-babeld
  46. endef
  47. define Package/wg-installer-client
  48. $(call Package/wg-installer/Default)
  49. TITLE+= (client)
  50. DEPENDS:=+curl +wireguard-tools
  51. endef
  52. define Package/wg-installer-client/install
  53. $(INSTALL_DIR) $(1)/usr/share/wginstaller/
  54. $(INSTALL_BIN) ./wg-client/lib/rpcd_ubus.sh $(1)/usr/share/wginstaller/rpcd_ubus.sh
  55. $(INSTALL_BIN) ./common/wg.sh $(1)/usr/share/wginstaller/wg.sh
  56. $(INSTALL_DIR) $(1)/usr/bin
  57. $(INSTALL_BIN) ./wg-client/wg-client-installer.sh $(1)/usr/bin/wg-client-installer
  58. $(INSTALL_DIR) $(1)/etc/config
  59. $(INSTALL_CONF) ./wg-client/config/wgclient.conf $(1)/etc/config/wgclient
  60. endef
  61. $(eval $(call BuildPackage,wg-installer-server))
  62. $(eval $(call BuildPackage,wg-installer-server-hotplug-babeld))
  63. $(eval $(call BuildPackage,wg-installer-client))