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.

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