seafile-admin-docs/manual/develop/linux.md
feiniks 7df309f125
Add install argon2 (#386)
Co-authored-by: yangheran <heran.yang@seafile.com>
2024-11-01 16:20:59 +08:00

164 lines
4.0 KiB
Markdown

# Linux
#### Preparation
The following list is what you need to install on your development machine. **You should install all of them before you build Seafile**.
Package names are according to Ubuntu 14.04. For other Linux distros, please find their corresponding names yourself.
* autoconf/automake/libtool
* libevent-dev ( 2.0 or later )
* libcurl4-openssl-dev (1.0.0 or later)
* libgtk2.0-dev ( 2.24 or later)
* uuid-dev
* intltool (0.40 or later)
* libsqlite3-dev (3.7 or later)
* valac (only needed if you build from git repo)
* libjansson-dev
* qtchooser
* qtbase5-dev
* libqt5webkit5-dev
* qttools5-dev
* qttools5-dev-tools
* valac
* cmake
* python-simplejson (for seaf-cli)
* libssl-dev
* libargon2-dev
=== "Ubuntu"
```bash
sudo apt-get install autoconf automake libtool libevent-dev libcurl4-openssl-dev libgtk2.0-dev uuid-dev intltool libsqlite3-dev valac libjansson-dev cmake qtchooser qtbase5-dev libqt5webkit5-dev qttools5-dev qttools5-dev-tools libssl-dev libargon2-dev
```
=== "Fedora 20/23"
```bash
$ sudo yum install wget gcc libevent-devel openssl-devel gtk2-devel libuuid-devel sqlite-devel jansson-devel intltool cmake libtool vala gcc-c++ qt5-qtbase-devel qt5-qttools-devel qt5-qtwebkit-devel libcurl-devel openssl-devel argon2-devel
```
#### Building
First you should get the latest source of libsearpc/ccnet/seafile/seafile-client:
Download the source tarball of the latest tag from
* <https://github.com/haiwen/libsearpc/tags> (use v3.2-latest)
* <https://github.com/haiwen/seafile/tags>
* <https://github.com/haiwen/seafile-client/tags>
For example, if the latest released seafile client is 8.0.0, then just use the **v8.0.0** tags of the four projects. You should get four tarballs:
* libsearpc-v3.2-latest.tar.gz
* seafile-8.0.0.tar.gz
* seafile-client-8.0.0.tar.gz
```sh
# without alias wget= might not work
shopt -s expand_aliases
export version=8.0.0
alias wget='wget --content-disposition -nc'
wget https://github.com/haiwen/libsearpc/archive/v3.2-latest.tar.gz
wget https://github.com/haiwen/ccnet/archive/v${version}.tar.gz
wget https://github.com/haiwen/seafile/archive/v${version}.tar.gz
wget https://github.com/haiwen/seafile-client/archive/v${version}.tar.gz
```
Now uncompress them:
```sh
tar xf libsearpc-3.2-latest.tar.gz
tar xf ccnet-${version}.tar.gz
tar xf seafile-${version}.tar.gz
tar xf seafile-client-${version}.tar.gz
```
To build Seafile client, you need first build **libsearpc** and **ccnet**, **seafile**.
##### set paths
```bash
export PREFIX=/usr
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
export PATH="$PREFIX/bin:$PATH"
```
##### libsearpc
```bash
cd libsearpc-3.2-latest
./autogen.sh
./configure --prefix=$PREFIX
make
sudo make install
cd ..
```
##### seafile
In order to support notification server, you need to build libwebsockets first.
```bash
git clone --branch=v4.3.0 https://github.com/warmcat/libwebsockets
cd libwebsockets
mkdir build
cd build
cmake ..
make
sudo make install
cd ..
```
You can set `--enable-ws` to no to disable notification server.
After that, you can build seafile:
```bash
cd seafile-${version}/
./autogen.sh
./configure --prefix=$PREFIX --disable-fuse
make
sudo make install
cd ..
```
#### seafile-client
```bash
cd seafile-client-${version}
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PREFIX .
make
sudo make install
cd ..
```
#### custom prefix
when installing to a custom `$PREFIX`, i.e. `/opt`, you may need a script to set the path variables correctly
```bash
cat >$PREFIX/bin/seafile-applet.sh <<END
#!/bin/bash
export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
export PATH="$PREFIX/bin:$PATH"
exec seafile-applet $@
END
cat >$PREFIX/bin/seaf-cli.sh <<END
export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
export PATH="$PREFIX/bin:$PATH"
export PYTHONPATH=$PREFIX/lib/python2.7/site-packages
exec seaf-cli $@
END
chmod +x $PREFIX/bin/seafile-applet.sh $PREFIX/bin/seaf-cli.sh
```
you can now start the client with `$PREFIX/bin/seafile-applet.sh`.