summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoreolianoe2017-07-03 11:43:42 +0200
committereolianoe2017-07-03 11:43:42 +0200
commit48e039442b8c5b8889233de67b092ff5738fd886 (patch)
tree406bc9e9e0c1dddc8ea88542e6eb3a62044a03b2
downloadaur-48e039442b8c5b8889233de67b092ff5738fd886.tar.gz
initial commit for seahub
-rw-r--r--.SRCINFO24
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD61
-rwxr-xr-xseahub-preupgrade26
4 files changed, 115 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b2897dd8739b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,24 @@
+# Generated by mksrcinfo v8
+# Mon Jul 3 09:43:29 UTC 2017
+pkgbase = seahub
+ pkgdesc = The web end of seafile server
+ pkgver = 6.1.1
+ pkgrel = 1
+ url = https://github.com/haiwen/seahub
+ arch = i686
+ arch = x86_64
+ arch = armv7h
+ arch = armv6h
+ arch = aarch64
+ license = Apache
+ makedepends = python2-pip
+ depends = seafile-server
+ depends = python2-virtualenv
+ options = !strip
+ source = seahub-6.1.1-server.tar.gz::https://github.com/haiwen/seahub/archive/v6.1.1-server.tar.gz
+ source = seahub-preupgrade
+ sha256sums = 988f2fea7ac3ad9e3537dcdadd96c55edf5bb6bfaee3ada42190386c9dea10bf
+ sha256sums = d3b0d33848ab9e0dbb9ea6e6e385fc4ffa82a77193af447edef7646d68e396b1
+
+pkgname = seahub
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..6d3d3c73f0cf
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+*.gz
+*.xz
+/pkg
+/src
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1ce5706566d5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,61 @@
+# Maintainer: eolianoe <eolianoe [at] gmail [DoT] com>
+# Contributor: Edvinas Valatka <edacval@gmail.com>
+# Contributor: Aaron Lindsay <aaron@aclindsay.com>
+
+pkgname=seahub
+pkgver=6.1.1
+pkgrel=1
+pkgdesc="The web end of seafile server"
+arch=('i686' 'x86_64' 'armv7h' 'armv6h' 'aarch64')
+url="https://github.com/haiwen/${pkgname}"
+license=('Apache')
+depends=("seafile-server" "python2-virtualenv")
+makedepends=('python2-pip')
+source=("${pkgname}-${pkgver}-server.tar.gz::${url}/archive/v${pkgver}-server.tar.gz"
+ "seahub-preupgrade")
+sha256sums=('988f2fea7ac3ad9e3537dcdadd96c55edf5bb6bfaee3ada42190386c9dea10bf'
+ 'd3b0d33848ab9e0dbb9ea6e6e385fc4ffa82a77193af447edef7646d68e396b1')
+# Strip is not happy on precompiled libs in virtualenv, temporary disable
+options=("!strip")
+
+prepare () {
+ cd "${srcdir}/${pkgname}-${pkgver}-server"
+
+ # Fix all script's python 2 requirement
+ grep -s -l -r '#!/usr/bin/env python\b' "${srcdir}/${pkgname}-${pkgver}-server" \
+ | xargs sed -i -e '1 s|env python\b|env python2|'
+}
+
+package() {
+ # Install seahub
+ install -dm755 "${pkgdir}/usr/share/seafile-server/seahub"
+ cp -r -p "${srcdir}/seahub-${pkgver}-server/"* \
+ "${pkgdir}/usr/share/seafile-server/seahub/"
+
+ # Install seahub preupgrade script
+ install -D -m755 "${srcdir}/seahub-preupgrade" \
+ "${pkgdir}/usr/bin/seahub-preupgrade"
+
+ # Create private virtualenv
+ virtualenv2 --system-site-packages "${pkgdir}/usr/lib/seafile/seafileenv"
+ source "${pkgdir}/usr/lib/seafile/seafileenv/bin/activate"
+ pip2 --isolated install --no-compile \
+ -r "${srcdir}/${pkgname}-${pkgver}-server/requirements.txt"
+ pip2 --isolated install --no-compile \
+ gunicorn
+ deactivate
+ virtualenv2 --relocatable "${pkgdir}/usr/lib/seafile/seafileenv"
+
+ # Recompile all .pyc files in virtualenv.
+ # Not stricly required, but useful for printing valid source file paths in case of python exceptions.
+ # One caveat: requires minimum 1GB RAM, comment next two commands in case of < 1GB RAM
+ # _gaiohttp.py excluded due to https://github.com/benoitc/gunicorn/issues/810
+ python2 -m compileall -q -f -d /usr/lib/seafile/seafileenv/bin \
+ -- "${pkgdir}/usr/lib/seafile/seafileenv/bin"
+ python2 -m compileall -q -f -d /usr/lib/seafile/seafileenv/lib/python2.7 \
+ -x '.*/gunicorn/workers/_gaiohttp.py' \
+ -- "${pkgdir}/usr/lib/seafile/seafileenv/lib/python2.7"
+
+ # Fix virtualenv paths
+ sed -i "s#${pkgdir}##" "${pkgdir}"/usr/lib/seafile/seafileenv/bin/activate*
+}
diff --git a/seahub-preupgrade b/seahub-preupgrade
new file mode 100755
index 000000000000..678d0331b17f
--- /dev/null
+++ b/seahub-preupgrade
@@ -0,0 +1,26 @@
+#!/usr/bin/env sh
+
+if [ "$(basename $(pwd))" != "seafile-server" ]; then
+ echo "Must be run from within a seafile server instance's 'seafile-server' subdirectory"
+ exit 1
+fi
+
+echo "Please ensure that the seafile server is stopped, then press [ENTER] to proceed"
+read
+
+echo "Preparing local seahub for upgrade..."
+
+# Ensure newest upgrade scripts are available
+# Symlink will not help, because upgrade scripts uses relative to self paths. So make copy, same for seahub
+rm -rf ./upgrade
+cp -r --preserve=mode,timestamps --reflink=auto /usr/share/seafile-server/scripts/upgrade ./
+
+# Backup old seahub version
+rm -rf seahub-old
+mv seahub seahub-old
+
+# Copy new seahub
+cp -r --preserve=mode,timestamps --reflink=auto /usr/share/seafile-server/seahub ./
+
+echo "Done, you should now execute the appropriate upgrade script by calling './upgrade/SCRIPT'."
+echo "More on https://wiki.archlinux.org/index.php/Seafile#Upgrading"