• How to Build Seafile Server Release Package for Raspberry Pi
    • Setup the build environment" level="2">Setup the build environment
      • Install packages" level="3"> Install packages
      • Compile development libraries" level="3"> Compile development libraries
      • Install python libraries" level="3"> Install python libraries
    • Prepare seafile source code" level="2">Prepare seafile source code
    • Test the built package" level="2"> Test the built package
      • Test a fresh install" level="3">Test a fresh install
      • Test upgrading from a previous version" level="3"> Test upgrading from a previous version

    How to Build Seafile Server Release Package for Raspberry Pi

    Table of contents:

    Setup the build environment" class="reference-link">Setup the build environment

    Requirements:

    • A raspberry pi with raspian distribution installed.

    Install packages" class="reference-link"> Install packages

    1. sudo apt-get install build-essential
    2. sudo apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-setuptools cmake

    Compile development libraries" class="reference-link"> Compile development libraries

    libevhtp

    libevhtp is a http server libary on top of libevent. It’s used in seafile file server.

    1. git clone https://www.github.com/haiwen/libevhtp.git
    2. cd libevhtp
    3. cmake -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
    4. make
    5. sudo make install

    After compiling all the libraries, run ldconfig to update the system libraries cache:

    1. sudo ldconfig

    Install python libraries" class="reference-link"> Install python libraries

    Create a new directory /home/pi/dev/seahub_thirdpart:

    1. mkdir -p ~/dev/seahub_thirdpart

    Download these tarballs to /tmp/:

    Install all these libaries to /home/pi/dev/seahub_thirdpart:

    1. cd ~/dev/seahub_thirdpart
    2. export PYTHONPATH=.
    3. easy_install -d . /tmp/pytz-2016.1.tar.gz
    4. easy_install -d . /tmp/Django-1.8.10.tar.gz
    5. easy_install -d . /tmp/django-statici18n-1.1.3.tar.gz
    6. easy_install -d . /tmp/djangorestframework-3.3.2.tar.gz
    7. easy_install -d . /tmp/django_compressor-1.4.tar.gz
    8. easy_install -d . /tmp/jsonfield-1.0.3.tar.gz
    9. easy_install -d . /tmp/django-post_office-2.0.6.tar.gz
    10. easy_install -d . /tmp/gunicorn-19.4.5.tar.gz
    11. easy_install -d . /tmp/flup-1.0.2.tar.gz
    12. easy_install -d . /tmp/chardet-2.3.0.tar.gz
    13. easy_install -d . /tmp/python-dateutil-1.5.tar.gz
    14. easy_install -d . /tmp/six-1.9.0.tar.gz
    15. easy_install -d . /tmp/django-picklefield-0.3.2.tar.gz
    16. wget -O /tmp/django_constance.zip https://github.com/haiwen/django-constance/archive/bde7f7c.zip
    17. easy_install -d . /tmp/django_constance.zip
    18. easy_install -d . /tmp/jdcal-1.2.tar.gz
    19. easy_install -d . /tmp/et_xmlfile-1.0.1.tar.gz
    20. easy_install -d . /tmp/openpyxl-2.3.0.tar.gz

    Prepare seafile source code" class="reference-link">Prepare seafile source code

    To build seafile server, there are four sub projects involved:

    The build process has two steps:

    • First, fetch the tags of each projects, and make a soruce tarball for each of them.
    • Then run a build-server.py script to build the server package from the source tarballs.

    Fetch git tags and prepare source tarballs" class="reference-link"> Fetch git tags and prepare source tarballs

    Seafile manages the releases in tags on github.

    Assume we are packaging for seafile server 6.0.1, then the tags are:

    • ccnet-server, seafile-server, and seahub would all have a v6.0.1-sever tag.
    • libsearpc would have the v3.0-latest tag (libsearpc has been quite stable and basically has no further development, so the tag is always v3.0-latest)

    First setup the PKG_CONFIG_PATH enviroment variable (So we don’t need to make and make install libsearpc/ccnet/seafile into the system):

    1. export PKG_CONFIG_PATH=/home/pi/dev/seafile/lib:$PKG_CONFIG_PATH
    2. export PKG_CONFIG_PATH=/home/pi/dev/libsearpc:$PKG_CONFIG_PATH
    3. export PKG_CONFIG_PATH=/home/pi/dev/ccnet:$PKG_CONFIG_PATH

    libsearpc

    1. cd ~/dev
    2. git clone https://github.com/haiwen/libsearpc.git
    3. cd libsearpc
    4. git reset --hard v3.0-latest
    5. ./autogen.sh
    6. ./configure
    7. make dist

    ccnet

    1. cd ~/dev
    2. git clone https://github.com/haiwen/ccnet-server.git
    3. cd ccnet
    4. git reset --hard v6.0.1-server
    5. ./autogen.sh
    6. ./configure
    7. make dist

    seafile

    1. cd ~/dev
    2. git clone https://github.com/haiwen/seafile-server.git
    3. cd seafile
    4. git reset --hard v6.0.1-server
    5. ./autogen.sh
    6. ./configure
    7. make dist

    seahub

    1. cd ~/dev
    2. git clone https://github.com/haiwen/seahub.git
    3. cd seahub
    4. git reset --hard v6.0.1-server
    5. ./tools/gen-tarball.py --version=6.0.1 --branch=HEAD

    seafobj

    1. cd ~/dev
    2. git clone https://github.com/haiwen/seafobj.git
    3. cd seafobj
    4. git reset --hard v6.0.1-server
    5. make dist

    seafdav

    1. cd ~/dev
    2. git clone https://github.com/haiwen/seafdav.git
    3. cd seafdav
    4. git reset --hard v6.0.1-server
    5. make

    Copy the source tar balls to the same folder

    1. mkdir ~/seafile-sources
    2. cp ~/dev/libsearpc/libsearpc-<version>-tar.gz ~/seafile-sources
    3. cp ~/dev/ccnet/ccnet-<version>-tar.gz ~/seafile-sources
    4. cp ~/dev/seafile/seafile-<version>-tar.gz ~/seafile-sources
    5. cp ~/dev/seahub/seahub-<version>-tar.gz ~/seafile-sources
    6. cp ~/dev/seafobj/seafobj.tar.gz ~/seafile-sources
    7. cp ~/dev/seafdav/seafdav.tar.gz ~/seafile-sources

    Run the packaging script" class="reference-link"> Run the packaging script

    Now we have all the tarballs prepared, we can run the build-server.py script to build the server package.

    1. mkdir ~/seafile-server-pkgs
    2. ~/dev/seafile/scripts/build-server.py --libsearpc_version=<libsearpc_version> --ccnet_version=<ccnet_version> --seafile_version=<seafile_version> --seahub_version=<seahub_version> --srcdir= --thirdpartdir=/home/pi/dev/seahub_thirdpart --srcdir=/home/pi/seafile-sources --outputdir=/home/pi/seafile-server-pkgs

    After the script finisheds, we would get a seafile-server_6.0.1_pi.tar.gz in ~/seafile-server-pkgs folder.

    Test the built package" class="reference-link"> Test the built package

    Test a fresh install" class="reference-link">Test a fresh install

    Use the built seafile server package to go over the steps of Deploying Seafile with SQLite.

    The test should cover these steps at least:

    • The setup process is ok
    • After seafile.sh start and seahub.sh start, you can login from a browser.
    • Uploading/Downloading files through a web browser works correctly.
    • Seafile WebDAV server works correctly

    Test upgrading from a previous version" class="reference-link"> Test upgrading from a previous version

    • Download the package of the previous version seafile server, and setup it.
    • Upgrading according to the manual
    • After the upgrade, check the functionality is ok:
      • Uploading/Downloading files through a web browser works correctly.
      • Seafile WebDAV server works correctly