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.

148 lines
5.2 KiB

  1. #
  2. # Copyright (C) 2007-2017 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=seafile-server
  9. PKG_VERSION:=6.3.4
  10. PKG_RELEASE:=1
  11. PKG_LICENSE:=GPL-3.0
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seafile-server/tar.gz/v$(PKG_VERSION)-server?
  14. PKG_HASH:=1ba4c641bad8d7592fd2592827e81470c88b8e802707d2b1e6d551c16d0da100
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-server
  16. PKG_FIXUP:=autoreconf
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. include $(INCLUDE_DIR)/nls.mk
  20. include ../../lang/python/python-package.mk
  21. define Package/seafile-server
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=Seafile server
  25. MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
  26. URL:=https://seafile.com/
  27. DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli +python-mysql +python-urllib3 \
  28. +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient \
  29. +libpthread +libuuid +bash +procps-ng +procps-ng-pkill +SEAFILE_FUSE_SUPPORT:libfuse $(ICONV_DEPENDS)
  30. EXTRA_DEPENDS:=seafile-seahub (=6.3.4-1)
  31. MENU:=1
  32. endef
  33. define Package/seafile-server/config
  34. source "$(SOURCE)/Config.in"
  35. endef
  36. define Package/seafile-server/description
  37. Open source cloud storage with advanced features on privacy protection and teamwork.
  38. endef
  39. CONFIGURE_ARGS += --disable-client \
  40. --enable-server \
  41. --enable-python \
  42. --disable-static-build \
  43. --disable-server-pkg
  44. ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
  45. CONFIGURE_ARGS += --enable-fuse
  46. TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/fuse
  47. else
  48. CONFIGURE_ARGS += --disable-fuse
  49. endif
  50. ifeq ($(CONFIG_SEAFILE_CONSOLE_SUPPORT),y)
  51. CONFIGURE_ARGS += --enable-console
  52. else
  53. CONFIGURE_ARGS += --disable-console
  54. endif
  55. ifeq ($(CONFIG_SEAFILE_RIAK_SUPPORT),y)
  56. CONFIGURE_ARGS += --enable-riak
  57. else
  58. CONFIGURE_ARGS += --disable-riak
  59. endif
  60. PKG_BUILD_DEPENDS:=vala/host libevhtp
  61. # This is required as python-package.mk overrides the default setting of having interlinking enabled
  62. ifdef CONFIG_USE_MIPS16
  63. TARGET_CFLAGS += -minterlink-mips16
  64. endif
  65. TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
  66. -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz -levent_openssl -levent
  67. define Package/seafile-server/conffiles
  68. /etc/config/seafile
  69. endef
  70. define Package/seafile-server/install
  71. $(INSTALL_DIR) $(1)/usr/{bin,lib}
  72. $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  73. $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server
  74. $(INSTALL_DIR) $(1)/usr/share/seafile/conf
  75. $(INSTALL_DIR) $(1)/etc/{config,init.d}
  76. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  77. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
  78. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
  79. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
  80. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fsck.sh $(1)/usr/share/seafile/seafile-server/
  81. ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
  82. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fuse.sh $(1)/usr/share/seafile/seafile-server/
  83. endif
  84. $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
  85. $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
  86. $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
  87. $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
  88. $(CP) $(PKG_BUILD_DIR)/scripts/check_init_admin.py $(1)/usr/share/seafile/seafile-server/
  89. $(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
  90. $(CP) ./files/seafile.conf $(1)/etc/config/seafile
  91. $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
  92. $(INSTALL_BIN) ./files/seahub.init $(1)/etc/init.d/seahub
  93. find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
  94. endef
  95. define Build/InstallDev
  96. $(INSTALL_DIR) $(1)/usr/include
  97. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  98. $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  99. $(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
  100. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
  101. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
  102. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
  103. endef
  104. define Package/seafile-server/postinst
  105. #!/bin/sh
  106. [ ! -f /etc/init.d/seafile ] && exit 0
  107. if [ ! -d /usr/share/seafile/seafile-data ]
  108. then
  109. echo "*** Installation completed, running configuration script..."
  110. /etc/init.d/seafile setup
  111. if [ $$? -ne 0 ]
  112. then
  113. echo
  114. echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
  115. echo "*** \"/etc/init.d/seafile setup\""
  116. fi
  117. else
  118. echo "*** seafile-data directory already exists."
  119. echo
  120. echo "*** In case you are upgrading seafile, please run the appropriate upgrade script"
  121. echo "*** manually before using the new version."
  122. echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
  123. echo
  124. echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
  125. fi
  126. endef
  127. $(eval $(call BuildPackage,seafile-server))