summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2d958243972f9c671bbe3ab6b56a950571d425b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Maintainer: Danilo Kuehn <dk at nogo-software dot de>
# Git: https://github.com/nogo/archlinux-pkgbuild

# Uncomment, if you want tha last release
_version=2.2.4

pkgname=nextcloud-client-git
_name=${pkgname/\-git/}
pkgver=2.2.4
pkgrel=1
pkgdesc="Nextloud client for linux"
arch=('i686' 'x86_64')
url="http://nextcloud.org/"
license=('GPL2')
depends=('qtkeychain' 'qt5-webkit' 'hicolor-icon-theme' 'xdg-utils')
optdepends=(
  'python2-nautilus: integration with Nautilus'
  'nemo-python: integration with Nemo'
)
makedepends=('cmake' 'qt5-tools')
provides=('mirall' 'mirall-git' 'owncloud-client' 'nextcloud-client')
conflicts=('mirall-git' 'owncloud-client' 'owncloud-client-ngs' 'nextcloud-client' 'owncloud-client-git')
install=${_name}.install
options=(!strip)
backup=('etc/Nextcloud/sync-exclude.lst')
source=(
  "${_name}::git+https://github.com/nextcloud/client_theming.git"
  "${_name}.service"
)
sha256sums=(
  'SKIP'
  '2dc7fdad6c7577548585e977ba6d148bdb3f35c55b79d05d0043773af09d661e'
)

pkgver() {
  if [[ -z "${_version}" ]]; then
    cd ${srcdir}/${_name}
    echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
  else
    echo ${_version}
  fi
}

prepare() {
  cd ${srcdir}/${_name}
  if [[ -n "${_version}" ]]; then
    git checkout "v${_version}"
  fi
  git submodule update --init --recursive
  mkdir -p ${srcdir}/${_name}/build-linux
}

build() {
  cd ${srcdir}/${_name}/build-linux

  cmake -D OEM_THEME_DIR=${srcdir}/${_name}/nextcloudtheme \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_BUILD_TYPE="Release" \
        -DCMAKE_INSTALL_SYSCONFDIR=/etc/${_name} \
        -DWITH_DOC=FALSE \
        ../client

  #	-DQTKEYCHAIN_LIBRARY=/usr/lib/libqt5keychain.so \
#        -DQTKEYCHAIN_INCLUDE_DIR=/usr/include/qt5keychain/ \

  make
}

package() {
  cd ${srcdir}/${_name}/build-linux
  make DESTDIR=${pkgdir} install

  install -Dm644 ${srcdir}/${_name}.service ${pkgdir}/usr/lib/systemd/user/${_name}.service

  # Fix some naming issues
  if [ -f ${pkgdir}/usr/share/applications/nextcloud.desktop ]; then
    sed -Ei 's/Icon(\[.*\])?=nextcloud/Icon\1=Nextcloud/g' ${pkgdir}/usr/share/applications/nextcloud.desktop
  fi
}