summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsL1pKn072017-01-20 00:27:13 +0100
committersL1pKn072017-01-20 00:27:13 +0100
commit3d87ee82df3a4b2994aa682674e8b5d5a0f323b2 (patch)
tree1a43d342a667507b199a2120bb51379af02ead10
parent2d5f2db4417af284ab8f9b012a9a5fb201b4ba49 (diff)
downloadaur-3d87ee82df3a4b2994aa682674e8b5d5a0f323b2.tar.gz
Make split pkgbuild:
- MEGASync client based in FUSE - MEGASync Desktop client - MEGASync CLI client - MEGASync daemon client - Python/2 bindings - libmega (libraries and includes)
-rw-r--r--.SRCINFO84
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD199
-rw-r--r--megasync.conf12
-rw-r--r--megasyncd.service15
5 files changed, 282 insertions, 30 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5a135dcd8d17..3cae65ee671b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,52 @@
# Generated by mksrcinfo v8
-# Mon Jan 9 08:54:09 UTC 2017
+# Thu Jan 19 23:23:28 UTC 2017
pkgbase = megasync-git
- pkgdesc = Sync your files to your Mega account. Official app. (GIT Version)
+ pkgdesc = Sync your files to your Mega account. (GIT Version)
pkgver = v2.9.10.0.g2e03defa
pkgrel = 1
url = https://mega.co.nz/#sync
arch = i686
arch = x86_64
license = custom:MEGA
+ makedepends = qt5-base
+ makedepends = c-ares
+ makedepends = libuv
+ makedepends = curl
+ makedepends = crypto++
+ makedepends = libsodium
+ makedepends = hicolor-icon-theme
makedepends = git
makedepends = qt5-tools
+ makedepends = cython
+ makedepends = python
+ makedepends = cython2
+ makedepends = python2
+ makedepends = swig
+ makedepends = fuse2
+ options = !buildflags
+ source = git+https://github.com/meganz/MEGAsync.git
+ source = git+https://github.com/meganz/sdk.git
+ source = mega.svg
+ source = megasync.conf
+ source = megasyncd.service
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = c0abfeafb541509923c85d253f6f64dae8a49e9ae4b067f5c0c484ff1d924403
+ sha256sums = a3d30b3e198c3c117b2dd3144acaeb66117ee013744d2a0f39e9d4624b979a22
+ sha256sums = 73600a6d5e7ddbb6d0a3eff22aa05cc22715c2b02be7e62d16c2c71ac17a5ad5
+
+pkgname = libmega-git
+ pkgdesc = MEGASync based on FUSE (GIT Version)
+ depends = c-ares
+ depends = curl
+ depends = crypto++
+ depends = libsodium
+ depends = sqlite
+ provides = libmega
+ conflicts = libmega
+
+pkgname = megasync-git
+ pkgdesc = MEGASync Desktop App. (GIT Version)
depends = qt5-base
depends = c-ares
depends = libuv
@@ -20,12 +57,41 @@ pkgbase = megasync-git
provides = megasync
conflicts = megasync
conflicts = megatools
- source = git+https://github.com/meganz/MEGAsync.git
- source = git+https://github.com/meganz/sdk.git
- source = mega.svg
- sha256sums = SKIP
- sha256sums = SKIP
- sha256sums = c0abfeafb541509923c85d253f6f64dae8a49e9ae4b067f5c0c484ff1d924403
-pkgname = megasync-git
+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. (GIT Version)
+ depends = libmega-git
+ provides = megasync-cli
+ conflicts = megasync-cli
+ options = !emptydirs
+
+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 libs (GIT Version)
+ depends = libmega-git
+ depends = fuse2
+ provides = fuse-megasync
+ conflicts = fuse-megasync
+ options = !emptydirs
diff --git a/.gitignore b/.gitignore
index d987188fba12..246eab46c531 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,5 @@
!PKGBUILD
!megasync-git.install
!mega.svg
+!megasync.conf
+!megasyncd.service
diff --git a/PKGBUILD b/PKGBUILD
index 2fcf3affd030..260f546fa96c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,36 +1,51 @@
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
+# Contributor: Archimede Pitagorico <archimede.pitagorico@mail.com>
# Contributor: Alfonso Saavedra "Son Link" <sonlink.dourden@gmail.com>
-pkgname=megasync-git
+pkgbase=megasync-git
+pkgname=('libmega-git'
+ 'megasync-git'
+ 'megasync-daemon-git'
+ 'megasync-cli-git'
+ 'python-megasync-git'
+ 'python2-megasync-git'
+ 'fuse-megasync-git'
+ )
pkgver=v2.9.10.0.g2e03defa
pkgrel=1
-pkgdesc="Sync your files to your Mega account. Official app. (GIT Version)"
+pkgdesc="Sync your files to your Mega account. (GIT Version)"
arch=('i686' 'x86_64')
url='https://mega.co.nz/#sync'
license=('custom:MEGA')
source=('git+https://github.com/meganz/MEGAsync.git'
'git+https://github.com/meganz/sdk.git'
'mega.svg'
+ 'megasync.conf'
+ 'megasyncd.service'
)
-conflicts=('megasync'
- 'megatools'
- )
-provides=('megasync')
-depends=('qt5-base'
- 'c-ares'
- 'libuv'
- 'curl'
- 'crypto++'
- 'libsodium'
- 'hicolor-icon-theme'
- )
-makedepends=('git'
+makedepends=('qt5-base'
+ 'c-ares'
+ 'libuv'
+ 'curl'
+ 'crypto++'
+ 'libsodium'
+ 'hicolor-icon-theme'
+ 'git'
'qt5-tools'
+ 'cython'
+ 'python'
+ 'cython2'
+ 'python2'
+ 'swig'
+ 'fuse2'
)
sha256sums=('SKIP'
'SKIP'
'c0abfeafb541509923c85d253f6f64dae8a49e9ae4b067f5c0c484ff1d924403'
- )
+ 'a3d30b3e198c3c117b2dd3144acaeb66117ee013744d2a0f39e9d4624b979a22'
+ '73600a6d5e7ddbb6d0a3eff22aa05cc22715c2b02be7e62d16c2c71ac17a5ad5'
+ )
+options=('!buildflags')
pkgver() {
cd MEGAsync
@@ -38,27 +53,169 @@ pkgver() {
}
prepare() {
+ (git clone --depth 1 "file://${srcdir}/sdk" build; cd build; ./autogen.sh)
+ (git clone --depth 1 "file://${srcdir}/sdk" build-python2; cd build-python2; ./autogen.sh)
+
cd MEGAsync
- git config submodule.src/MEGASync/mega.url "${srcdir}/sdk"
+ git config submodule.src/MEGASync/mega.url "file://${srcdir}/sdk"
git submodule update --init
cd src/MEGASync/mega
./autogen.sh
- ./configure \
- --without-freeimage
}
build() {
- cd MEGAsync/src/MEGASync
+ msg2 "Build libmega and programs, include Python bindings"
+ cd "${srcdir}/build"
+ ./configure \
+ --prefix=/usr \
+ --without-freeimage \
+ --enable-python \
+ --with-python3
+
+ make
+
+ 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
+
+ msg2 "Build MEGASync"
+ cd ${srcdir}/MEGAsync/src/MEGASync/mega
+ ./configure \
+ --prefix=/usr \
+ --without-freeimage
+
+ cd ..
lrelease-qt5 MEGASync.pro
qmake-qt5 CONFIG+=release MEGASync.pro
make
}
-package() {
+package_megasync-git() {
+ pkgdesc="MEGASync Desktop App. (GIT Version)"
+ conflicts=('megasync'
+ 'megatools'
+ )
+ provides=('megasync')
+ depends=('qt5-base'
+ 'c-ares'
+ 'libuv'
+ 'curl'
+ 'crypto++'
+ 'libsodium'
+ 'hicolor-icon-theme'
+ )
+
install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm755 MEGAsync/src/MEGASync/megasync "${pkgdir}/usr/bin/megasync"
install -Dm644 MEGAsync/src/MEGASync/platform/linux/data/megasync.desktop "${pkgdir}/usr/share/applications/megasync.desktop"
sed 's|System;||g' -i "${pkgdir}/usr/share/applications/megasync.desktop"
install -Dm644 "${srcdir}/mega.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/mega.svg"
}
+
+package_libmega-git() {
+ pkgdesc="MEGASync based on FUSE (GIT Version)"
+ conflicts=('libmega')
+ provides=('libmega')
+ depends=('c-ares'
+ 'curl'
+ 'crypto++'
+ 'libsodium'
+ 'sqlite'
+ )
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-data
+ make -C build DESTDIR="${pkgdir}" install-libLTLIBRARIES
+ make -C build DESTDIR="${pkgdir}" install-pkgconfigDATA
+ make -j1 -C build DESTDIR="${pkgdir}" uninstall-pkgpythonPYTHON
+ make -j1 -C build DESTDIR="${pkgdir}" uninstall-pkgpyexecLTLIBRARIES
+ make -j1 -C build DESTDIR="${pkgdir}" uninstall-nodist_pkgpythonPYTHON
+ rm -fr "${pkgdir}/$(python -c "import os; import inspect; print(os.path.dirname(inspect.getfile(inspect)))")"
+}
+
+package_fuse-megasync-git() {
+ pkgdesc="MEGASync libs (GIT Version)"
+ conflicts=('fuse-megasync')
+ provides=('fuse-megasync')
+ depends=(libmega-git
+ 'fuse2'
+ )
+ options=('!emptydirs')
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ make -C build DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES
+ rm -fr ${pkgdir}/usr/bin/megacli
+ rm -fr ${pkgdir}/usr/bin/megasimplesync
+}
+
+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')
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ make -C build DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES
+ 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"
+}
+
+package_megasync-cli-git() {
+ pkgdesc="MEGASync CLI. (GIT Version)"
+ conflicts=('megasync-cli')
+ provides=('megasync-cli')
+ depends=('libmega-git')
+ options=('!emptydirs')
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-binPROGRAMS
+ make -C build DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES
+ rm -fr ${pkgdir}/usr/bin/megafuse
+ rm -fr ${pkgdir}/usr/bin/megasimplesync
+}
+package_python-megasync-git() {
+ pkgdesc="Python Bindings for MEGASync. (GIT Version)"
+ conflicts=('python-megasync')
+ provides=('python-megasync')
+ depends=('libmega-git'
+ 'python'
+ )
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-libLTLIBRARIES
+ make -C build DESTDIR="${pkgdir}" install-pkgpythonPYTHON
+ make -C build DESTDIR="${pkgdir}" install-pkgpyexecLTLIBRARIES
+ make -C build DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES
+}
+package_python2-megasync-git() {
+ pkgdesc="Python2 Bindings for MEGASync. (GIT Version)"
+ conflicts=('python2-megasync')
+ provides=('python2-megasync')
+ depends=('libmega-git'
+ 'python2'
+ )
+
+ install -Dm644 MEGAsync/LICENCE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ make -C build DESTDIR="${pkgdir}" install-libLTLIBRARIES
+ make -C build-python2 DESTDIR="${pkgdir}" install-pkgpythonPYTHON
+ make -C build-python2 DESTDIR="${pkgdir}" install-pkgpyexecLTLIBRARIES
+ make -C build DESTDIR="${pkgdir}" uninstall-libLTLIBRARIES
+}
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