# Maintainer: Klemens Schölhorn <klemens@schoelhorn.eu>

pkgname=python-seafdav
pkgver=10.0.0
pkgrel=38
pkgdesc="Seafile webdav server"
arch=('any')
url="https://github.com/haiwen/seafdav"
license=('MIT')
depends=(python
         seafile-server
         python-seafobj
         python-defusedxml
         python-six
         python-jinja
         python-json5
         python-yaml
         python-jsmin
         python-sqlalchemy)
makedepends=('python-setuptools')
source=("https://github.com/haiwen/seafdav/archive/v${pkgver}-server.tar.gz"
        0001-Log-gunicorn-output.patch)
sha256sums=('127d5a8aff3e2dfc97c00c7bce7823f6596d6b8404f434e0eb2e1cde188b2543'
            'e6fea78d591265fda8997d5c22a8c6b6341479fd254f9f6fac7b49abf7eea730')

prepare() {
  cd seafdav-$pkgver-server

  patch -Np1 < ../0001-Log-gunicorn-output.patch
}

package() {
  cd seafdav-$pkgver-server
  python ./setup.py install --root="$pkgdir/" --optimize=1 \
         --install-lib "usr/share/seafile-server/seahub/thirdpart" \
         --install-scripts "usr/share/seafile-server/seahub/bin"

  install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
