Skip to content

Commit

Permalink
Merge pull request #119 from ChatDeBlofeld/master
Browse files Browse the repository at this point in the history
Update to v9.0.9
  • Loading branch information
jobenvil authored Nov 21, 2022
2 parents b3c1506 + e3661d0 commit 9a7cee9
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 131 deletions.
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ Seafile server package for Raspberry Pi. Maintained by seafile community.

## Build

E.g. to compile Seafile server v9.0.2:
E.g. to compile Seafile server v9.0.9:

```shell
$ wget https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build.sh
$ chmod u+x build.sh
$ ./build.sh -DTA -v 9.0.2
$ ./build.sh -DTA -v 9.0.9 -h https://github.com/haiwen/seafile-rpi/blob/feat/master/requirements/seahub_requirements_v9.0.9.txt -d https://github.com/haiwen/seafile-rpi/blob/feat/master/requirements/seafdav_requirements_v9.0.9.txt
```

Calling `./build.sh` without arguments will return usage information and a list of all available arguments:

```shell
seafile@rpi-focal:~$ ./build.sh

Expand All @@ -35,29 +38,30 @@ Usage:
-A All options -1 to -8 in one go

-v <vers> Set seafile server version to build
default: 9.0.2
default: 9.0.9
-r <vers> Set libsearpc version
default: 3.2-latest
default: 3.3-latest
-f <vers> Set fixed libsearpc version
default: 3.1.0
-h <vers> Set python requirement file for seahub
default: https://raw.githubusercontent.com/haiwen/seahub/v9.0.2-server/requirements.txt
default: https://raw.githubusercontent.com/haiwen/seahub/v9.0.9-server/requirements.txt
-d <vers> Set python requirement file for seafdav
default: https://raw.githubusercontent.com/haiwen/seafdav/v9.0.2-server/requirements.txt
default: https://raw.githubusercontent.com/haiwen/seafdav/v9.0.9-server/requirements.txt

use --version for version info of this script.
```

Schema of created directory structure after execution of `./build.sh`:

```
seafile@rpi-focal:~$ tree . -L 3
.
├── build.sh
├── build-server.py.patch
├── built-seafile-server-pkgs
│   └── seafile-server-9.0.2-focal-armv7l.tar.gz
│   └── seafile-server-9.0.9-focal-armv7l.tar.gz
├── built-seafile-sources
│   └── R9.0.2
│   └── R9.0.9
├── go
│   └── pkg
├── haiwen-build
Expand All @@ -75,11 +79,13 @@ seafile@rpi-focal:~$ tree . -L 3
## Batch Build

If you want to build for multiple distributions and architectures via lxc containers you can run:

```shell
$ wget https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build-batch.sh
$ chmod u+x build-batch.sh
$ time bash ./build-batch.sh 9.0.2
$ time bash ./build-batch.sh 9.0.9
```

Edit the script in order to build for your preferred distributions.

## Manual and Guides
Expand All @@ -89,9 +95,11 @@ Edit the script in order to build for your preferred distributions.

## Reporting Issues / GitHub Issues

If you have any problems or suggestions when using the seafile rpi server package, please report it on [seafile server forum](https://forum.seafile.com/).
If you have any problems or suggestions when using the seafile rpi server package, please report it
on [seafile server forum](https://forum.seafile.com/).

**GitHub Issues support is dropped** and will not be maintained anymore. If you need help, clarification or report some weird behaviour, please post it on the [seafile server forum](https://forum.seafile.com/) as well.
**GitHub Issues support is dropped** and will not be maintained anymore. If you need help, clarification or report some
weird behaviour, please post it on the [seafile server forum](https://forum.seafile.com/) as well.

## Contributors

Expand Down
11 changes: 7 additions & 4 deletions build-batch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Set the version which needs to be build
VERSION=${1:-'9.0.2'}
VERSION=${1:-'9.0.9'}

echo "Get the current build script"
wget -O build.sh https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build.sh
Expand All @@ -11,10 +11,10 @@ chmod u+x build.sh
sysArch=$(arch)
[ "$sysArch" == "aarch64" ] && archhfName='armv8l' || archhfName='armv7l'

declare -A lxcDistroMap=(["stretch"]="debian/9/" ["buster"]="debian/10/" ["bullseye"]="debian/11/" ["bionic"]="ubuntu/18.04/" ["focal"]="ubuntu/20.04/" ["hirsute"]="ubuntu/21.04/" ["impish"]="ubuntu/21.10/")
declare -A lxcDistroMap=(["bullseye"]="debian/11/" ["buster"]="debian/10/" ["stretch"]="debian/9/" ["kinetic"]="ubuntu/22.10/" ["jammy"]="ubuntu/22.04/" ["focal"]="ubuntu/20.04/" ["bionic"]="ubuntu/18.04/")

# Assign the distros which need to be build
configLxcDistros=("hirsute" "focal" "bionic" "bullseye" "buster")
configLxcDistros=("jammy" "focal" "bionic" "bullseye" "buster")
configLxcArchs=("armhf")
if [[ "$sysArch" == "aarch64" ]]; then
# Only add arm64 if system supports it
Expand Down Expand Up @@ -58,6 +58,9 @@ for container in ${lxcContainers[@]}; do
sudo lxc exec $container -- /bin/bash -c "echo 'seafile ALL=(ALL) NOPASSWD: ALL' | sudo EDITOR='tee -a' visudo"
fi

echo "Upgrade container packages: $container"
sudo lxc exec $container -- apt-get update && apt-get -y upgrade

echo "Building for container: $container"
sudo lxc file push build.sh $container/home/seafile/

Expand All @@ -67,7 +70,7 @@ for container in ${lxcContainers[@]}; do
sleep .5
done
echo -e "\e[1A\e[KNetwork available in $container";
sudo lxc exec $container -- su - seafile -- ./build.sh -D -A -v $VERSION
sudo lxc exec $container -- su - seafile -- ./build.sh -DTA -v $VERSION -h https://raw.githubusercontent.com/haiwen/seafile-rpi/master/requirements/seahub_requirements_v${VERSION}.txt -d https://raw.githubusercontent.com/haiwen/seafile-rpi/master/requirements/seafdav_requirements_v${VERSION}.txt
filename=$(sudo lxc exec $container -- bash -c "ls /home/seafile/built-seafile-server-pkgs/seafile-server-$VERSION-*.tar.gz" 2>/dev/null)
sudo lxc file pull "$container$filename" ./

Expand Down
107 changes: 0 additions & 107 deletions build-server.py.patch

This file was deleted.

12 changes: 3 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
[[ "$1" =~ ^(--version)$ ]] && {
echo "2022-04-21";
echo "2022-11-09";
exit 0
};

Expand All @@ -20,17 +20,16 @@ PREFIX="${HOME}/opt/local"
# Temporary folder for seafile-server dependency builds for shared libraries (ld)
# see https://github.com/haiwen/seahub/blob/eab3ba2f6d3a311728130d8752c716e782b8d62e/scripts/build/build-server.py#L324

LIBSEARPC_VERSION_LATEST="3.2-latest" # check if new tag is available on https://github.com/haiwen/libsearpc/releases
LIBSEARPC_VERSION_LATEST="3.3-latest" # check if new tag is available on https://github.com/haiwen/libsearpc/releases
LIBSEARPC_VERSION_FIXED="3.1.0" # libsearpc sticks to 3.1.0 https://github.com/haiwen/libsearpc/commit/43d768cf2eea6afc6e324c2b1a37a69cd52740e3
VERSION="9.0.2"
VERSION="9.0.9"
VERSION_SEAFILE="6.0.1" # dummy version for seafile (see configure.ac)
MYSQL_CONFIG_PATH="/usr/bin/mysql_config" # ensure compilation with mysql support

VERSION_TAG="v${VERSION}-server"
LIBSEARPC_TAG="v${LIBSEARPC_VERSION_LATEST}"
PYTHON_REQUIREMENTS_URL_SEAHUB="https://raw.githubusercontent.com/haiwen/seahub/${VERSION_TAG}/requirements.txt" # official requirements.txt file
PYTHON_REQUIREMENTS_URL_SEAFDAV="https://raw.githubusercontent.com/haiwen/seafdav/${VERSION_TAG}/requirements.txt"
BUILD_SERVER_PATCH="https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build-server.py.patch"

STEPS=0
STEPCOUNTER=0
Expand Down Expand Up @@ -618,11 +617,6 @@ build_server()
cd "${BUILDPATH}"
mkmissingdir "${SCRIPTPATH}/${PKGDIR}"

msg "-> Copying current build-server.py.patch from GitHub to ${SCRIPTPATH}..."
(set -x; wget "${BUILD_SERVER_PATCH}" -O "${SCRIPTPATH}/build-server.py.patch")

msg "-> Applying patch file from ${SCRIPTPATH}/build-server.py.patch..."
(set -x; patch -N -b "${BUILDPATH}/seahub/scripts/build/build-server.py" "${SCRIPTPATH}/build-server.py.patch")
msg "-> Executing build-server.py"
(set -x; python3 "${BUILDPATH}/seahub/scripts/build/build-server.py" \
--libsearpc_version="${LIBSEARPC_VERSION_FIXED}" \
Expand Down
4 changes: 4 additions & 0 deletions requirements/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Requirements

Updated dependencies for [Seahub](https://github.com/haiwen/seahub/blob/master/requirements.txt)
and [Seafdav](https://github.com/haiwen/seafdav/blob/master/requirements.txt).
10 changes: 10 additions & 0 deletions requirements/seafdav_requirements_v9.0.5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defusedxml~=0.5
Jinja2~=2.10
json5~=0.8.5
python-pam~=1.8
PyYAML~=5.1
six~=1.13
lxml
sqlalchemy
# input from @wsirhc see https://github.com/haiwen/seafile-rpi/issues/113
markupsafe==2.0.1
10 changes: 10 additions & 0 deletions requirements/seafdav_requirements_v9.0.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defusedxml~=0.5
Jinja2~=2.10
json5~=0.8.5
python-pam~=1.8
PyYAML~=5.1
six~=1.13
lxml
sqlalchemy
# input from @wsirhc see https://github.com/haiwen/seafile-rpi/issues/113
markupsafe==2.0.1
27 changes: 27 additions & 0 deletions requirements/seahub_requirements_v9.0.5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See: https://github.com/haiwen/seafile-rpi/issues/99#issuecomment-1002535579
Django<4
future
captcha
django-statici18n
django-webpack_loader==0.7.0
gunicorn
mysqlclient
django-picklefield>=2.1.1
openpyxl
qrcode
django-formtools>=2.3
django-simple-captcha
djangorestframework>=3.11.1
python-dateutil
requests
pillow
pyjwt>=2.1.*
pycryptodome>=3.12.0
requests_oauthlib
chardet
python-cas
djangosaml2>=0.20.0
pysaml2>=6.5.1
cffi>=1.14.0
# input from @nihilistaX see https://github.com/haiwen/seafile-rpi/issues/99
cryptography==36.0.0
29 changes: 29 additions & 0 deletions requirements/seahub_requirements_v9.0.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See: https://github.com/haiwen/seafile-rpi/issues/99#issuecomment-1002535579
Django<4
future
captcha
django-statici18n
django-webpack_loader==0.7.0
gunicorn
mysqlclient
django-picklefield>=2.1.1
openpyxl
qrcode
django-formtools>=2.3
django-simple-captcha
djangorestframework>=3.11.1
python-dateutil
requests
pillow
pyjwt>=2.1.*
pycryptodome>=3.12.0
requests_oauthlib
chardet
python-cas
djangosaml2>=0.20.0
pysaml2>=6.5.1
cffi>=1.14.0
# input from @nihilistaX see https://github.com/haiwen/seafile-rpi/issues/99
cryptography==36.0.0
Markdown
bleach

0 comments on commit 9a7cee9

Please sign in to comment.