Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to v10.0.1 #123

Merged
merged 5 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Seafile server package for Raspberry Pi. Maintained by seafile community.

## Build

E.g. to compile Seafile server v9.0.9:
E.g. to compile Seafile server v10.0.1:

```shell
$ wget https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build.sh
$ chmod u+x build.sh
$ sudo ./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
$ sudo ./build.sh -DTA -v 10.0.1 -h https://github.com/haiwen/seafile-rpi/blob/feat/master/requirements/seahub_requirements_v10.0.1.txt -d https://github.com/haiwen/seafile-rpi/blob/feat/master/requirements/seafdav_requirements_v10.0.1.txt
```

Calling `./build.sh` without arguments will return usage information and a list of all available arguments:
Expand All @@ -30,23 +30,24 @@ Usage:
-2 Build/update libsearpc
-3 Build/update seafile (c_fileserver)
-4 Build/update seafile (go_fileserver)
-5 Build/update seahub
-6 Build/update seafobj
-7 Build/update seafdav
-8 Build/update Seafile server
-5 Build/update seafile (notification_server)
-6 Build/update seahub
-7 Build/update seafobj
-8 Build/update seafdav
-9 Build/update Seafile server

-A All options -1 to -8 in one go
-A All options -1 to -9 in one go

-v <vers> Set seafile server version to build
default: 9.0.9
default: 10.0.1
-r <vers> Set libsearpc version
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.9-server/requirements.txt
default: https://raw.githubusercontent.com/haiwen/seahub/v10.0.1-server/requirements.txt
-d <vers> Set python requirement file for seafdav
default: https://raw.githubusercontent.com/haiwen/seafdav/v9.0.9-server/requirements.txt
default: https://raw.githubusercontent.com/haiwen/seafdav/v10.0.1-server/requirements.txt

use --version for version info of this script.
```
Expand All @@ -59,9 +60,9 @@ seafile@rpi-focal:~$ tree . -L 3
├── build.sh
├── build-server.py.patch
├── built-seafile-server-pkgs
│   └── seafile-server-9.0.9-focal-armv7l.tar.gz
│   └── seafile-server-10.0.1-focal-armv7l.tar.gz
├── built-seafile-sources
│   └── R9.0.9
│   └── R10.0.1
├── go
│   └── pkg
├── haiwen-build
Expand All @@ -83,7 +84,7 @@ If you want to build for multiple distributions and architectures via lxc contai
```shell
$ wget https://raw.githubusercontent.com/haiwen/seafile-rpi/master/build-batch.sh
$ chmod u+x build-batch.sh
$ sudo time bash ./build-batch.sh 9.0.9
$ sudo time bash ./build-batch.sh 10.0.1
```

Edit the script in order to build for your preferred distributions.
Expand Down
102 changes: 89 additions & 13 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
[[ "$1" =~ ^(--version)$ ]] && {
echo "2022-12-07";
echo "2023-05-13";
exit 0
};

Expand All @@ -22,7 +22,7 @@ PREFIX="${HOME}/opt/local"

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.9"
VERSION="10.0.1"
VERSION_SEAFILE="6.0.1" # dummy version for seafile (see configure.ac)
MYSQL_CONFIG_PATH="/usr/bin/mysql_config" # ensure compilation with mysql support

Expand All @@ -40,6 +40,7 @@ CONF_BUILD_LIBEVHTP=false
CONF_BUILD_LIBSEARPC=false
CONF_BUILD_SEAFILE=false
CONF_BUILD_SEAFILE_GO_FILESERVER=false
CONF_BUILD_SEAFILE_NOTIFICATION_SERVER=false
CONF_BUILD_SEAHUB=false
CONF_BUILD_SEAFOBJ=false
CONF_BUILD_SEAFDAV=false
Expand Down Expand Up @@ -108,12 +109,13 @@ Usage:
${TXT_BOLD}-2${OFF} Build/update libsearpc
${TXT_BOLD}-3${OFF} Build/update seafile (c_fileserver)
${TXT_BOLD}-4${OFF} Build/update seafile (go_fileserver)
${TXT_BOLD}-5${OFF} Build/update seahub
${TXT_BOLD}-6${OFF} Build/update seafobj
${TXT_BOLD}-7${OFF} Build/update seafdav
${TXT_BOLD}-8${OFF} Build/update Seafile server
${TXT_BOLD}-5${OFF} Build/update seafile (notification_server)
${TXT_BOLD}-6${OFF} Build/update seahub
${TXT_BOLD}-7${OFF} Build/update seafobj
${TXT_BOLD}-8${OFF} Build/update seafdav
${TXT_BOLD}-9${OFF} Build/update Seafile server

${TXT_BOLD}-A${OFF} All options ${TXT_BOLD}-1${OFF} to ${TXT_BOLD}-8${OFF} in one go
${TXT_BOLD}-A${OFF} All options ${TXT_BOLD}-1${OFF} to ${TXT_BOLD}-9${OFF} in one go

${TXT_BOLD}-v${OFF} ${TXT_RED}${TXT_ITALIC}<vers>${OFF} Set seafile server version to build
${TXT_LGRAY}default:${OFF} ${TXT_BLUE}${VERSION}${OFF}
Expand All @@ -132,7 +134,7 @@ Usage:
fi

# get the options
while getopts ":12345678ADTv:r:f:h:d:" OPT; do
while getopts ":123456789ADTv:r:f:h:d:" OPT; do
case $OPT in
D) CONF_INSTALL_DEPENDENCIES=true >&2
STEPS=$((STEPS+1)) >&2
Expand All @@ -159,22 +161,27 @@ while getopts ":12345678ADTv:r:f:h:d:" OPT; do
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
;;
5) CONF_BUILD_SEAHUB=true >&2
5) CONF_BUILD_SEAFILE_NOTIFICATION_SERVER=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
;;
6) CONF_BUILD_SEAFOBJ=true >&2
6) CONF_BUILD_SEAHUB=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
;;
7) CONF_BUILD_SEAFDAV=true >&2
7) CONF_BUILD_SEAFOBJ=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
;;
8) CONF_BUILD_SEAFILE_SERVER=true >&2
8) CONF_BUILD_SEAFDAV=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
;;
9) CONF_BUILD_SEAFILE_SERVER=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+1)) >&2
Expand All @@ -183,13 +190,14 @@ while getopts ":12345678ADTv:r:f:h:d:" OPT; do
CONF_BUILD_LIBSEARPC=true >&2
CONF_BUILD_SEAFILE=true >&2
CONF_BUILD_SEAFILE_GO_FILESERVER=true >&2
CONF_BUILD_SEAFILE_NOTIFICATION_SERVER=true >&2
CONF_BUILD_SEAHUB=true >&2
CONF_BUILD_SEAFOBJ=true >&2
CONF_BUILD_SEAFDAV=true >&2
CONF_BUILD_SEAFILE_SERVER=true >&2
PREP_BUILD=true >&2
COPY_PKG_SOURCE=true >&2
STEPS=$((STEPS+8)) >&2
STEPS=$((STEPS+9)) >&2
;;
v) VERSION=$OPTARG >&2
VERSION_TAG="v${VERSION}-server" >&2
Expand Down Expand Up @@ -261,6 +269,7 @@ install_dependencies()
libglib2.0-dev \
libjansson-dev \
libjpeg-dev \
libjwt-dev \
libldap2-dev \
libmariadbclient-dev-compat \
libonig-dev \
Expand Down Expand Up @@ -425,6 +434,31 @@ build_seafile_go_fileserver()
cd "${SCRIPTPATH}"
}

#
# BUILD seafile (notification_server)
#

build_seafile_notification_server()
{
STEPCOUNTER=$((STEPCOUNTER+1))
msg "-> [${STEPCOUNTER}/${STEPS}] Build seafile-server (notification_server)"

cd "${BUILDPATH}"
if [ -d "seafile-server" ]; then
cd seafile-server
(set -x; make clean && make distclean)
(set -x; git fetch origin --tags)
(set -x; git reset --hard origin/master)
else
(set -x; git clone "https://github.com/haiwen/seafile-server.git")
cd seafile-server
fi
(set -x; git reset --hard "${VERSION_TAG}")
(set -x; cd notification-server && go build .)
exitonfailure "Build seafile-server (notification_server) failed"
cd "${SCRIPTPATH}"
}

#
# INSTALL thirdparty requirements
#
Expand Down Expand Up @@ -597,6 +631,7 @@ copy_pkg_source()
"${BUILDPATH}/libsearpc/libsearpc-${LIBSEARPC_VERSION_FIXED}.tar.gz" \
"${BUILDPATH}/seafile-server/seafile-${VERSION_SEAFILE}.tar.gz" \
"${BUILDPATH}/seafile-server/fileserver/fileserver" \
"${BUILDPATH}/seafile-server/notification-server/notification-server" \
"${BUILDPATH}/seahub/seahub-${VERSION_SEAFILE}.tar.gz" \
"${BUILDPATH}/seafobj/seafobj.tar.gz" \
"${BUILDPATH}/seafdav/seafdav.tar.gz"
Expand All @@ -617,6 +652,46 @@ build_server()
cd "${BUILDPATH}"
mkmissingdir "${SCRIPTPATH}/${PKGDIR}"

# TODO: remove at seafile 10.0.2 release
msg "-> Patch build-server.py"
echo "--- build-server.py.old 2023-04-23 17:26:19.233328609 +0200
+++ build-server.py 2023-04-23 17:22:58.625726460 +0200
@@ -549,6 +549,15 @@

must_copy(src_go_fileserver, dst_bin_dir)

+# copy notification_server "notification-server" to directory seafile-server/seafile/bin
+def copy_notification_server():
+ builddir = conf[CONF_BUILDDIR]
+ srcdir = conf[CONF_SRCDIR]
+ src_notification_server = os.path.join(srcdir, 'notification-server')
+ dst_bin_dir = os.path.join(builddir, 'seafile-server', 'seafile', 'bin')
+
+ must_copy(src_notification_server, dst_bin_dir)
+
def copy_seafdav():
dst_dir = os.path.join(conf[CONF_BUILDDIR], 'seafile-server', 'seahub', 'thirdpart')
tarball = os.path.join(conf[CONF_SRCDIR], 'seafdav.tar.gz')
@@ -578,6 +587,8 @@
serverdir)
must_copy(os.path.join(scripts_srcdir, 'seafile.sh'),
serverdir)
+ must_copy(os.path.join(scripts_srcdir, 'seafile-monitor.sh'),
+ serverdir)
must_copy(os.path.join(scripts_srcdir, 'seahub.sh'),
serverdir)
must_copy(os.path.join(scripts_srcdir, 'reset-admin.sh'),
@@ -635,6 +646,9 @@
# copy go_fileserver
copy_go_fileserver()

+ # copy notification_server
+ copy_notification_server()
+
def copy_pdf2htmlex():
'''Copy pdf2htmlEX exectuable and its dependent libs'''
pdf2htmlEX_executable = find_in_path('pdf2htmlEX')" | patch -N -b -u "${BUILDPATH}/seahub/scripts/build/build-server.py"

msg "-> Executing build-server.py"
(set -x; python3 "${BUILDPATH}/seahub/scripts/build/build-server.py" \
--libsearpc_version="${LIBSEARPC_VERSION_FIXED}" \
Expand Down Expand Up @@ -658,6 +733,7 @@ ${CONF_BUILD_LIBEVHTP} && build_libevhtp
${CONF_BUILD_LIBSEARPC} && build_libsearpc
${CONF_BUILD_SEAFILE} && build_seafile
${CONF_BUILD_SEAFILE_GO_FILESERVER} && build_seafile_go_fileserver
${CONF_BUILD_SEAFILE_NOTIFICATION_SERVER} && build_seafile_notification_server
${CONF_BUILD_SEAHUB} && build_seahub
${CONF_BUILD_SEAFOBJ} && build_seafobj
${CONF_BUILD_SEAFDAV} && build_seafdav
Expand Down
10 changes: 10 additions & 0 deletions requirements/seafdav_requirements_v10.0.1.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
28 changes: 28 additions & 0 deletions requirements/seahub_requirements_v10.0.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Django==3.2.16
django-statici18n==2.3.*
django_webpack_loader==1.7.*
django_picklefield==3.1
django_formtools==2.4
django_simple_captcha==0.5.*
djangosaml2==1.5.*
djangorestframework==3.14.*
python-dateutil==2.8.*
pyjwt==2.6.*
pycryptodome==3.16.*
python-cas==1.6.*
pysaml2==7.2.*
requests==2.28.*
requests_oauthlib==1.3.*
future==0.18.*
gunicorn==20.1.*
mysqlclient==2.1.*
qrcode==7.3.*
pillow==9.3.*
chardet==5.1.*
cffi==1.15.1
captcha==0.4
openpyxl==3.0.*
Markdown==3.4.*
bleach==5.0.*
# input from @nihilistaX see https://github.com/haiwen/seafile-rpi/issues/99
cryptography~=36.0.0