Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial version of a nemo extension #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nemo-megasync_*.tar.gz
#generated files
nemo-megasync_*.dsc
nemo-megasync.spec
debian.copyright
PKGBUILD
12 changes: 12 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
nemo-megasync (1.0.29) beta; urgency=low

* First Public Beta

-- Javier Serrano <js@mega.co.nz> Thu, 27 Aug 2014 12:00:00 +0100

nemo-megasync (1.0) beta; urgency=low

* First Beta

-- Paul Ionkin <pi@mega.co.nz> Mon, 28 Apr 2014 04:25:10 +0200

1 change: 1 addition & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
28 changes: 28 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Source: nemo-megasync
Section: gnome
Priority: optional
Maintainer: MEGA Linux Team <linux@mega.co.nz>
Homepage: https://mega.nz/#sync
Build-Depends: debhelper,
libqt4-dev,
intltool,
autotools-dev,
libnemo-extension-dev (>= 2.16.0),
libgtk2.0-bin,
cdbs

Package: nemo-megasync
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
megasync
Recommends: nemo (>= 2.16.0)
Description: Easy automated syncing between your computers and your MEGA cloud drive
Secure:
Your data is encrypted end to end. Nobody can intercept it while in storage or in transit.
Flexible:
Sync any folder from your PC to any folder in the cloud. Sync any number of folders in parallel.
Fast:
Take advantage of MEGA's high-powered infrastructure and multi-connection transfers.
Generous:
Store up to 50 GB for free!
20 changes: 20 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi
20 changes: 20 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.postrm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi
12 changes: 12 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/debian.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/make -f

export DH_VERBOSE=1

vnemo = $(shell dpkg -l libnemo-extension-dev | tail -n 1 | awk '{print $$3}' | awk -F".is.|:|-" '{print $$2}' | awk -F "." '{FS=".";print $$1*10000+$$2*100+$$3}')

common-configure-impl::;
if [ 0$(vnemo) -gt 31403 ]; then for i in data/emblems/64x64/*smaller.png; do mv $$i $$(echo $$i | sed "s#-smaller##g"); done; echo "NEWER NEMO REQUIRES SMALLER OVERLAY ICONS"; else rm data/emblems/64x64/*smaller.png; echo "OLDER NEMO DOES NOT REQUIRE SMALLER OVERLAY ICONS"; fi

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/qmake.mk

47 changes: 47 additions & 0 deletions build/MEGAsync/MEGAShellExtNeno/megasync.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
post_install() {
/bin/touch --no-create $datadir/icons/hicolor &>/dev/null || :

# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi
}

post_remove() {
/bin/touch --no-create $datadir/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache $datadir/icons/hicolor &>/dev/null || :

# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi

}
78 changes: 78 additions & 0 deletions build/templates/MEGAShellExtNemo/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
##
# @file build/MEGAsync/MEGAsync/PKGBUILD
# @brief script to generate package megasync for ArchLinux
#
# (c) 2013-2016 by Mega Limited, Auckland, New Zealand
#
# This file is part of the MEGA SDK - Client Access Engine.
#
# Applications using the MEGA API must present a valid application key
# and comply with the the rules set forth in the Terms of Service.
#
# The MEGA SDK is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# @copyright Simplified (2-clause) BSD License.
#
# You should have received a copy of the license along with this
# program.
##

# Maintainer: Pablo Martin <pm@mega.nz>
pkgname=nemo-megasync
pkgver=EXT_VERSION
pkgrel=1
epoch=
pkgdesc="Easy automated syncing between your computers and your MEGA cloud drive"
arch=('i686' 'x86_64')
url=""
license=() #TODO
groups=()
depends=('ca-certificates' 'megasync>=3.5' 'nemo')
makedepends=( 'ca-certificates' 'qt4' 'nemo' 'libnemo-extension')
checkdepends=()
optdepends=()
provides=("nemo-megasync=${pkgver}")
conflicts=()
replaces=()
backup=()
options=()
install=megasync.install
changelog= #TODO
source=("./${pkgname}_$pkgver.tar.gz"
)
noextract=()
md5sums=('MD5SUM') # generated with makepkg -g
validpgpkeys=()

prepare() {
cd "$pkgname-$pkgver"
}

build() {
#export DESKTOP_DESTDIR=$pkgdir/usr
cd "$pkgname-$pkgver"
sed -i "s#update_cache.path = \$\$PWD#update_cache.path = \$\${HICOLOR}#g" MEGAShellExtNemo.pro
if [ 0$(pacman -Q nemo | awk '{print $NF}' | awk -F='-' '{print $1}' | awk -F "." '{FS=".";print $1*10000+$2*100+$3}') -gt 31503 ]; then
echo "NEWER NEMO REQUIRES SMALLER OVERLAY ICONS"
for i in data/emblems/64x64/*smaller.png; do mv $i ${i/-smaller/}; done
else
echo "OLDER NEMO DOES NOT REQUIRE SMALLER OVERLAY ICONS"
rm data/emblems/64x64/*smaller.png
fi
qmake || qmake-qt4 #qmake would fail when qt4 installed (due to some path missconfigurations)
make
}

check() {
cd "$pkgname-$pkgver"
# make -k check DESTDIR=$_bindir THE_RPM_BUILD_ROOT=$pkgdir
}

package() {
cd "$pkgname-$pkgver"
# make install
#sed -i "s#gtk-update-icon-cache -f -t /#gtk-update-icon-cache -f -t \$(INSTALL_ROOT)/#g" Makefile
make install INSTALL_ROOT=$pkgdir
}
14 changes: 14 additions & 0 deletions build/templates/MEGAShellExtNemo/nemo-megasync.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Format: 1.0
Standards-Version: 3.6.1
Source: nemo-megasync
Binary: nemo-megasync
Architecture: any
Version: EXT_VERSION
Maintainer: MEGA Linux Team <linux@mega.co.nz>
Homepage: https://mega.nz/#sync
Build-Depends: debhelper, cdbs, libqt4-dev, intltool, autotools-dev, libnemo-extension-dev (>= 2.16.0), libgtk2.0-bin, libtool-bin (>= 2.4.2-1.10) | libtool (<< 2.4.2-1.10)
Depends: megasync (>= 3.5.0)
Package-List:
nemo-megasync deb gnome optional
Files:
00000000000000000000000000000000 0 nemo-megasync_EXT_VERSION.tar.gz
142 changes: 142 additions & 0 deletions build/templates/MEGAShellExtNemo/nemo-megasync.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
Name: nemo-megasync
Version: EXT_VERSION
Release: 1%{?dist}
Summary: Easy automated syncing between your computers and your MEGA cloud drive
License: Freeware
Group: Applications/Others
Url: https://mega.nz
Source0: nemo-megasync_%{version}.tar.gz
Vendor: MEGA Limited
Packager: MEGA Linux Team <linux@mega.co.nz>

BuildRequires: qt-devel, glib2-devel, nemo-devel, gnome-common
BuildRequires: pkgconfig(libnemo-extension) >= 2.16.0
BuildRequires: hicolor-icon-theme, gnome-shell
%if 0%{?rhel_version}
BuildRequires: redhat-logos
%endif
%if 0%{?fedora_version}
BuildRequires: fedora-logos
%endif
%if 0%{?scientificlinux_version}
BuildRequires: sl-logos, gcc-c++
%endif

Requires: nemo, megasync >= 3.5

%description
Secure:
Your data is encrypted end to end. Nobody can intercept it while in storage or in transit.

Flexible:
Sync any folder from your PC to any folder in the cloud. Sync any number of folders in parallel.

Fast:
Take advantage of MEGA's high-powered infrastructure and multi-connection transfers.

Generous:
Store up to 50 GB for free!

%prep
%setup -q

%build
export DESKTOP_DESTDIR=$RPM_BUILD_ROOT/usr

%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
qmake-qt4
%else
qmake
%endif

if [ 0$(head /usr/share/doc/nemo/NEWS -n 1 | awk '{print $NF}' | awk -F':' '{print $1}' | awk -F "." '{FS=".";print $1*10000+$2*100+$3}') -gt 31503 ]; then
for i in data/emblems/64x64/*smaller.png; do mv $i ${i/-smaller/}; done
echo "NEWER NEMO REQUIRES SMALLER OVERLAY ICONS"
else
rm data/emblems/64x64/*smaller.png
echo "OLDER NEMO DOES NOT REQUIRE SMALLER OVERLAY ICONS"
fi
%if 0%{?fedora_version} >= 27
#tweak to have debug symbols to stripe: for some reason they seem gone by default in Fedora 27,
# causing "gdb-add-index: No index was created for ..." which lead to error "Empty %files file ....debugsourcefiles.list"
sed "s# gcc# gcc -g#g" -i Makefile
%endif
make

%install
make install
mkdir -p $RPM_BUILD_ROOT%{_libdir}/nemo/extensions-3.0
%{__install} libMEGAShellExtNemo.so -D $RPM_BUILD_ROOT%{_libdir}/nemo/extensions-3.0
# clean up
rm -fr $RPM_BUILD_ROOT/usr/share/icons/hicolor/icon-theme.cache || true

%post
%if 0%{?suse_version} >= 1140
%icon_theme_cache_post
%else
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%endif
# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi

%postun
%if 0%{?suse_version} >= 1140
%icon_theme_cache_postun
%else
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
%endif
# restart Nemo
UPDATENOTIFIERDIR=/var/lib/update-notifier/user.d
echo "Please restart all running instances of Nemo."

if [ -d $UPDATENOTIFIERDIR ] ; then
cat > $UPDATENOTIFIERDIR/megasync-install-notify <<DATA
Name: Nemo Restart Required
Priority: High
Terminal: False
Command: nemo -q
DontShowAfterReboot: True
ButtonText: _Restart Nemo
DisplayIf: pgrep -x nemo -U \$(id -u) > /dev/null
OnlyAdminUsers: False
Description:
MEGAsync requires Nemo to be restarted to function properly.
DATA
fi


%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif

%clean
%{?buildroot:%__rm -rf "%{buildroot}"}

%files
%defattr(-,root,root)
%{_libdir}/nemo/extensions-3.0/libMEGAShellExtNemo.so
%{_datadir}/icons/hicolor/*/*/mega-*.icon
%{_datadir}/icons/hicolor/*/*/mega-*.png

%changelog

1 change: 1 addition & 0 deletions src/MEGA.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ unix:!macx {
SUBDIRS += MEGAShellExtNautilus
SUBDIRS += MEGAShellExtThunar
SUBDIRS += MEGAShellExtDolphin
SUBDIRS += MEGAShellExtNemo
}
}

Expand Down