summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO83
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD202
-rw-r--r--megasync.conf12
-rw-r--r--megasyncd.service15
5 files changed, 318 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..97cb799e4713
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,83 @@
+# Generated by mksrcinfo v8
+# Sun Mar 17 07:30:41 UTC 2019
+pkgbase = libmega-git
+ pkgdesc = Sync your files to your Mega account. (GIT Version)
+ pkgver = v3.4.8.19.g6ecca6a7
+ pkgrel = 1
+ url = https://mega.co.nz/#sync
+ arch = x86_64
+ license = custom:MEGA
+ makedepends = qt5-svg
+ makedepends = c-ares
+ makedepends = libuv
+ makedepends = crypto++
+ makedepends = libsodium
+ makedepends = git
+ makedepends = qt5-tools
+ makedepends = cython
+ makedepends = python
+ makedepends = cython2
+ makedepends = python2
+ makedepends = swig
+ makedepends = fuse2
+ makedepends = libraw
+ makedepends = ffmpeg
+ makedepends = libmediainfo
+ makedepends = libuv
+ makedepends = chrpath
+ source = git+https://github.com/meganz/sdk.git
+ source = megasync.conf
+ source = megasyncd.service
+ sha256sums = SKIP
+ sha256sums = a3d30b3e198c3c117b2dd3144acaeb66117ee013744d2a0f39e9d4624b979a22
+ sha256sums = 73600a6d5e7ddbb6d0a3eff22aa05cc22715c2b02be7e62d16c2c71ac17a5ad5
+
+pkgname = libmega-git
+ pkgdesc = MEGASync libs (GIT Version)
+ depends = c-ares
+ depends = crypto++
+ depends = libsodium
+ depends = ffmpeg
+ depends = libraw
+ depends = libuv
+ depends = libmediainfo
+ optdepends = python-megasync-git: python bindings
+ optdepends = python2-megasync-git: python2 bindings
+ provides = libmega
+ conflicts = libmega
+
+pkgname = megasync-daemon-git
+ pkgdesc = MEGASync daemon client. (GIT Version)
+ depends = libmega-git
+ provides = megasync-daemon
+ conflicts = megasync-daemon
+ options = !emptydirs
+ backup = etc/conf.d/megasync.conf
+
+pkgname = megasync-cli-git
+ pkgdesc = MEGASync CLI client. (GIT Version)
+ depends = libmega-git
+ provides = megasync-cli
+ conflicts = megasync-cli
+
+pkgname = python-megasync-git
+ pkgdesc = Python Bindings for MEGASync. (GIT Version)
+ depends = libmega-git
+ depends = python
+ provides = python-megasync
+ conflicts = python-megasync
+
+pkgname = python2-megasync-git
+ pkgdesc = Python2 Bindings for MEGASync. (GIT Version)
+ depends = libmega-git
+ depends = python2
+ provides = python2-megasync
+ conflicts = python2-megasync
+
+pkgname = fuse-megasync-git
+ pkgdesc = MEGASync client based on FUSE (GIT Version)
+ depends = libmega-git
+ depends = fuse2
+ provides = fuse-megasync
+ conflicts = fuse-megasync
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..3b6c7d2a25a8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+*
+!.gitignore
+!.SRCINFO
+!PKGBUILD
+!megasyncd.service
+!megasync.conf
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d90c90db7087
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,202 @@
+# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
+
+pkgbase=libmega-git
+pkgname=('libmega-git'
+ 'megasync-daemon-git'
+ 'megasync-cli-git'
+ 'python-megasync-git'
+ 'python2-megasync-git'
+ 'fuse-megasync-git'
+ )
+pkgver=v3.4.8.19.g6ecca6a7
+pkgrel=1
+pkgdesc="Sync your files to your Mega account. (GIT Version)"
+arch=('x86_64')
+url='https://mega.co.nz/#sync'
+license=('custom:MEGA')
+source=('git+https://github.com/meganz/sdk.git'
+ 'megasync.conf'
+ 'megasyncd.service'
+ )
+makedepends=('qt5-svg'
+ 'c-ares'
+ 'libuv'
+ 'crypto++'
+ 'libsodium'
+ 'git'
+ 'qt5-tools'
+ 'cython'
+ 'python'
+ 'cython2'
+ 'python2'
+ 'swig'
+ 'fuse2'
+ 'libraw'
+ 'ffmpeg'
+ 'libmediainfo'
+ 'libuv'
+ 'chrpath'
+ )
+sha256sums=('SKIP'
+ 'a3d30b3e198c3c117b2dd3144acaeb66117ee013744d2a0f39e9d4624b979a22'
+ '73600a6d5e7ddbb6d0a3eff22aa05cc22715c2b02be7e62d16c2c71ac17a5ad5'
+ )
+
+pkgver() {
+ cd sdk
+ echo "$(git describe --long --tags | tr - .)"
+}
+
+prepare() {
+ (git clone "${srcdir}/sdk" build; cd build; ./autogen.sh)
+ (git clone "${srcdir}/sdk" build-python; cd build-python; ./autogen.sh)
+ (git clone "${srcdir}/sdk" build-python2; cd build-python2; ./autogen.sh)
+}
+
+build() {
+ msg2 "Build libmega and programs"
+ cd "${srcdir}/build"
+ ./configure \
+ --prefix=/usr \
+ --without-freeimage
+
+ sed '/install-binPROGRAMS: install-libLTLIBRARIES/d' -i Makefile
+
+ make
+
+ msg2 "Build Python bindings"
+ cd "${srcdir}/build-python"
+ ./configure \
+ --prefix=/usr \
+ --without-freeimage \
+ --disable-examples \
+ --enable-python \
+ --with-python3
+
+ make
+
+ cd bindings/python
+ python setup.py build
+
+ msg2 "Build Python2 bindings"
+ cd "${srcdir}/build-python2"
+ PYTHON=python2 \
+ PYTHON_VERSION="$(python2 -c "import platform; print('.'.join(platform.python_version_tuple()[:2]))")" \
+ ./configure \
+ --prefix=/usr \
+ --without-freeimage \
+ --disable-examples \
+ --enable-python
+
+ make
+
+ cd bindings/python
+ python2 setup.py build
+}
+
+package_libmega-git() {
+ pkgdesc="MEGASync libs (GIT Version)"
+ conflicts=('libmega')
+ provides=('libmega')
+ depends=('c-ares'
+ 'crypto++'
+ 'libsodium'
+ 'ffmpeg'
+ 'libraw'
+ 'libuv'
+ 'libmediainfo'
+ )
+ optdepends=('python-megasync-git: python bindings'
+ 'python2-megasync-git: python2 bindings'
+ )
+ make -C build DESTDIR="${pkgdir}" install-data install-libLTLIBRARIES install-pkgconfigDATA
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_fuse-megasync-git() {
+ pkgdesc="MEGASync client based on FUSE (GIT Version)"
+ conflicts=('fuse-megasync')
+ provides=('fuse-megasync')
+ depends=(libmega-git
+ 'fuse2'
+ )
+
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ rm -fr "${pkgdir}/usr/bin/megacli"
+ rm -fr "${pkgdir}/usr/bin/megasimplesync"
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_megasync-daemon-git() {
+ pkgdesc="MEGASync daemon client. (GIT Version)"
+ conflicts=('megasync-daemon')
+ provides=('megasync-daemon')
+ depends=('libmega-git')
+ options=('!emptydirs')
+ backup=('etc/conf.d/megasync.conf')
+
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ rm -fr ${pkgdir}/usr/bin/megacli
+ rm -fr ${pkgdir}/usr/bin/megafuse
+
+ install -Dm644 "${srcdir}/megasyncd.service" "${pkgdir}/usr/lib/systemd/system/megasyncd.service"
+ install -Dm600 "${srcdir}/megasync.conf" "${pkgdir}/etc/conf.d/megasync.conf"
+ install -d "${pkgdir}/srv/mega"
+ install -dm700 "${pkgdir}/var/mega"
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_megasync-cli-git() {
+ pkgdesc="MEGASync CLI client. (GIT Version)"
+ conflicts=('megasync-cli')
+ provides=('megasync-cli')
+ depends=('libmega-git')
+
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ rm -fr ${pkgdir}/usr/bin/megafuse
+ rm -fr ${pkgdir}/usr/bin/megasimplesync
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_python-megasync-git() {
+ pkgdesc="Python Bindings for MEGASync. (GIT Version)"
+ conflicts=('python-megasync')
+ provides=('python-megasync')
+ depends=('libmega-git'
+ 'python'
+ )
+
+# make -C build-python DESTDIR="${pkgdir}" install-pkgpythonPYTHON install-pkgpyexecLTLIBRARIES install-nodist_pkgpythonPYTHON
+
+ cd build-python/bindings/python
+ python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+
+ _sites_packages="$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")"
+ rm -fr ${pkgdir}${_sites_packages}/mega/libmega.so
+ chrpath -d ${pkgdir}${_sites_packages}/mega/_mega.so
+
+ install -Dm644 "${srcdir}/MEGAsync/LICENCE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
+
+package_python2-megasync-git() {
+ pkgdesc="Python2 Bindings for MEGASync. (GIT Version)"
+ conflicts=('python2-megasync')
+ provides=('python2-megasync')
+ depends=('libmega-git'
+ 'python2')
+
+# make -C build-python2 DESTDIR="${pkgdir}" install-pkgpythonPYTHON install-pkgpyexecLTLIBRARIES install-nodist_pkgpythonPYTHON
+
+ cd build-python/bindings/python
+ python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+
+ _sites_packages="$(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")"
+ rm -fr ${pkgdir}${_sites_packages}/mega/libmega.so
+ chrpath -d ${pkgdir}${_sites_packages}/mega/_mega.so
+
+ install -Dm644 "${srcdir}/MEGAsync/LICENCE.md" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}
diff --git a/megasync.conf b/megasync.conf
new file mode 100644
index 000000000000..913d56b26213
--- /dev/null
+++ b/megasync.conf
@@ -0,0 +1,12 @@
+# The directory where MEGA temporary DB files will be created
+MEGA_WORK_DIR="/var/mega"
+
+# The local directory to keep in sync with the MEGA server
+MEGA_LOCAL_DIR="/srv/mega"
+
+# The remote directory on the MEGA server
+MEGA_REMOTE_DIR="/"
+
+# Your MEGA credentials
+MEGA_EMAIL=""
+MEGA_PWD=""
diff --git a/megasyncd.service b/megasyncd.service
new file mode 100644
index 000000000000..1631285b03ec
--- /dev/null
+++ b/megasyncd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=MEGASync client
+After=local-fs.target network.target
+
+[Service]
+Type=simple
+EnvironmentFile=/etc/conf.d/megasync.conf
+ExecStart=/usr/bin/bash -c "cd $MEGA_WORK_DIR && /usr/bin/megasimplesync $MEGA_LOCAL_DIR $MEGA_REMOTE_DIR"
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=on-failure
+RestartSec=30s
+
+[Install]
+WantedBy=multi-user.target