Skip to content

Commit

Permalink
Fix seahub dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
towa48 committed Sep 29, 2019
1 parent 8bd8e02 commit 94c2086
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 47 deletions.
84 changes: 37 additions & 47 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ VERSION_TAG=v$VERSION-server
VERSION_CCNET=6.0.1 # seafile/ccnet has not consistent version (see configure.ac)
VERSION_SEAFILE=6.0.1

STEPS=11
STEPS=10

mkdir -p $BUILDFOLDER

#
# INSTALL DEPENDENCIES
Expand Down Expand Up @@ -65,11 +67,11 @@ build_libevhtp()
echo
echo -e "\e[93m-> [2/$STEPS] Build libevhtp\e[39m"

mkdir $BUILDFOLDER
cd $BUILDFOLDER

if [ -d "libevhtp" ]; then
cd libevhtp
git checkout master
git pull
else
git clone https://www.github.com/haiwen/libevhtp.git
Expand All @@ -84,40 +86,6 @@ build_libevhtp()
ldconfig
}

#
# Install python third party
#

install_python_thirdparty()
{
echo
echo -e "\e[93m-> [3/$STEPS] Install python libraries\e[39m"

mkdir -p $THIRDPARTYFOLDER
export PYTHONPATH=$THIRDPARTYFOLDER

pip install --target=$PYTHONPATH --no-deps --upgrade \
pytz==2016.1 \
Django==1.8.10 \
django-statici18n==1.1.3 \
djangorestframework==3.3.2 \
django_compressor==1.4 \
jsonfield==1.0.3 \
django-post_office==2.0.6 \
gunicorn==19.4.5 \
flup==1.0.2 \
chardet==2.3.0 \
python-dateutil==1.5 \
six==1.9.0 \
django-picklefield==0.3.2 \
jdcal==1.2 \
et_xmlfile==1.0.1 \
openpyxl==2.3.0

wget -O /tmp/django_constance.zip https://github.com/haiwen/django-constance/archive/bde7f7c.zip
pip install --target=$PYTHONPATH /tmp/django_constance.zip
}

# PREPARE libs

export_python_path()
Expand All @@ -132,11 +100,12 @@ export_python_path()
build_libsearpc()
{
echo
echo -e "\e[93m-> [4/$STEPS] Build libsearpc\e[39m"
echo -e "\e[93m-> [3/$STEPS] Build libsearpc\e[39m"

cd $BUILDFOLDER
if [ -d "libsearpc" ]; then
cd libsearpc
git checkout master
git pull
else
git clone https://github.com/haiwen/libsearpc.git
Expand All @@ -154,11 +123,12 @@ build_libsearpc()
build_ccnet()
{
echo
echo -e "\e[93m-> [5/$STEPS] Build ccnet-server\e[39m"
echo -e "\e[93m-> [4/$STEPS] Build ccnet-server\e[39m"

cd $BUILDFOLDER
if [ -d "ccnet-server" ]; then
cd ccnet-server
git checkout master
git pull
else
git clone https://github.com/haiwen/ccnet-server.git
Expand All @@ -176,11 +146,12 @@ build_ccnet()
build_seafile()
{
echo
echo -e "\e[93m-> [6/$STEPS] Build seafile-server\e[39m"
echo -e "\e[93m-> [5/$STEPS] Build seafile-server\e[39m"

cd $BUILDFOLDER
if [ -d "seafile-server" ]; then
cd seafile-server
git checkout master
git pull
else
git clone https://github.com/haiwen/seafile-server.git
Expand All @@ -198,20 +169,38 @@ build_seafile()
build_seahub()
{
echo
echo -e "\e[93m-> [7/$STEPS] Build seahub\e[39m"
echo -e "\e[93m-> [6/$STEPS] Build seahub\e[39m"

export PATH=$THIRDPARTYFOLDER/django/bin:$PATH
export PATH=$THIRDPARTYFOLDER:$PATH

# get source code
cd $BUILDFOLDER
if [ -d "seahub" ]; then
cd seahub
git checkout master
git pull
else
git clone https://github.com/haiwen/seahub.git
cd seahub
fi
git reset --hard $VERSION_TAG
./tools/gen-tarball.py --version=$VERSION_SEAFILE --branch=HEAD # WAIT.. WHAT?

# get and build python dependencies
apt-get install libxml2-dev libxslt-dev

mkdir -p $THIRDPARTYFOLDER
export PYTHONPATH=$THIRDPARTYFOLDER

if ! [ -x "$(command -v easy_install)" ]; then
pip install easy_install
fi
while read line; do easy_install -d $THIRDPARTYFOLDER $line; done < requirements.txt

# temporary fix for 7.0.4
easy_install -d $THIRDPARTYFOLDER flup==1.0.2 SQLAlchemy==1.3.5 django_picklefield==2.0 urllib3==1.22

# generate package
./tools/gen-tarball.py --version=$VERSION_SEAFILE --branch=HEAD
cd $SCRIPTPATH
}

Expand All @@ -220,11 +209,12 @@ build_seahub()
build_seafobj()
{
echo
echo -e "\e[93m-> [8/$STEPS] Build seafobj\e[39m"
echo -e "\e[93m-> [7/$STEPS] Build seafobj\e[39m"

cd $BUILDFOLDER
if [ -d "seafobj" ]; then
cd seafobj
git checkout master
git pull
else
git clone https://github.com/haiwen/seafobj.git
Expand All @@ -240,11 +230,12 @@ build_seafobj()
build_seafdav()
{
echo
echo -e "\e[93m-> [9/$STEPS] Build seafdav\e[39m"
echo -e "\e[93m-> [8/$STEPS] Build seafdav\e[39m"

cd $BUILDFOLDER
if [ -d "seafdav" ]; then
cd seafdav
git checkout master
git pull
else
git clone https://github.com/haiwen/seafdav.git
Expand All @@ -262,7 +253,7 @@ build_seafdav()
copy_pkg_source()
{
echo
echo -e "\e[93m-> [10/$STEPS] Copy sources\e[39m"
echo -e "\e[93m-> [9/$STEPS] Copy sources\e[39m"

mkdir -p $PKGSOURCEDIR
cp $BUILDFOLDER/libsearpc/libsearpc-$LIBSEARPC_VERSION.tar.gz $PKGSOURCEDIR
Expand All @@ -280,7 +271,7 @@ copy_pkg_source()
build_server()
{
echo
echo -e "\e[93m-> [11/$STEPS] Build server\e[39m"
echo -e "\e[93m-> [10/$STEPS] Build server\e[39m"

mkdir -p $PKGDIR
$SCRIPTPATH/$BUILDFOLDER/seafile-server/scripts/build/build-server.py \
Expand Down Expand Up @@ -310,7 +301,6 @@ echo_complete()
install_dependencies
build_libevhtp

install_python_thirdparty
export_python_path

build_libsearpc
Expand Down
21 changes: 21 additions & 0 deletions maintain.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Build

```
$ sudo ./build.sh
```

Please check [the official document](http://manual.seafile.com/build_seafile/rpi.html)

# Release a new version
Expand All @@ -9,3 +13,20 @@ Please check [the official document](http://manual.seafile.com/build_seafile/rpi
- Release title should be like "Seafile server 4.1.2 for Raspberry Pi"
- Upload the packages there.
- After uploading, update the version number and download link in [REAME.md](README.md).

# Common problems and solutions

## Not enough memory to build lxml package

symptoms:
```
Processing lxml-4.4.1.tar.gz
aarch64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
```

solution: Increase available memory by using a [swap file](https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-18-04)

## Unknown seahub error while gunicorn starting

symptoms: fails with no console message
solution: temporary comment 'Daemon=True' line in gunicorn.conf and start seahub again

0 comments on commit 94c2086

Please sign in to comment.