Browse Source

Split pkgbuild import

Edvinas Valatka 10 years ago
parent
commit
0192e1bd18
3 changed files with 160 additions and 91 deletions
  1. 37 27
      .SRCINFO
  2. 115 64
      PKGBUILD
  3. 8 0
      libseafile.in.patch

+ 37 - 27
.SRCINFO

@@ -1,47 +1,57 @@
 # Generated by mksrcinfo v8
-# Sat Dec  5 20:43:45 UTC 2015
-pkgbase = seafile-server
-	pkgdesc = Next-generation open source cloud storage with advanced features on privacy protection and teamwork. (Server components, without seahub)
+# Thu Dec 17 03:59:44 UTC 2015
+pkgbase = seafile
+	pkgdesc = Seafile is an online file storage and collaboration tool
 	pkgver = 5.0.2
-	pkgrel = 3
+	pkgrel = 4
 	url = https://github.com/haiwen/seafile/
-	install = seafile-server.install
-	arch = i686
-	arch = x86_64
-	arch = armv6h
-	arch = armv7h
+	arch = any
 	license = GPL3
 	makedepends = vala
 	makedepends = intltool
-	depends = seafile-shared=5.0.2
-	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.10
-	depends = git
-	conflicts = django
-	conflicts = django-rest-framework,
-	conflicts = seafile
-	options = !libtool
-	options = !emptydirs
-	source = https://github.com/haiwen/seafile/archive/v5.0.2-server.tar.gz
+	makedepends = python2
+	makedepends = sqlite
+	makedepends = fuse
+	makedepends = ccnet=5.0.2
+	makedepends = libevhtp-seafile=1.2.10
+	source = seafile-5.0.2.tar.gz::https://github.com/haiwen/seafile/archive/v5.0.2-server.tar.gz
 	source = seafile-admin_virtualenv.patch
-	source = seafile-server.install
 	source = seafile-server@.service
 	source = seahub-preupgrade
 	source = create-default-conf-dir.patch
 	source = 0001-Revert-server-put-pids-folder-out-of-seafile-data.patch
+	source = libseafile.in.patch
 	sha256sums = ce34339bdad50afb9bacb3cbf854e3c33a311dfb868b2ec32a812ca78845b43f
 	sha256sums = 876e67526fabf83bfeb5ff50f05b2f4725f3d9bf784025707b67022a1a311f20
-	sha256sums = 1f25ed346ce4fef23234f62db5d25a99cf5f72ac823ec7ca09260daaf8b2eff7
 	sha256sums = ae1ed38f94304d27e4ef1ca66e15d544f99681c1e743c510c54d4a112f050421
 	sha256sums = 2a1e079cbea3543f356e6e9571f3d7d2a4b0ab75131ee417115d738ea191c4fb
 	sha256sums = 6bd632f8741b039bad961af3d6850b651e25b7e7a3018d6e2789f350ff93bb78
 	sha256sums = b1748e826d8e7cccdd825b99864b74dfb5795312f8878d63e9a87105f4382e29
+	sha256sums = a2d7f7cf0c59aba97650af62b3cefd0ceb71a1007c34d9369a88e5769c7f6076
 
 pkgname = seafile-server
+	pkgdesc = Seafile server components, without seahub
+	install = seafile-server.install
+	depends = seafile-shared=5.0.2
+	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.10
+	depends = git
+	options = !libtool
+	options = !emptydirs
+
+pkgname = seafile-client-cli
+	pkgdesc = Seafile cli client
+	depends = seafile-shared=5.0.2
+	depends = libevent
+
+pkgname = seafile-shared
+	pkgdesc = Shared components of Seafile (seafile-daemon, libseafile, python bindings, manuals)
+	depends = ccnet=5.0.2
+	depends = fuse
 

+ 115 - 64
PKGBUILD

@@ -1,77 +1,128 @@
-# Contributor: Aaron Lindsay <aaron@aclindsay.com>
 # Maintainer: Edvinas Valatka <edacval@gmail.com>
+# Contributor: Aaron Lindsay <aaron@aclindsay.com>
 
-pkgname=seafile-server
+pkgbase=seafile
+pkgname=('seafile-server' 'seafile-client-cli' 'seafile-shared')
 pkgver=5.0.2
-pkgrel=3
-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')
+pkgrel=4
+pkgdesc="Seafile is an online file storage and collaboration tool"
+arch=('any')
 url="https://github.com/haiwen/seafile/"
 license=('GPL3')
-depends=('seafile-shared=5.0.2' 'python2-mako' 'python2-dateutil' 'python2-webpy' 'python2-pip' 'python2-virtualenv' 'python2-flup' 'python2-six' 'libevhtp-seafile=1.2.10' 'git')
-makedepends=('vala' 'intltool')
-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"
-    "create-default-conf-dir.patch"
-    "0001-Revert-server-put-pids-folder-out-of-seafile-data.patch")
+makedepends=('vala' 'intltool'
+             'python2' 'sqlite' 'fuse'
+             'ccnet=5.0.2' 'libevhtp-seafile=1.2.10')
+source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/haiwen/seafile/archive/v${pkgver}-server.tar.gz"
+        "seafile-admin_virtualenv.patch"
+        "seafile-server@.service"
+        "seahub-preupgrade"
+        "create-default-conf-dir.patch"
+        "0001-Revert-server-put-pids-folder-out-of-seafile-data.patch"
+        "libseafile.in.patch")
+sha256sums=('ce34339bdad50afb9bacb3cbf854e3c33a311dfb868b2ec32a812ca78845b43f'
+            '876e67526fabf83bfeb5ff50f05b2f4725f3d9bf784025707b67022a1a311f20'
+            'ae1ed38f94304d27e4ef1ca66e15d544f99681c1e743c510c54d4a112f050421'
+            '2a1e079cbea3543f356e6e9571f3d7d2a4b0ab75131ee417115d738ea191c4fb'
+            '6bd632f8741b039bad961af3d6850b651e25b7e7a3018d6e2789f350ff93bb78'
+            'b1748e826d8e7cccdd825b99864b74dfb5795312f8878d63e9a87105f4382e29'
+            'a2d7f7cf0c59aba97650af62b3cefd0ceb71a1007c34d9369a88e5769c7f6076')
 
 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
-    patch -p1 -i ${srcdir}/create-default-conf-dir.patch
+  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"
+  patch -p1 -i "${srcdir}/create-default-conf-dir.patch"
+  patch -p1 -i "${srcdir}/libseafile.in.patch"
+
+  # Fix all script's python 2 requirement
+  grep -s -l -r '#!/usr/bin/env python' "${srcdir}/seafile-${pkgver}-server" \
+    | xargs sed -i -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|g'
 }
 
-build () {
-    cd "${srcdir}/seafile-${pkgver}-server"
-    ./autogen.sh
-    ./configure --enable-server --disable-client --disable-python --prefix=/usr PYTHON=/usr/bin/python2
-    make -j1
+build() {
+  cd "$srcdir/seafile-${pkgver}-server"
+
+  ./autogen.sh
+  ./configure \
+    --enable-client \
+    --enable-fuse \
+    --enable-python \
+    --enable-server \
+    --prefix=/usr \
+    PYTHON=/usr/bin/python2
+
+  make
 }
 
-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 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"
+package_seafile-client-cli() {
+  depends=("seafile-shared=${pkgver}" 'libevent')
+  pkgdesc="Seafile cli client"
+
+  cd "${srcdir}/seafile-${pkgver}-server"
+
+  # Install cli client
+  install -D -m755 app/seaf-cli "${pkgdir}/usr/bin/seaf-cli"
 }
 
-sha256sums=('ce34339bdad50afb9bacb3cbf854e3c33a311dfb868b2ec32a812ca78845b43f'
-            '876e67526fabf83bfeb5ff50f05b2f4725f3d9bf784025707b67022a1a311f20'
-            '1f25ed346ce4fef23234f62db5d25a99cf5f72ac823ec7ca09260daaf8b2eff7'
-            'ae1ed38f94304d27e4ef1ca66e15d544f99681c1e743c510c54d4a112f050421'
-            '2a1e079cbea3543f356e6e9571f3d7d2a4b0ab75131ee417115d738ea191c4fb'
-            '6bd632f8741b039bad961af3d6850b651e25b7e7a3018d6e2789f350ff93bb78'
-            'b1748e826d8e7cccdd825b99864b74dfb5795312f8878d63e9a87105f4382e29')
+package_seafile-shared() {
+  depends=("ccnet=5.0.2" 'fuse')
+  pkgdesc="Shared components of Seafile (seafile-daemon, libseafile, python bindings, manuals)"
+
+  cd "${srcdir}/seafile-${pkgver}-server"
+
+  make DESTDIR="${pkgdir}" install
+
+  # Remove seafile binary
+  rm -rf "${pkgdir}/usr/bin/seafile"
+  # Remove cli client binary
+  rm -rf "${pkgdir}/usr/bin/seaf-cli"
+}
+
+package_seafile-server() {
+  depends=("seafile-shared=${pkgver}"
+           'python2-mako' 'python2-dateutil' 'python2-webpy' 'python2-pip'
+           'python2-virtualenv' 'python2-flup' 'python2-six'
+           'libevhtp-seafile=1.2.10' 'git')
+  options=('!libtool' '!emptydirs')
+  install=seafile-server.install
+  pkgdesc="Seafile server components, without seahub"
+
+  # 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"
+  rm -rf "${pkgdir}/usr/share/man"
+  rm -rf "${pkgdir}/usr/bin/seaf-{daemon,fsck,migrate}"
+  rm -rf "${pkgdir}/usr/bin/seafile-{admin,controller,}"
+  rm -rf "${pkgdir}/usr/bin/seafserv-{gc}"
+
+  # Remove seafile-client-cli
+  rm -rf "${pkgdir}/usr/bin/seaf-cli"
+
+  # 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"
+
+  # 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 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"
+}

+ 8 - 0
libseafile.in.patch

@@ -0,0 +1,8 @@
+--- seafile-4.3.1/lib/libseafile.pc.in	2015-08-11 05:40:35.000000000 +0300
++++ seafile-4.3.1/lib/libseafile.pc.in.good	2015-08-18 09:45:24.761932845 +0300
+@@ -1,4 +1,4 @@
+-prefix=(DESTDIR)@prefix@
++prefix=@prefix@
+ exec_prefix=@exec_prefix@
+ libdir=@libdir@
+ includedir=@includedir@