diff options
author | Moritz Maxeiner | 2015-06-12 11:14:42 +0200 |
---|---|---|
committer | Moritz Maxeiner | 2015-06-12 11:14:42 +0200 |
commit | 0dc31e123ff8c441feba1894cc6e57f67907c653 (patch) | |
tree | e91e0783d0154bc2ced40a21f07060bcef940116 | |
download | aur-0dc31e123ff8c441feba1894cc6e57f67907c653.tar.gz |
Initial import: 4.2.2
-rw-r--r-- | .SRCINFO | 43 | ||||
-rw-r--r-- | 0001-Revert-server-put-pids-folder-out-of-seafile-data.patch | 27 | ||||
-rw-r--r-- | PKGBUILD | 82 | ||||
-rw-r--r-- | seafile-admin_virtualenv.patch | 20 | ||||
-rwxr-xr-x | seafile-server.install | 82 | ||||
-rw-r--r-- | seafile-server@.service | 14 | ||||
-rwxr-xr-x | seahub-preupgrade | 28 |
7 files changed, 296 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..86ee0dba2261 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,43 @@ +pkgbase = seafile-server + pkgdesc = Next-generation open source cloud storage with advanced features on privacy protection and teamwork. (Server components, without seahub) + pkgver = 4.2.2 + pkgrel = 1 + url = https://github.com/haiwen/seafile/ + install = seafile-server.install + arch = i686 + arch = x86_64 + arch = armv6h + arch = armv7h + license = GPL3 + makedepends = vala + makedepends = intltool + depends = seafile-shared>=4.2.4 + depends = python2-mako + depends = python2-dateutil + depends = python2-webpy + depends = python2-pip + depends = python2-virtualenv + depends = python2-flup + depends = python2-six + depends = libevhtp-seafile<=1.2.9 + depends = fuse + conflicts = django + conflicts = django-rest-framework, + conflicts = seafile + options = !libtool + options = !emptydirs + source = https://github.com/haiwen/seafile/archive/v4.2.2-server.tar.gz + source = seafile-admin_virtualenv.patch + source = seafile-server.install + source = seafile-server@.service + source = seahub-preupgrade + source = 0001-Revert-server-put-pids-folder-out-of-seafile-data.patch + sha256sums = 8c131d5fb9f42023aca851fc1d32c4ef774063c3bc751860b88c68a2daceb295 + sha256sums = 4127284c1d8a4d071925cbcc870ca460fd736e2d53e8ab5806ccf3dd03d5e537 + sha256sums = 315e753e8f5dc41cc88a0b65c7db68c097d67674c8b466319486da6a749f541f + sha256sums = 943ed1bb7d4908b452ce8b7abff26e56f3f24582f6a2cf6e0dc4bf2bffd0a6d8 + sha256sums = 6a04e89eee4030d06d79f21912c7aa531dfc7beb5d3f51b66ec2bd62f95401ec + sha256sums = b1748e826d8e7cccdd825b99864b74dfb5795312f8878d63e9a87105f4382e29 + +pkgname = seafile-server + diff --git a/0001-Revert-server-put-pids-folder-out-of-seafile-data.patch b/0001-Revert-server-put-pids-folder-out-of-seafile-data.patch new file mode 100644 index 000000000000..da417f87ae96 --- /dev/null +++ b/0001-Revert-server-put-pids-folder-out-of-seafile-data.patch @@ -0,0 +1,27 @@ +From a241e334aa22e66b0469a3899d73db7df4b6e274 Mon Sep 17 00:00:00 2001 +From: Moritz Maxeiner <moritz@ucworks.org> +Date: Mon, 28 Apr 2014 04:42:11 +0200 +Subject: [PATCH] Revert "[server] put pids/ folder out of seafile-data/" + +This reverts commit 54926205490f9efcd16d22c4bc178576d50449ef. +--- + controller/seafile-controller.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/controller/seafile-controller.c b/controller/seafile-controller.c +index c5bc425..a1a9358 100644 +--- a/controller/seafile-controller.c ++++ b/controller/seafile-controller.c +@@ -611,7 +611,7 @@ stop_ccnet_server () + static void + init_pidfile_path (SeafileController *ctl) + { +- char *pid_dir = g_build_filename (topdir, "pids", NULL); ++ char *pid_dir = g_build_filename (ctl->seafile_dir, "pids", NULL); + if (!g_file_test(pid_dir, G_FILE_TEST_EXISTS)) { + if (g_mkdir(pid_dir, 0777) < 0) { + seaf_warning("failed to create pid dir %s: %s", pid_dir, strerror(errno)); +-- +1.9.2 + + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..f0b5dd7d7923 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,82 @@ +# Maintainer: Moritz Maxeiner <moritz@ucworks.org> + +# Contributor: Aaron Lindsay <aaron@aclindsay.com> + +pkgname=seafile-server +pkgver=4.2.2 +pkgrel=1 +pkgdesc="Next-generation open source cloud storage with advanced features on privacy protection and teamwork. (Server components, without seahub)" +arch=('i686' 'x86_64' 'armv6h' 'armv7h') +url="https://github.com/haiwen/seafile/" +license=('GPL3') +depends=('seafile-shared>=4.2.4' 'python2-mako' 'python2-dateutil' 'python2-webpy' 'python2-pip' 'python2-virtualenv' 'python2-flup' 'python2-six' 'libevhtp-seafile<=1.2.9' 'fuse') +makedepends=('vala' 'intltool') +optdepends=() +provides=() +conflicts=('django' 'django-rest-framework', 'seafile') +options=('!libtool' '!emptydirs') +install=seafile-server.install +source=("https://github.com/haiwen/seafile/archive/v${pkgver}-server.tar.gz" + "seafile-admin_virtualenv.patch" + "seafile-server.install" + "seafile-server@.service" + "seahub-preupgrade" + "0001-Revert-server-put-pids-folder-out-of-seafile-data.patch") + +prepare () +{ + cd "${srcdir}/seafile-${pkgver}-server" + patch -p1 -i ${srcdir}/seafile-admin_virtualenv.patch + patch -p1 -i ${srcdir}/0001-Revert-server-put-pids-folder-out-of-seafile-data.patch +} + +build () +{ + cd "${srcdir}/seafile-${pkgver}-server" + ./autogen.sh + ./configure --enable-server --disable-client --disable-python --prefix=/usr PYTHON=/usr/bin/python2 + make -j1 +} + +package () +{ + # Install library and header files + cd "${srcdir}/seafile-${pkgver}-server" + make DESTDIR="${pkgdir}/" install + + # Remove files already installed by seafile-shared + # to maintain compatibility + rm -rf "${pkgdir}/usr/lib" + rm -rf "${pkgdir}/usr/include" + + # Install all scripts + mkdir -p "${pkgdir}/usr/share/$pkgname" + cp -r -p "${srcdir}/seafile-${pkgver}-server/scripts" "${pkgdir}/usr/share/$pkgname/scripts" + # Remove win32-specific scripts + rm -rf "${pkgdir}/usr/share/$pkgname/scripts/upgrade/win32" + # Fix all script's python 2 requirement + egrep -s -l -r '#!/usr/bin/env python' "${pkgdir}" | xargs sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|g' + # Fix upgrade script's invald use of $INSTALLPATH to find seafile binaries + sed -i 's|${INSTALLPATH}/seafile/bin|/usr/bin|g' "${pkgdir}/usr/share/seafile-server/scripts/upgrade/upgrade_2.2_3.0.sh" + + # Workaround for strange behaviour in the Makefile, which + # installs python bindings in the package root directory, + # even though they were disabled + rm -rf "${pkgdir}/seaserv" + rm -rf "${pkgdir}/seafile" + + # Install license + install -D -m644 "${srcdir}/seafile-${pkgver}-server/LICENSE.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt" + + # Install systemd service + install -D -m644 "${srcdir}/seafile-server@.service" "${pkgdir}/usr/lib/systemd/system/seafile-server@.service" + + # Install seahub preupgrade script + install -D -m755 "${srcdir}/seahub-preupgrade" "${pkgdir}/usr/bin/seahub-preupgrade" +} +sha256sums=('8c131d5fb9f42023aca851fc1d32c4ef774063c3bc751860b88c68a2daceb295' + '4127284c1d8a4d071925cbcc870ca460fd736e2d53e8ab5806ccf3dd03d5e537' + '315e753e8f5dc41cc88a0b65c7db68c097d67674c8b466319486da6a749f541f' + '943ed1bb7d4908b452ce8b7abff26e56f3f24582f6a2cf6e0dc4bf2bffd0a6d8' + '6a04e89eee4030d06d79f21912c7aa531dfc7beb5d3f51b66ec2bd62f95401ec' + 'b1748e826d8e7cccdd825b99864b74dfb5795312f8878d63e9a87105f4382e29') diff --git a/seafile-admin_virtualenv.patch b/seafile-admin_virtualenv.patch new file mode 100644 index 000000000000..a3e220103f9b --- /dev/null +++ b/seafile-admin_virtualenv.patch @@ -0,0 +1,20 @@ +diff --git a/tools/seafile-admin b/tools/seafile-admin +index 102cf9f..ce77c35 100755 +--- a/tools/seafile-admin ++++ b/tools/seafile-admin +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/lib/seafile/seafileenv/bin/python2 + # coding: UTF-8 + + '''This is the helper script to setup/manage your seafile server +@@ -604,7 +604,8 @@ def start_controller(): + + def start_seahub_gunicorn(): + argv = [ +- 'gunicorn_django', ++ PYTHON, ++ '/usr/lib/seafile/seafileenv/bin/gunicorn_django', + '-c', conf[CONF_SEAHUB_CONF], + '-b', '0.0.0.0:%s' % conf[CONF_SEAHUB_PORT], + ] diff --git a/seafile-server.install b/seafile-server.install new file mode 100755 index 000000000000..9855216dec96 --- /dev/null +++ b/seafile-server.install @@ -0,0 +1,82 @@ +## arg 1: the new package version +pre_install() { + virtualenv2 --system-site-packages /usr/lib/seafile/seafileenv + virtualenv2 --relocatable /usr/lib/seafile/seafileenv + source /usr/lib/seafile/seafileenv/bin/activate + + pip install pip + + # Dependencies as per + # http://manual.seafile.com/build_seafile/server.html + pip install "django==1.5.2" + pip install "Djblets==0.6.14" --no-deps --allow-external Djblets --allow-unverified Djblets + # sqlite3 module should be included in python distribution + pip install simplejson + # Pillow as replacement for PIL + pip install Pillow + pip install chardet + pip install "gunicorn==18" + pip install "django-compressor==1.4" + pip install "django-statici18n==1.1.2" + pip install six + pip install python-dateutil + + # Additional dependencies + pip install django-pipeline + + deactivate +} + +#pacman complains if these functions don't exist, so we might as well +#appease it. + +## arg 1: the new package version +post_install() { + echo " " > /dev/null +} + +## arg 1: the new package version +## arg 2: the old package version +pre_upgrade() { + virtualenv2 --system-site-packages /usr/lib/seafile/seafileenv + virtualenv2 --relocatable /usr/lib/seafile/seafileenv + source /usr/lib/seafile/seafileenv/bin/activate + + pip install --upgrade pip + + # Dependencies as per + # http://manual.seafile.com/build_seafile/server.html + pip install --upgrade "django==1.5.2" + pip install --upgrade "Djblets==0.6.14" --no-deps --allow-external Djblets --allow-unverified Djblets + # sqlite3 module should be included in python distribution + pip install --upgrade simplejson + # Pillow as replacement for PIL + pip install --upgrade Pillow + pip install --upgrade chardet + pip install --upgrade "gunicorn==18" + pip install "django-compressor==1.4" + pip install "django-statici18n==1.1.2" + pip install --upgrade six + pip install --upgrade python-dateutil + + # Additional dependencies + pip install --upgrade django-pipeline + + deactivate +} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + echo " " > /dev/null +} + +## arg 1: the old package version +pre_remove() { + echo " " > /dev/null +} + +## arg 1: the old package version +post_remove() { + rm -rf /usr/lib/seafile/seafileenv +} diff --git a/seafile-server@.service b/seafile-server@.service new file mode 100644 index 000000000000..22909b846abb --- /dev/null +++ b/seafile-server@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Next-generation open source cloud storage with advanced features on privacy protection and teamwork. +After=syslog.target network.target + +[Service] +Type=forking +User=seafile +WorkingDirectory=%h/%i +ExecStart=/usr/bin/seafile-admin start --fastcgi +ExecStop=/usr/bin/seafile-admin stop +PIDFile=%h/%i/seafile-data/pids/seaf-server.pid + +[Install] +WantedBy=multi-user.target diff --git a/seahub-preupgrade b/seahub-preupgrade new file mode 100755 index 000000000000..7f02e3a8e4e5 --- /dev/null +++ b/seahub-preupgrade @@ -0,0 +1,28 @@ +#!/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 + +SEAFILE_VERSION="$(pacman -Qi seafile-server | grep Version | sed 's|[^\n]*: \(.*\)-.*|\1|g')" + +echo "Preparing local seahub for upgrade..." + +# Ensure newest upgrade scripts are available +rm -rf ./upgrade +cp -a /usr/share/seafile-server/scripts/upgrade ./ + +# Ready old seahub version +rm -rf seahub-old +mv seahub seahub-old + +# Ready new seahub version +curl -fLC - --retry 3 --retry-delay 3 -O "https://github.com/haiwen/seahub/archive/v${SEAFILE_VERSION}-server.tar.gz" +tar -xzf v${SEAFILE_VERSION}-server.tar.gz +mv "seahub-${SEAFILE_VERSION}-server" seahub + +echo "Done, you should now execute the appropriate upgrade script by calling './upgrade/SCRIPT'." |