aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7d60846b32dcacbd45f627df8e164ef5ffad6a8d (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
# Maintainer: Archimede Pitagorico <archimede.pitagorico@mail.com>

pkgname=megasync-headless
pkgver=v3.1.9.0.g4edf31a8
pkgrel=2
pkgdesc="Daemon, fuse and cli client. Sync local directory with MEGA.nz account. Original mega SDK (git)."
arch=('x86_64')
url='https://mega.co.nz/#sync'
license=('custom:MEGA')
source=('git+https://github.com/meganz/sdk.git#tag=v3.1.9'
        'megasyncd@.service'
        'megasync.conf'
        )
install=$pkgname.install
backup=('usr/lib/systemd/system/megasyncd@.service'
        'etc/conf.d/megasync.conf'
       )
conflicts=('megasync'
	   'megasync-git'
           'megatools'
           )
depends=('c-ares'
         'curl'
         'crypto++'
	 'zlib'
	 'openssl'
         )
makedepends=('git'
             )
sha1sums=('SKIP'
          'SKIP'
          'SKIP'
          )
options=('!buildflags'
        )

pkgver() {
  cd sdk
  echo "$(git describe --long --tags | tr - . | tr _ .)"
}

prepare() {
  cd sdk
  ./autogen.sh 

  ./configure \
    --without-freeimage \
    --without-sodium \
    --without-sqlite
}

build() {
    cd sdk
    make examples/megacli
    make examples/megasimplesync
}

package() {
   install -Dm644 megasyncd@.service "${pkgdir}/usr/lib/systemd/system/megasyncd@.service"
   install -Dm600 megasync.conf "${pkgdir}/etc/conf.d/megasync.conf"

   cd sdk
   make DESTDIR=${pkgdir} install
   # we do not need the include files
   rm -rf ${pkgdir}/usr/local/include 
   install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
   mkdir -p "${pkgdir}/srv/mega"
   mkdir -p "${pkgdir}/var/mega"
   chmod 0700 "${pkgdir}/var/mega"
}