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.

159 lines
5.6 KiB

  1. #
  2. # Copyright (C) 2007-2015 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:=4.0.6
  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:=739b32b02c4803448d5cb75b3e22ec0073930aed
  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 Download/django
  35. FILE=Django-1.5.8.tar.gz
  36. URL=https://www.djangoproject.com/m/releases/1.5/
  37. MD5SUM:=675fc736e2c29090f005e217ccf90b5b
  38. endef
  39. define Download/djblets
  40. PROTO=git
  41. URL=https://github.com/djblets/djblets.git
  42. SUBDIR=djblets-0.6.14
  43. FILE=djblets-0.6.14.tar.gz
  44. VERSION=58c09bae9b71ac164f78c76746fd2e545aae6c68
  45. endef
  46. define Download/gunicorn
  47. FILE=gunicorn-0.16.1.tar.gz
  48. URL=https://pypi.python.org/packages/source/g/gunicorn/
  49. MD5SUM:=d53d5d04d941f2a3089e814e753a218f
  50. endef
  51. define Download/six
  52. FILE=six-1.4.1.tar.gz
  53. URL=https://pypi.python.org/packages/source/s/six/
  54. MD5SUM:=bdbb9e12d3336c198695aa4cf3a61d62
  55. endef
  56. define Download/chardet
  57. FILE=chardet-2.1.1.tar.gz
  58. URL=https://pypi.python.org/packages/source/c/chardet/
  59. MD5SUM:=295367fd210d20f3febda615a88e1ef0
  60. endef
  61. define Download/flup
  62. FILE=flup-1.0.2-py2.6.egg
  63. URL=https://pypi.python.org/packages/2.6/f/flup/
  64. MD5SUM:=93ec6e3baeee3e5649a8456105178d4e
  65. endef
  66. define Download/lockfile
  67. FILE=lockfile-0.9.1.tar.gz
  68. URL=https://pypi.python.org/packages/source/l/lockfile/
  69. MD5SUM:=ce61468d4c1263e3005737bbed2641f0
  70. endef
  71. define Download/python-daemon
  72. FILE=python-daemon-1.5.5.tar.gz
  73. URL=https://pypi.python.org/packages/source/p/python-daemon/
  74. MD5SUM:=1f6cd41473c2e201021a0aeef395b2b1
  75. endef
  76. define Download/python-dateutil
  77. FILE=python-dateutil-1.5.tar.gz
  78. URL=https://pypi.python.org/packages/source/p/python-dateutil/
  79. MD5SUM:=0dcb1de5e5cad69490a3b6ab63f0cfa5
  80. endef
  81. define Build/Configure
  82. endef
  83. define Build/Compile
  84. # Download python dependencies
  85. $(eval $(call Download,django))
  86. $(eval $(call Download,djblets))
  87. $(eval $(call Download,gunicorn))
  88. $(eval $(call Download,six))
  89. $(eval $(call Download,chardet))
  90. $(eval $(call Download,flup))
  91. $(eval $(call Download,lockfile))
  92. $(eval $(call Download,python-daemon))
  93. $(eval $(call Download,python-dateutil))
  94. # Install python dependencies
  95. $(call HostPython,, \
  96. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  97. $(DL_DIR)/Django-1.5.8.tar.gz)
  98. $(call HostPython,, \
  99. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  100. $(DL_DIR)/djblets-0.6.14.tar.gz)
  101. $(call HostPython,, \
  102. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  103. $(DL_DIR)/gunicorn-0.16.1.tar.gz)
  104. $(call HostPython,, \
  105. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  106. $(DL_DIR)/six-1.4.1.tar.gz)
  107. $(call HostPython,, \
  108. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  109. $(DL_DIR)/chardet-2.1.1.tar.gz)
  110. $(call HostPython,, \
  111. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  112. $(DL_DIR)/flup-1.0.2-py2.6.egg)
  113. $(call HostPython,, \
  114. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  115. $(DL_DIR)/lockfile-0.9.1.tar.gz)
  116. $(call HostPython,, \
  117. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  118. $(DL_DIR)/python-daemon-1.5.5.tar.gz)
  119. $(call HostPython,, \
  120. $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
  121. $(DL_DIR)/python-dateutil-1.5.tar.gz)
  122. endef
  123. define Package/seafile-seahub/install
  124. $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server/seahub
  125. $(CP) $(PKG_BUILD_DIR)/{locale,media,fabfile,seahub,sql,tests,thirdpart,tools} $(1)/usr/share/seafile/seafile-server/seahub/
  126. $(CP) $(PKG_BUILD_DIR)/*.{sh,template,py,txt} $(1)/usr/share/seafile/seafile-server/seahub/
  127. $(CP) $(PKG_BUILD_DIR)/{CONTRIBUTORS,HACKING,README.markdown} $(1)/usr/share/seafile/seafile-server/seahub/
  128. $(CP) $(PKG_BUILD_DIR)/pylintrc* $(1)/usr/share/seafile/seafile-server/seahub/
  129. # fix python exec path in scripts
  130. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
  131. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
  132. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
  133. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
  134. sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
  135. find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
  136. 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
  137. endef
  138. $(eval $(call BuildPackage,seafile-seahub))