Debian Codegraph @

sdk/build/templates/megasdk/megasdk.spec

raw
1 Name: megasdk
2 Version: megasdk_VERSION
3 Release: %(cat MEGA_BUILD_ID || echo "1").1
4 Summary: MEGA SDK - Client Access Engine
5 License: https://github.com/meganz/megacmd/blob/master/LICENSE
6 Group: Unspecified
7 Url: https://mega.io/developers
8 Source0: megasdk_%{version}.tar.gz
9 Vendor: MEGA Limited
10 Packager: MEGA Linux Team <[email protected]>
11
12 %global __requires_exclude ^lib(avcodec|avformat|avutil|swresample|swscale)\\.so\\.
13
14 BuildRequires: autoconf, autoconf-archive, automake, libtool, gcc-c++
15 BuildRequires: hicolor-icon-theme, zip, unzip, nasm, cmake, perl
16
17 #OpenSUSE
18 %if 0%{?suse_version} || 0%{?sle_version}
19 # disabling post-build-checks that ocassionally prevent opensuse rpms from being generated
20 # plus it speeds up building process
21 #!BuildIgnore: post-build-checks
22 BuildRequires: libqt5-qtbase-devel, libqt5-linguist-devel, libqt5-qtsvg-devel, libqt5-qtx11extras-devel, libqt5-qtdeclarative-devel
23 Requires: libQt5Core5 libqt5-qtquickcontrols libqt5-qtquickcontrols2
24 BuildRequires: kernel-devel
25 %else
26 BuildRequires: python3, kernel-headers
27 %endif
28
29 %if 0%{?suse_version} && 0%{?suse_version} <= 1500
30 BuildRequires: gcc14-c++
31 %else
32 BuildRequires: gcc-c++
33 %endif
34
35 # OpenSuse Leap 15.6 -> python311
36 # OpenSuse Leap 16.0 -> python313
37 # OpenSuse Tumbleweed -> python313
38 %if 0%{?sle_version} && 0%{?suse_version} < 1600
39 BuildRequires: python311
40 %endif
41 %if (0%{?sle_version} || 0%{?is_opensuse}) && 0%{?suse_version} >= 1600
42 BuildRequires: python313
43 %endif
44
45 #Fedora specific
46 %if 0%{?fedora}
47 # allowing for rpaths (taken as invalid, as if they were not absolute paths when they are)
48 %if 0%{?fedora_version} >= 40
49 %define __brp_check_rpaths QA_RPATHS=0x0002 /usr/lib/rpm/check-rpaths
50 BuildRequires: qt5-qtbase-devel qt5-qttools-devel, qt5-qtsvg-devel, qt5-qtx11extras-devel, qt5-qtdeclarative-devel, wget2, wget2-wget
51 Requires: qt5-qtbase >= 5.15, qt5-qtsvg, qt5-qtdeclarative, qqc2-desktop-style, qt5-qtquickcontrols, qt5-qtquickcontrols2
52 %endif
53 %endif
54
55 # RHEL/CentOS/Alma/Rocky/Oracle >= 9: allow $ORIGIN
56 %if (0%{?rhel} >= 9) || (0%{?rhel_version} >= 900) || (0%{?centos_version} >= 900)
57 %define __brp_check_rpaths QA_RPATHS=$(( 0x0002|0x0008 )) /usr/lib/rpm/check-rpaths
58 %endif
59
60 #CentOS/RedHat/AlmaLinux
61 %if 0%{?centos_version} || 0%{?rhel_version}
62 BuildRequires: desktop-file-utils
63 BuildRequires: qt5-qtbase-devel qt5-qttools-devel, qt5-linguist, qt5-qtsvg-devel, qt5-qtx11extras-devel, qt5-qtdeclarative-devel
64 Requires: qt5-qtbase qt5-qtquickcontrols qt5-qtquickcontrols2 qt5-qtdeclarative
65 %endif
66
67 %description
68 This SDK brings you all the power of our client applications and let you create
69 your own or analyze the security of our products.
70
71 %prep
72 %global debug_package %{nil}
73 %setup -q
74
75 if [ -f /opt/vcpkg.tar.gz ]; then
76 export VCPKG_DEFAULT_BINARY_CACHE=/opt/persistent/vcpkg_cache
77 mkdir -p ${VCPKG_DEFAULT_BINARY_CACHE}
78 tar xzf /opt/vcpkg.tar.gz
79 vcpkg_root="-DVCPKG_ROOT=vcpkg"
80 fi
81
82 # use a custom cmake if required/available:
83 if [ -f /opt/cmake.tar.gz ]; then
84 echo "8dc99be7ba94ad6e14256b049e396b40 /opt/cmake.tar.gz" | md5sum -c -
85 tar xzf /opt/cmake.tar.gz
86 ln -s cmake-*-Linux* cmake_inst
87 export PATH="${PWD}/cmake_inst/bin:${PATH}"
88 fi
89
90 # OpenSuse Leap 15.x defaults to gcc7.
91 # Python>=10 needed for VCPKG pkgconf
92 %if 0%{?suse_version} && 0%{?suse_version} <= 1500
93 export CC=gcc-14
94 export CXX=g++-14
95 mkdir python311
96 ln -sf /usr/bin/python3.11 python311/python3
97 export PATH=$PWD/python311:$PATH
98 %endif
99
100 cmake --version
101 cmake ${vcpkg_root} -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_QT_BINDINGS=ON -DENABLE_LOG_PERFORMANCE=ON -DUSE_LIBUV=ON -S . -B %{_builddir}/build_dir
102
103 %build
104
105 if [ -f /opt/cmake.tar.gz ]; then
106 export PATH="${PWD}/cmake_inst/bin:${PATH}"
107 fi
108
109 cmake --build %{_builddir}/build_dir %{?_smp_mflags}
110
111 %install
112
113
114 if [ -f /opt/cmake.tar.gz ]; then
115 export PATH="${PWD}/cmake_inst/bin:${PATH}"
116 fi
117
118 cmake --install %{_builddir}/build_dir --prefix %{buildroot}
119 ls -l %{buildroot}
120 pwd
121
122 %post
123
124
125 %preun
126
127
128 %postun
129
130
131 %posttrans
132
133
134 %clean
135
136
137 %{?buildroot:%__rm -rf "%{buildroot}"}
138
139
140 %files
141
142
143 %defattr(-,root,root)
144
145
146 %changelog