2947897438d253d496dbaeaec49c3cbb9f07199b
[platform/upstream/chromium-browser.git] / packaging / chromium.spec
1 %bcond_with x
2 %bcond_with wayland
3
4 Name:           chromium
5 Version:        40.0.2173.0
6 Release:        0
7 Summary:        Chromium ozone-wayland
8 License:        BSD-3-Clause
9 Group:          Applications
10 Url:            https://01.org/ozone-wayland
11 Source:         %{name}.tar
12 Source1:        chromium-browser-ia32.sh
13 Source2:        chromium-browser-x64.sh
14 Source1001:     chromium.manifest
15
16 BuildRequires:  bison
17 BuildRequires:  bzip2-devel
18 BuildRequires:  expat-devel
19 BuildRequires:  flex
20 BuildRequires:  gperf
21 BuildRequires:  libcap-devel
22 BuildRequires:  ninja
23 BuildRequires:  python
24 BuildRequires:  python-xml
25 BuildRequires:  perl
26 BuildRequires:  which
27 BuildRequires:  pkgconfig(alsa)
28 BuildRequires:  pkgconfig(aul)
29 BuildRequires:  pkgconfig(audio-session-mgr)
30 BuildRequires:  pkgconfig(cairo)
31 BuildRequires:  pkgconfig(capi-appfw-application)
32 BuildRequires:  pkgconfig(capi-location-manager)
33 BuildRequires:  pkgconfig(dbus-1)
34 BuildRequires:  pkgconfig(fontconfig)
35 BuildRequires:  pkgconfig(freetype2)
36 BuildRequires:  pkgconfig(gles20)
37 BuildRequires:  pkgconfig(glib-2.0)
38 BuildRequires:  pkgconfig(haptic)
39 BuildRequires:  pkgconfig(icu-i18n)
40 BuildRequires:  pkgconfig(libdrm)
41 BuildRequires:  pkgconfig(libexif)
42 BuildRequires:  pkgconfig(libssl)
43 BuildRequires:  pkgconfig(libpci)
44 BuildRequires:  pkgconfig(libpulse)
45 BuildRequires:  pkgconfig(libudev)
46 BuildRequires:  pkgconfig(libxml-2.0)
47 BuildRequires:  pkgconfig(libxslt)
48 BuildRequires:  pkgconfig(nss)
49 BuildRequires:  pkgconfig(pango)
50 BuildRequires:  pkgconfig(pkgmgr-info)
51 BuildRequires:  pkgconfig(pkgmgr-parser)
52 BuildRequires:  pkgconfig(nspr)
53 BuildRequires:  pkgconfig(sensor)
54 BuildRequires:  pkgconfig(vconf)
55
56 %if %{with x}
57 BuildRequires:  pkgconfig(x11)
58 BuildRequires:  pkgconfig(xcomposite)
59 BuildRequires:  pkgconfig(xcursor)
60 BuildRequires:  pkgconfig(xdamage)
61 BuildRequires:  pkgconfig(xext)
62 BuildRequires:  pkgconfig(xfixes)
63 BuildRequires:  pkgconfig(xi)
64 BuildRequires:  pkgconfig(xrandr)
65 BuildRequires:  pkgconfig(xrender)
66 BuildRequires:  pkgconfig(xscrnsaver)
67 BuildRequires:  pkgconfig(xt)
68 BuildRequires:  pkgconfig(xtst)
69 %endif
70
71 %if %{with wayland}
72 BuildRequires:  pkgconfig(wayland-client)
73 BuildRequires:  pkgconfig(wayland-cursor)
74 BuildRequires:  pkgconfig(wayland-egl)
75 BuildRequires:  pkgconfig(xkbcommon)
76 %endif
77
78 %description
79 # Ozone is a set of classes in Chromium for abstracting different window systems on Linux. It provides abstraction for the construction of accelerated surfaces underlying Aura UI framework, input devices assignment, and event handling.
80
81 %prep
82 %setup -q -n chromium
83
84 cp %{SOURCE1001} .
85
86 cp -a src/AUTHORS AUTHORS.chromium
87 cp -a src/LICENSE LICENSE.chromium
88 cp -a src/ozone/AUTHORS AUTHORS.ozone-wayland
89 cp -a src/ozone/LICENSE LICENSE.ozone-wayland
90
91 %build
92
93 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
94 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
95 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
96 export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
97
98 %ifarch %{ix86}
99 # Remove debug symbols
100 export CFLAGS=`echo $CFLAGS | sed s,-g,,g`
101 export CXXFLAGS=`echo $CXXFLAGS | sed s,-g,,g`
102 %endif
103
104 # Copied from Crosswalk
105 %ifarch %{arm}
106 export CFLAGS=`echo $CFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
107 export CXXFLAGS=`echo $CXXFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
108 export FFLAGS=`echo $FFLAGS | sed s,-mfpu=vfpv3,-mfpu=neon,g`
109 %endif
110
111 # Building the RPM in the GBS chroot fails with errors such as
112 #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
113 #       failed to set dynamic section sizes: Memory exhausted
114 # For now, work around it by passing a GNU ld-specific flag that optimizes the
115 # linker for memory usage.
116 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
117
118 # Support building in a non-standard directory, possibly outside %{_builddir}.
119 # Since the build root is erased every time a new build is performed, one way
120 # to avoid losing the build directory is to specify a location outside the
121 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/chromium-build"
122 # (remember all paths are still inside the chroot):
123 #    gbs build --define 'BUILDDIR_NAME /some/path'
124 #
125 # The --depth and --generator-output combo is used to put all the Makefiles
126 # inside the build directory, and (this is the important part) keep file lists
127 # (generatedwith <|() in gyp) in the build directory as well, otherwise they
128 # will be in the source directory, erased every time and trigger an almost full
129 # Blink rebuild (among other smaller targets).
130 # We cannot always pass those flags, though, because gyp's make generator does
131 # not work if the --generator-output is the top-level source directory.
132 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
133 if [ -z "${BUILDDIR_NAME}" ]; then
134    BUILDDIR_NAME="."
135 else
136    GYP_EXTRA_FLAGS="--depth=. --generator-output=${BUILDDIR_NAME}"
137 fi
138
139 # Change src/ so that we can pass "." to --depth below, otherwise we would need
140 # to pass "src" to it, but this confuses the gyp make generator, that expects
141 # to be called from the root source directory.
142 cd src
143
144 # --no-parallel is added because chroot does not mount a /dev/shm, this will
145 # cause python multiprocessing.SemLock error.
146 #https://github.com/01org/ozone-wayland/issues/147
147
148 export GYP_GENERATORS=ninja
149 ./build/gyp_chromium \
150 --no-parallel \
151 -Duse_ash=1 \
152 %if %{with wayland}
153 -Duse_ozone=1 \
154 -Duse_x11=0 \
155 %endif
156 %if %{with x}
157 -Duse_ozone=0 \
158 -Duse_x11=1 \
159 %endif
160 -Dchromeos=0 \
161 -Ddisable_nacl=1 \
162 -Dpython_ver=2.7 \
163 -Duse_aura=1 \
164 -Duse_cups=0 \
165 -Duse_gconf=0 \
166 -Duse_kerberos=0 \
167 -Duse_system_bzip2=1 \
168 -Duse_system_icu=0 \
169 -Duse_system_libexif=1 \
170 -Duse_system_libxml=1 \
171 -Duse_system_nspr=1 \
172 -Denable_xi21_mt=1 \
173 -Duse_xi2_mt=0 \
174 %ifarch x86_64
175 -Dtarget_arch=x64 \
176 %endif
177 %ifarch %{ix86}
178 -Dtarget_arch=ia32 \
179 %endif
180 %ifarch %{arm}
181 -Dtarget_arch=arm \
182 -Dsysroot=  \
183 %endif
184 -Duse_alsa=0 \
185 -Duse_gnome_keyring=0 \
186 -Dlogging_like_official_build=1 \
187 -Dtracing_like_official_build=1 \
188 -Drelease_unwind_tables=0 \
189 -Dlinux_dump_symbols=0 \
190 -Denable_ozone_wayland_vkb=1 \
191 -Dclang=0
192
193 ninja %{?_smp_mflags} -C out/Release chrome
194
195 %install
196 # Support building in a non-standard directory, possibly outside %{_builddir}.
197 # Since the build root is erased every time a new build is performed, one way
198 # to avoid losing the build directory is to specify a location outside the
199 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/chromium-build"
200 # (remember all paths are still inside the chroot):
201 #    gbs build --define 'BUILDDIR_NAME /some/path'
202 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
203 if [ -z "${BUILDDIR_NAME}" ]; then
204    BUILDDIR_NAME="."
205 fi
206
207 # Since BUILDDIR_NAME can be either a relative path or an absolute one, we need
208 # to cd into src/ so that it means the same thing in the build and install
209 # stages: during the former, a relative location refers to a place inside src/,
210 # whereas during the latter a relative location by default would refer to a
211 # place one directory above src/. If BUILDDIR_NAME is an absolute path, this is
212 # irrelevant anyway.
213 cd src
214
215 # Binaries.
216 %ifarch x86_64
217 install -p -D %{SOURCE2} %{buildroot}%{_bindir}/chromium-browser
218 %else
219 install -p -D %{SOURCE1} %{buildroot}%{_bindir}/chromium-browser
220 %endif
221 install -p -D ${BUILDDIR_NAME}/out/Release/chrome %{buildroot}%{_libdir}/chromium/chrome
222 cp -R ${BUILDDIR_NAME}/out/Release/locales %{buildroot}%{_libdir}/chromium/
223
224 # Workaround to avoid eu-strip error.
225 strip %{buildroot}%{_libdir}/chromium/chrome
226
227 # Supporting libraries and resources.
228 install -p -D ${BUILDDIR_NAME}/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/chromium/libffmpegsumo.so
229 strip %{buildroot}%{_libdir}/chromium/libffmpegsumo.so
230 install -p -D ${BUILDDIR_NAME}/out/Release/resources.pak %{buildroot}%{_libdir}/chromium/resources.pak
231 install -p -D ${BUILDDIR_NAME}/out/Release/chrome_100_percent.pak %{buildroot}%{_libdir}/chromium/chrome_100_percent.pak
232 install -p -D ${BUILDDIR_NAME}/out/Release/icudtl.dat %{buildroot}%{_libdir}/chromium/icudtl.dat
233
234 %files
235 %manifest %{name}.manifest
236 %license AUTHORS.chromium LICENSE.chromium AUTHORS.ozone-wayland LICENSE.ozone-wayland
237 %{_bindir}/chromium-browser
238 %{_libdir}/chromium/libffmpegsumo.so
239 %{_libdir}/chromium/chrome
240 %{_libdir}/chromium/resources.pak
241 %{_libdir}/chromium/chrome_100_percent.pak
242 %{_libdir}/chromium/icudtl.dat
243 %{_libdir}/chromium/locales/*