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.

151 lines
5.5 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.0.7
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)-3
  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:=715f072c1bbc78eedddcaf7748e28c83c3f4dbc6
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  17. PKG_MIRROR_HASH:=eaba9296a1fbc4429bacc6234e3e643da7b8f7950ba42c9b9b5b1d58c38c4273
  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.0.7-a0de32b9cfeca98ab93d84cacbe9d315d7ecca35-1), seafile-seahub (=6.0.7-2cf75b17a372216a88842172f769d61f621416fd-2)
  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_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
  82. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
  83. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fsck.sh $(1)/usr/share/seafile/seafile-server/
  84. ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
  85. $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fuse.sh $(1)/usr/share/seafile/seafile-server/
  86. endif
  87. $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
  88. $(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
  89. $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
  90. $(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
  91. $(CP) $(PKG_BUILD_DIR)/scripts/check_init_admin.py $(1)/usr/share/seafile/seafile-server/
  92. $(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
  93. $(CP) ./files/seafile.conf $(1)/etc/config/seafile
  94. $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
  95. $(INSTALL_BIN) ./files/seahub.init $(1)/etc/init.d/seahub
  96. find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
  97. endef
  98. define Build/InstallDev
  99. $(INSTALL_DIR) $(1)/usr/include
  100. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  101. $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  102. $(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
  103. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
  104. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
  105. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
  106. $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
  107. endef
  108. define Package/seafile-server/postinst
  109. #!/bin/sh
  110. [ ! -f /etc/init.d/seafile ] && exit 0
  111. if [ ! -d /usr/share/seafile/seafile-data ]
  112. then
  113. echo "*** Installation completed, running configuration script..."
  114. /etc/init.d/seafile setup
  115. if [ $$? -ne 0 ]
  116. then
  117. echo
  118. echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
  119. echo "*** \"/etc/init.d/seafile setup\""
  120. fi
  121. else
  122. echo "*** seafile-data directory already exists."
  123. echo
  124. echo "*** In case you are upgrading seafile, please run the appropriate upgrade script"
  125. echo "*** manually before using the new version."
  126. echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
  127. echo
  128. echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
  129. fi
  130. endef
  131. $(eval $(call BuildPackage,seafile-server))