Merge pull request #2928 from cshore/pull-request-tar-acl-options
[feed/packages.git] / net / seafile-seahub / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=seafile-seahub
11 PKG_VERSION:=4.1.2
12 PKG_RELEASE=$(PKG_SOURCE_VERSION)
13 PKG_LICENSE:=Apache-2.0
14
15 PKG_SOURCE_PROTO:=git
16 PKG_SOURCE_URL:=https://github.com/haiwen/seahub.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=3fb1288f920de03a4e2e6a06b60671ce98971742
19 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
20
21 include $(INCLUDE_DIR)/package.mk
22 $(call include_mk, python-package.mk)
23
24 define Package/seafile-seahub
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=Seafile server - seahub component
28 MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
29 URL:=http://seafile.com/
30 DEPENDS:=+python +simplejson +pillow +python-setuptools
31 endef
32
33 define Package/seafile-seahub/description
34 The web end of seafile server.
35
36 NOTE: in order to have better performance, language support is turned off by default.
37 Please set 'USE_I18N = True' in seahub_settings.py to support multiple languages.
38 endef
39
40 PKG_BUILD_DEPENDS:=python-setuptools
41 PYTHONPATH:=$(PYTHONPATH):$(PKG_BUILD_DIR)/thirdpart
42
43 define Download/django
44 FILE=Django-1.5.8.tar.gz
45 URL=https://www.djangoproject.com/m/releases/1.5/
46 MD5SUM:=675fc736e2c29090f005e217ccf90b5b
47 endef
48
49 define Download/djblets
50 PROTO=git
51 URL=https://github.com/djblets/djblets.git
52 SUBDIR=djblets-0.6.14
53 FILE=djblets-0.6.14.tar.gz
54 VERSION=58c09bae9b71ac164f78c76746fd2e545aae6c68
55 endef
56
57 define Download/gunicorn
58 FILE=gunicorn-0.16.1.tar.gz
59 URL=https://pypi.python.org/packages/source/g/gunicorn/
60 MD5SUM:=d53d5d04d941f2a3089e814e753a218f
61 endef
62
63 define Download/six
64 FILE=six-1.4.1.tar.gz
65 URL=https://pypi.python.org/packages/source/s/six/
66 MD5SUM:=bdbb9e12d3336c198695aa4cf3a61d62
67 endef
68
69 define Download/chardet
70 FILE=chardet-2.1.1.tar.gz
71 URL=https://pypi.python.org/packages/source/c/chardet/
72 MD5SUM:=295367fd210d20f3febda615a88e1ef0
73 endef
74
75 define Download/flup
76 FILE=flup-1.0.2-py2.6.egg
77 URL=https://pypi.python.org/packages/2.6/f/flup/
78 MD5SUM:=93ec6e3baeee3e5649a8456105178d4e
79 endef
80
81 define Download/lockfile
82 FILE=lockfile-0.9.1.tar.gz
83 URL=https://pypi.python.org/packages/source/l/lockfile/
84 MD5SUM:=ce61468d4c1263e3005737bbed2641f0
85 endef
86
87 define Download/python-daemon
88 FILE=python-daemon-1.5.5.tar.gz
89 URL=https://pypi.python.org/packages/source/p/python-daemon/
90 MD5SUM:=1f6cd41473c2e201021a0aeef395b2b1
91 endef
92
93 define Download/python-dateutil
94 FILE=python-dateutil-1.5.tar.gz
95 URL=https://pypi.python.org/packages/source/p/python-dateutil/
96 MD5SUM:=0dcb1de5e5cad69490a3b6ab63f0cfa5
97 endef
98
99 define Build/Configure
100 endef
101
102 define Build/Compile
103 # Download python dependencies
104 $(eval $(call Download,django))
105 $(eval $(call Download,djblets))
106 $(eval $(call Download,gunicorn))
107 $(eval $(call Download,six))
108 $(eval $(call Download,chardet))
109 $(eval $(call Download,flup))
110 $(eval $(call Download,lockfile))
111 $(eval $(call Download,python-daemon))
112 $(eval $(call Download,python-dateutil))
113 # Install python dependencies
114 $(call HostPython,, \
115 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
116 $(DL_DIR)/Django-1.5.8.tar.gz)
117 $(call HostPython,, \
118 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
119 $(DL_DIR)/djblets-0.6.14.tar.gz)
120 $(call HostPython,, \
121 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
122 $(DL_DIR)/gunicorn-0.16.1.tar.gz)
123 $(call HostPython,, \
124 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
125 $(DL_DIR)/six-1.4.1.tar.gz)
126 $(call HostPython,, \
127 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
128 $(DL_DIR)/chardet-2.1.1.tar.gz)
129 $(call HostPython,, \
130 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
131 $(DL_DIR)/flup-1.0.2-py2.6.egg)
132 $(call HostPython,, \
133 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
134 $(DL_DIR)/lockfile-0.9.1.tar.gz)
135 $(call HostPython,, \
136 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
137 $(DL_DIR)/python-daemon-1.5.5.tar.gz)
138 $(call HostPython,, \
139 $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
140 $(DL_DIR)/python-dateutil-1.5.tar.gz)
141 endef
142
143 define Package/seafile-seahub/install
144 $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server/seahub
145 $(CP) $(PKG_BUILD_DIR)/{locale,media,fabfile,seahub,sql,tests,thirdpart,tools} $(1)/usr/share/seafile/seafile-server/seahub/
146 $(CP) $(PKG_BUILD_DIR)/*.{sh,template,py,txt} $(1)/usr/share/seafile/seafile-server/seahub/
147 $(CP) $(PKG_BUILD_DIR)/{CONTRIBUTORS,HACKING,README.markdown} $(1)/usr/share/seafile/seafile-server/seahub/
148 $(CP) $(PKG_BUILD_DIR)/pylintrc* $(1)/usr/share/seafile/seafile-server/seahub/
149 # fix python exec path in scripts
150 sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
151 sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
152 sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
153 sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
154 sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
155 find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
156 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
157 endef
158
159 $(eval $(call BuildPackage,seafile-seahub))