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.

93 lines
4.2 KiB

  1. #
  2. # Copyright (C) 2007-2014 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-seahub
  9. PKG_VERSION:=3.1.7
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_LICENSE:=Apache-2.0
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/haiwen/seahub.git
  14. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  15. PKG_SOURCE_VERSION:=a984c86442e7fc10c3bcf6d92b4843f7263547eb
  16. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  17. include $(INCLUDE_DIR)/package.mk
  18. $(call include_mk, python-package.mk)
  19. define Package/seafile-seahub
  20. SECTION:=net
  21. CATEGORY:=Network
  22. TITLE:=Seafile server - seahub component
  23. MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
  24. URL:=http://seafile.com/
  25. DEPENDS:=+python +simplejson +python-imglib +python-setuptools
  26. endef
  27. define Package/seafile-seahub/description
  28. The web end of seafile server.
  29. NOTE: in order to have better performance, language support is turned off by default.
  30. Please set 'USE_I18N = True' in seahub_settings.py to support multiple languages.
  31. endef
  32. PKG_BUILD_DEPENDS:=python-setuptools
  33. PYTHONPATH:=$(PYTHONPATH):$(PKG_BUILD_DIR)/thirdpart
  34. define Build/Configure
  35. endef
  36. define Build/Compile
  37. # Install python dependencies
  38. $(call HostPython,, \
  39. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  40. https://www.djangoproject.com/m/releases/1.5/Django-1.5.8.tar.gz)
  41. $(call HostPython,, \
  42. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  43. https://github.com/djblets/djblets/archive/release-0.6.14.tar.gz)
  44. $(call HostPython,, \
  45. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  46. https://pypi.python.org/packages/source/g/gunicorn/gunicorn-0.16.1.tar.gz)
  47. $(call HostPython,, \
  48. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  49. https://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz)
  50. $(call HostPython,, \
  51. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  52. https://pypi.python.org/packages/source/c/chardet/chardet-2.1.1.tar.gz)
  53. $(call HostPython,, \
  54. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  55. https://pypi.python.org/packages/2.6/f/flup/flup-1.0.2-py2.6.egg)
  56. $(call HostPython,, \
  57. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  58. https://pypi.python.org/packages/source/l/lockfile/lockfile-0.9.1.tar.gz)
  59. $(call HostPython,, \
  60. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  61. https://pypi.python.org/packages/source/p/python-daemon/python-daemon-1.5.5.tar.gz)
  62. $(call HostPython,, \
  63. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  64. https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz)
  65. endef
  66. define Package/seafile-seahub/install
  67. $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server/seahub
  68. $(CP) $(PKG_BUILD_DIR)/{locale,media,seahub,sql,subdomain,tests,thirdpart,tools} $(1)/usr/share/seafile/seafile-server/seahub/
  69. $(CP) $(PKG_BUILD_DIR)/*.{sh,template,py,txt} $(1)/usr/share/seafile/seafile-server/seahub/
  70. $(CP) $(PKG_BUILD_DIR)/{CONTRIBUTORS,HACKING,README.markdown} $(1)/usr/share/seafile/seafile-server/seahub/
  71. $(CP) $(PKG_BUILD_DIR)/pylintrc* $(1)/usr/share/seafile/seafile-server/seahub/
  72. # fix python exec path in scripts
  73. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
  74. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
  75. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
  76. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
  77. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
  78. find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
  79. sed -i "s/\(SEAFILE_VERSION\s*=\s*\)'\([0-9]\.[0-9]\.[0-9]\)'/\1'$(PKG_VERSION)'/g" $(1)/usr/share/seafile/seafile-server/seahub/seahub/settings.py
  80. endef
  81. $(eval $(call BuildPackage,seafile-seahub))