|
@@ -19,6 +19,7 @@ PKG_SOURCE_VERSION:=a984c86442e7fc10c3bcf6d92b4843f7263547eb
|
19
|
19
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
20
|
20
|
|
21
|
21
|
include $(INCLUDE_DIR)/package.mk
|
|
22
|
+$(call include_mk, python-package.mk)
|
22
|
23
|
|
23
|
24
|
define Package/seafile-seahub
|
24
|
25
|
SECTION:=net
|
|
@@ -37,11 +38,40 @@ define Package/seafile-seahub/description
|
37
|
38
|
endef
|
38
|
39
|
|
39
|
40
|
PKG_BUILD_DEPENDS:=python-setuptools
|
|
41
|
+PYTHONPATH:=$(PYTHONPATH):$(PKG_BUILD_DIR)/thirdpart
|
40
|
42
|
|
41
|
43
|
define Build/Configure
|
42
|
44
|
endef
|
43
|
45
|
|
44
|
46
|
define Build/Compile
|
|
47
|
+ # Install python dependencies
|
|
48
|
+ $(call HostPython,, \
|
|
49
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
50
|
+ https://www.djangoproject.com/m/releases/1.5/Django-1.5.8.tar.gz)
|
|
51
|
+ $(call HostPython,, \
|
|
52
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
53
|
+ https://github.com/djblets/djblets/archive/release-0.6.14.tar.gz)
|
|
54
|
+ $(call HostPython,, \
|
|
55
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
56
|
+ https://pypi.python.org/packages/source/g/gunicorn/gunicorn-0.16.1.tar.gz)
|
|
57
|
+ $(call HostPython,, \
|
|
58
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
59
|
+ https://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz)
|
|
60
|
+ $(call HostPython,, \
|
|
61
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
62
|
+ https://pypi.python.org/packages/source/c/chardet/chardet-2.1.1.tar.gz)
|
|
63
|
+ $(call HostPython,, \
|
|
64
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
65
|
+ https://pypi.python.org/packages/2.6/f/flup/flup-1.0.2-py2.6.egg)
|
|
66
|
+ $(call HostPython,, \
|
|
67
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
68
|
+ https://pypi.python.org/packages/source/l/lockfile/lockfile-0.9.1.tar.gz)
|
|
69
|
+ $(call HostPython,, \
|
|
70
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
71
|
+ https://pypi.python.org/packages/source/p/python-daemon/python-daemon-1.5.5.tar.gz)
|
|
72
|
+ $(call HostPython,, \
|
|
73
|
+ $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
|
|
74
|
+ https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz)
|
45
|
75
|
endef
|
46
|
76
|
|
47
|
77
|
define Package/seafile-seahub/install
|
|
@@ -50,26 +80,13 @@ define Package/seafile-seahub/install
|
50
|
80
|
$(CP) $(PKG_BUILD_DIR)/*.{sh,template,py,txt} $(1)/usr/share/seafile/seafile-server/seahub/
|
51
|
81
|
$(CP) $(PKG_BUILD_DIR)/{CONTRIBUTORS,HACKING,README.markdown} $(1)/usr/share/seafile/seafile-server/seahub/
|
52
|
82
|
$(CP) $(PKG_BUILD_DIR)/pylintrc* $(1)/usr/share/seafile/seafile-server/seahub/
|
53
|
|
- # Installing python dependencies
|
54
|
|
- export PYTHONPATH="$(1)/usr/share/seafile/seafile-server/seahub/thirdpart:$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \
|
55
|
|
- export PYTHONOPTIMIZE=""; \
|
56
|
|
- export PYTHONDONTWRITEBYTECODE=1; \
|
57
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://www.djangoproject.com/m/releases/1.5/Django-1.5.8.tar.gz; \
|
58
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z -N https://github.com/djblets/djblets/archive/release-0.6.14.tar.gz; \
|
59
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/g/gunicorn/gunicorn-0.16.1.tar.gz; \
|
60
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz; \
|
61
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/c/chardet/chardet-2.1.1.tar.gz; \
|
62
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/2.6/f/flup/flup-1.0.2-py2.6.egg; \
|
63
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/l/lockfile/lockfile-0.9.1.tar.gz; \
|
64
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/p/python-daemon/python-daemon-1.5.5.tar.gz; \
|
65
|
|
- easy_install -d $(1)/usr/share/seafile/seafile-server/seahub/thirdpart -Z https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz
|
66
|
|
- # fix python exec path in scripts
|
67
|
|
- sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/env python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
|
68
|
|
- sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/env python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
|
69
|
|
- sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/env python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
|
70
|
|
- sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/env python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
|
71
|
|
- sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/env python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
|
72
|
|
- find $(PKG_BUILD_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
|
83
|
+ # fix python exec path in scripts
|
|
84
|
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
|
|
85
|
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
|
|
86
|
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
|
|
87
|
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
|
|
88
|
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
|
|
89
|
+ find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
|
73
|
90
|
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
|
74
|
91
|
endef
|
75
|
92
|
|