-
Notifications
You must be signed in to change notification settings - Fork 297
Expand file tree
/
Copy pathmegasync-debug.spec
More file actions
240 lines (207 loc) · 6.31 KB
/
megasync-debug.spec
File metadata and controls
240 lines (207 loc) · 6.31 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
Name: megasync-debug
Version: MEGASYNC_VERSION
Release: %(cat MEGA_BUILD_ID || echo "1").1
Summary: Easy automated syncing between your computers and your MEGA cloud drive
License: Freeware
Group: Applications/Others
Url: https://mega.nz
Source0: megasync-debug_%{version}.tar.gz
Vendor: MEGA Limited
Packager: MEGA Linux Team <linux@mega.co.nz>
BuildRequires: qt-devel, libqt4-devel, openssl-devel, sqlite-devel, zlib-devel, autoconf, automake, libtool, gcc-c++, libraw-devel
BuildRequires: hicolor-icon-theme, unzip, wget
%if 0%{?suse_version}
BuildRequires: libcares-devel, libcryptopp-devel
BuildRequires: update-desktop-files
BuildRequires: libqt4, libqt4-x11
%endif
%if 0%{?fedora}
BuildRequires: c-ares-devel, cryptopp-devel
BuildRequires: desktop-file-utils
BuildRequires: qt, qt-x11
BuildRequires: terminus-fonts, fontpackages-filesystem
%endif
%if 0%{?centos_version}
BuildRequires: c-ares-devel,
BuildRequires: desktop-file-utils
BuildRequires: qt, qt-x11
%endif
%if 0%{?rhel_version}
BuildRequires: desktop-file-utils
BuildRequires: qt, qt-x11
%endif
%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
./configure
export DESKTOP_DESTDIR=$RPM_BUILD_ROOT/usr
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
qmake-qt4 "CONFIG += FULLREQUIREMENTS" "CONFIG += debug" DESTDIR=%{buildroot}%{_bindir}
qmake-qt4 "CONFIG += FULLREQUIREMENTS" "CONFIG += debug" DESTDIR=%{buildroot}%{_bindir} MEGASync/MEGASync.pro
lrelease-qt4 MEGASync/MEGASync.pro
%else
qmake "CONFIG += FULLREQUIREMENTS" "CONFIG += debug" DESTDIR=%{buildroot}%{_bindir}
qmake "CONFIG += FULLREQUIREMENTS" "CONFIG += debug" DESTDIR=%{buildroot}%{_bindir} MEGASync/MEGASync.pro
lrelease MEGASync/MEGASync.pro
%endif
make
%install
make install DESTDIR=%{buildroot}%{_bindir}
#mkdir -p %{buildroot}%{_datadir}/applications
#%{__install} MEGAsync/platform/linux/data/nz.mega.MEGAsync.desktop -D %{buildroot}%{_datadir}/applications
%if 0%{?suse_version}
%suse_update_desktop_file -n -i megasync Network System
%else
desktop-file-install \
--add-category="Network" \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/nz.mega.MEGAsync.desktop
%endif
%post
%if 0%{?suse_version} >= 1140
%desktop_database_post
%icon_theme_cache_post
%else
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%endif
# install rpm key for Fedora
%if 0%{?fedora_version}
# Install new key if it's not present
rpm -q gpg-pubkey-23acd201-53da6e72 > /dev/null 2>&1
if [ "$?" -ne "0" ]; then
KEYFILE=$(mktemp /tmp/megasync.XXXXXX)
if [ -n "$KEYFILE" ]; then
cat > "$KEYFILE" <<KEY
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mI0EVj3AgQEEAO2XyJgpvE5HDRVsggcrMhf5+KpQepl7m7OyrPSgxLi72Wuy5GWp
hO64BX1UzmdUirIEOc13YxdeuhwJ3YP0wnKUyUrdWA0r2HjOz555vN6ldrPlSCBI
RxKBWRMQaR4cwNKQ8V4xV9tVdPGgrQ9L/4H3fM9fYqCwEMKBxxLZsF3PABEBAAG0
IE1lZ2FMaW1pdGVkIDxzdXBwb3J0QG1lZ2EuY28ubno+iL8EEwECACkFAlY9wIEC
GwMFCRLMAwAHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRADw606fwaOXfOS
A/998rh6f0wsrHmX2LTw2qmrWzwPj4m+vp0m3w5swPZw1x4qSNsmNsIXX8J0ZcSE
qymOwHZ0B9imBS3iz+U496NSfPNWABbIBnUAu8zq0IR28Q9pUcLe5MWFsw9NO+w2
5dByoN9JKeUftZt1x76NHn5wmxB9fv7WVlCnZJ+T16+nh7iNBFY9wIEBBADHpopM
oXNkrGZLI6Ok1F5N7+bSgiyZwkvBMAqCkPawUgwJztFKGf8F/sSbydsKRC2aQcuJ
eOj0ZPUtJ80+o3w8MsHRtZDSxDIxqqiHeupoDRI3Be9S544vI5/UmiiygTuhmNTT
NWgStoZz7hEK4IsELAG1EFodIMtBSkptDL92HwARAQABiKUEGAECAA8FAlY9wIEC
GwwFCRLMAwAACgkQA8OtOn8Gjl3HlAQAoOckF5JBJWekmlX+k2RYwtgfszk31Gq+
Jjiho4rUEW8c1EUPvK8v1jRGwjYED3ihJ6510eblYFPl+6k91OWlScnxuVVAmSn4
35RW3vR+nYUvf3s8rctbw97gJJZAA7p5oAowTux3oHotKSYhhxKcz15goMXzSb5G
/h7fJRhMnw4=
=fp/e
-----END PGP PUBLIC KEY BLOCK-----
KEY
fi
rpm --import "$KEYFILE"
fi
%endif
# Fedora 20
%if 0%{?fedora_version} == 20
YUM_FILE="/etc/yum.repos.d/megasync.repo"
cat > "$YUM_FILE" << DATA
[MEGAsync]
name=MEGAsync
baseurl=http://mega.nz/linux/MEGAsync/Fedora_20/
gpgcheck=1
enabled=1
DATA
%endif
# Fedora 19
%if 0%{?fedora_version} == 19
YUM_FILE="/etc/yum.repos.d/megasync.repo"
cat > "$YUM_FILE" << DATA
[MEGAsync]
name=MEGAsync
baseurl=http://mega.nz/linux/MEGAsync/Fedora_19
gpgcheck=1
enabled=1
DATA
%endif
# openSUSE 13.1
%if 0%{?suse_version} == 1310
if [ -d "/etc/zypp/repos.d/" ]; then
ZYPP_FILE="/etc/zypp/repos.d/megasync.repo"
cat > "$ZYPP_FILE" << DATA
[MEGAsync]
name=MEGAsync
type=rpm-md
baseurl=http://mega.nz/linux/MEGAsync/openSUSE_13.1/
gpgcheck=1
autorefresh=1
gpgkey=http://mega.nz/linux/MEGAsync/openSUSE_13.1/repodata/repomd.xml.key
enabled=1
DATA
fi
%endif
# openSUSE 12.3
%if 0%{?suse_version} == 1230
if [ -d "/etc/zypp/repos.d/" ]; then
ZYPP_FILE="/etc/zypp/repos.d/megasync.repo"
cat > "$ZYPP_FILE" << DATA
[MEGAsync]
name=MEGAsync
type=rpm-md
baseurl=http://mega.nz/linux/MEGAsync/openSUSE_12.3/
gpgcheck=1
autorefresh=1
gpgkey=http://mega.nz/linux/MEGAsync/openSUSE_12.3/repodata/repomd.xml.key
enabled=1
DATA
fi
%endif
# openSUSE 12.2
%if 0%{?suse_version} == 1220
if [ -d "/etc/zypp/repos.d/" ]; then
ZYPP_FILE="/etc/zypp/repos.d/megasync.repo"
cat > "$ZYPP_FILE" << DATA
[MEGAsync]
name=MEGAsync
type=rpm-md
baseurl=http://mega.nz/linux/MEGAsync/openSUSE_12.2/
gpgcheck=1
autorefresh=1
gpgkey=http://mega.nz/linux/MEGAsync/openSUSE_12.2/repodata/repomd.xml.key
enabled=1
DATA
fi
%endif
%postun
%if 0%{?suse_version} >= 1140
%desktop_database_postun
%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
# remove repo files
YUM_FILE="/etc/yum.repos.d/megasync.repo"
rm -f $YUM_FILE 2> /dev/null || true
ZYPP_FILE="/etc/zypp/repos.d/megasync.repo"
rm -f $ZYPP_FILE 2> /dev/null || true
# kill running MEGAsync instance
killall megasync 2> /dev/null || true
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/applications/nz.mega.MEGAsync.desktop
%{_datadir}/icons/hicolor/*/apps/mega.png
%{_datadir}/icons/hicolor/*/*/mega.png
%changelog