Moritz Maxeiner преди 10 години
ревизия
0dc31e123f
променени са 7 файла, в които са добавени 296 реда и са изтрити 0 реда
  1. 43 0
      .SRCINFO
  2. 27 0
      0001-Revert-server-put-pids-folder-out-of-seafile-data.patch
  3. 82 0
      PKGBUILD
  4. 20 0
      seafile-admin_virtualenv.patch
  5. 82 0
      seafile-server.install
  6. 14 0
      seafile-server@.service
  7. 28 0
      seahub-preupgrade

+ 43 - 0
.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
+

+ 27 - 0
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
+
+

+ 82 - 0
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')

+ 20 - 0
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],
+     ]

+ 82 - 0
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
+}

+ 14 - 0
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

+ 28 - 0
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'."