From 94c20868ba0fd9069b9ba9afe1ffa321355f8e0c Mon Sep 17 00:00:00 2001 From: towa48 Date: Sun, 29 Sep 2019 12:11:46 +0000 Subject: [PATCH] Fix seahub dependencies --- build.sh | 84 +++++++++++++++++++++++------------------------------ maintain.md | 21 ++++++++++++++ 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/build.sh b/build.sh index fca8f9a..6048430 100755 --- a/build.sh +++ b/build.sh @@ -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 @@ -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 @@ -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() @@ -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 @@ -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 @@ -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 @@ -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 } @@ -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 @@ -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 @@ -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 @@ -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 \ @@ -310,7 +301,6 @@ echo_complete() install_dependencies build_libevhtp -install_python_thirdparty export_python_path build_libsearpc diff --git a/maintain.md b/maintain.md index bef2ca6..8f85314 100644 --- a/maintain.md +++ b/maintain.md @@ -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 @@ -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