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.

112 lines
3.3 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=etebase
  3. PKG_VERSION:=0.6.1
  4. PKG_RELEASE:=1
  5. PKG_SOURCE:=etebase-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=https://github.com/etesync/server/archive/v$(PKG_VERSION)
  7. PKG_HASH:=4832c35fa1b46936bfde894a8c888989e9a37dd64ca588df22524825f3e568ec
  8. PKG_LICENSE:=AGPL-3.0-only
  9. PKG_LICENSE_FILES:=LICENSE
  10. PKG_MAINTAINER:=Peter Stadler <peter.stadler@student.uibk.ac.at>
  11. PKG_BUILD_PARALLEL:=1
  12. PYTHON3_PKG_BUILD:=0
  13. PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
  14. include $(INCLUDE_DIR)/package.mk
  15. include ../../lang/python/python3-package.mk
  16. define Package/etebase
  17. SECTION:=net
  18. CATEGORY:=Network
  19. SUBMENU:=Web Servers/Proxies
  20. TITLE:=End-to-end encrypted backend
  21. URL:=https://www.etebase.com/
  22. DEPENDS:=+nginx-ssl +uwsgi +uwsgi-syslog-plugin +uwsgi-python3-plugin +python3-light \
  23. +python3-asgiref +python3-cffi +python3-django-cors-headers +python3-django \
  24. +python3-django-restframework +python3-drf-nested-routers +python3-msgpack \
  25. +python3-pycparser +python3-pynacl +python3-pytz +python3-six +python3-sqlparse
  26. # +psycopg2-binary would be needed for using postgres db.
  27. USERID:=etebase=44312
  28. endef
  29. define Package/etebase/description
  30. End-to-end encrypted backend
  31. endef
  32. Build/Compile:=:
  33. define Py3Package/etebase/install
  34. # OpenWrt specific:
  35. $(INSTALL_DIR) $(1)/etc/uci-defaults/
  36. $(CP) ./files/81_setup-etebase $(1)/etc/uci-defaults/
  37. $(INSTALL_DIR) $(1)/etc/init.d/
  38. $(INSTALL_BIN) ./files/uwsgi.init $(1)/etc/init.d/etebase
  39. $(INSTALL_DIR) $(1)/etc/config/
  40. $(INSTALL_CONF) ./files/uci.cfg $(1)/etc/config/etebase
  41. # Server configuration:
  42. $(INSTALL_DIR) $(1)/etc/nginx/conf.d/
  43. $(INSTALL_CONF) ./files/etebase.locations $(1)/etc/nginx/conf.d/
  44. $(INSTALL_DIR) $(1)/etc/uwsgi/vassals/
  45. $(INSTALL_CONF) ./files/uwsgi.ini $(1)/etc/uwsgi/vassals/etebase.available
  46. #init links etebase.available /var/etc/etebase/uwsgi.ini:
  47. $(LN) /var/etc/etebase/uwsgi.ini $(1)/etc/uwsgi/vassals/etebase.ini
  48. # Upstream application:
  49. $(INSTALL_DIR) $(1)/usr/share/etebase/
  50. $(INSTALL_BIN) $(PKG_BUILD_DIR)/manage.py $(1)/usr/share/etebase/
  51. #init creates /var/etc/etebase/server.ini from uci.cfg:
  52. $(LN) /var/etc/etebase/server.ini $(1)/usr/share/etebase/etebase-server.ini
  53. $(INSTALL_DIR) $(1)/usr/share/etebase/django_etebase/
  54. $(CP) $(PKG_BUILD_DIR)/django_etebase/* $(1)/usr/share/etebase/django_etebase/
  55. $(INSTALL_DIR) $(1)/usr/share/etebase/etebase_server/
  56. $(CP) $(PKG_BUILD_DIR)/etebase_server/* $(1)/usr/share/etebase/etebase_server/
  57. $(INSTALL_DIR) $(1)/usr/share/etebase/myauth/
  58. $(CP) $(PKG_BUILD_DIR)/myauth/* $(1)/usr/share/etebase/myauth/
  59. $(INSTALL_DIR) $(1)/usr/share/etebase/templates/
  60. $(INSTALL_DATA) $(PKG_BUILD_DIR)/templates/* $(1)/usr/share/etebase/templates/
  61. $(INSTALL_DIR) $(1)/www/etebase/static/
  62. endef
  63. Py3Package/etebase/filespec:=
  64. define Package/etebase/postrm
  65. #!/bin/sh
  66. [ -n "$${IPKG_INSTROOT}" ] && exit 0
  67. cd /usr/share/etebase/ && rmdir */*/*/*/* */*/*/* */*/* */* * 2>/dev/null
  68. [ "$${PKG_UPGRADE}" = "1" ] && exit 0
  69. rm -r /www/etebase/static
  70. rmdir --ignore-fail-on-non-empty /www/etebase /var/etc/etebase
  71. exit 0
  72. endef
  73. define Package/etebase/conffiles
  74. /etc/config/etebase
  75. /etc/nginx/conf.d/etebase.locations
  76. /etc/uwsgi/vassals/etebase.available
  77. endef
  78. $(eval $(call Py3Package,etebase))
  79. $(eval $(call BuildPackage,etebase))
  80. $(eval $(call BuildPackage,etebase-src))