Upstream version 6.34.115.0
[platform/framework/web/crosswalk.git] / packaging / crosswalk.spec
1 %bcond_with x
2 %bcond_with wayland
3
4 Name:           crosswalk
5 Version:        6.34.115.0
6 Release:        0
7 Summary:        Crosswalk is an app runtime based on Chromium
8 License:        (BSD-3-Clause and LGPL-2.1+)
9 Group:          Web Framework/Web Run Time
10 Url:            https://github.com/otcshare/crosswalk
11 Source:         %{name}.tar
12 Source1:        xwalk.in
13 Source2:        org.crosswalkproject.Runtime1.service
14 Source3:        xwalk.service.in
15 Source1001:     crosswalk.manifest
16 Source1002:     %{name}.xml.in
17 Source1003:     %{name}.png
18 Patch1:         %{name}-do-not-look-for-gtk2-when-using-aura.patch
19 Patch8:         %{name}-mesa-ozone-typedefs.patch
20 Patch9:         Blink-Add-GCC-flag-Wno-narrowing-fix-64bits-build.patch
21
22 BuildRequires:  bison
23 BuildRequires:  bzip2-devel
24 BuildRequires:  expat-devel
25 BuildRequires:  flex
26 BuildRequires:  gperf
27 BuildRequires:  libcap-devel
28 BuildRequires:  ninja
29 BuildRequires:  python
30 BuildRequires:  python-xml
31 BuildRequires:  perl
32 BuildRequires:  which
33 BuildRequires:  pkgconfig(alsa)
34 BuildRequires:  pkgconfig(appcore-common)
35 BuildRequires:  pkgconfig(cairo)
36 BuildRequires:  pkgconfig(capi-location-manager)
37 BuildRequires:  pkgconfig(dbus-1)
38 BuildRequires:  pkgconfig(fontconfig)
39 BuildRequires:  pkgconfig(freetype2)
40 BuildRequires:  pkgconfig(gles20)
41 BuildRequires:  pkgconfig(glib-2.0)
42 BuildRequires:  pkgconfig(haptic)
43 BuildRequires:  pkgconfig(icu-i18n)
44 BuildRequires:  pkgconfig(libdrm)
45 BuildRequires:  pkgconfig(libexif)
46 BuildRequires:  pkgconfig(libpci)
47 BuildRequires:  pkgconfig(libpulse)
48 BuildRequires:  pkgconfig(libudev)
49 BuildRequires:  pkgconfig(libxml-2.0)
50 BuildRequires:  pkgconfig(libxslt)
51 BuildRequires:  pkgconfig(pango)
52 BuildRequires:  pkgconfig(pkgmgr-info)
53 BuildRequires:  pkgconfig(pkgmgr-parser)
54 BuildRequires:  pkgconfig(nspr)
55 BuildRequires:  pkgconfig(nss)
56 BuildRequires:  pkgconfig(sensor)
57 BuildRequires:  pkgconfig(vconf)
58 %if %{with x}
59 BuildRequires:  pkgconfig(x11)
60 BuildRequires:  pkgconfig(xcomposite)
61 BuildRequires:  pkgconfig(xcursor)
62 BuildRequires:  pkgconfig(xdamage)
63 BuildRequires:  pkgconfig(xext)
64 BuildRequires:  pkgconfig(xfixes)
65 BuildRequires:  pkgconfig(xi)
66 BuildRequires:  pkgconfig(xrandr)
67 BuildRequires:  pkgconfig(xrender)
68 BuildRequires:  pkgconfig(xscrnsaver)
69 BuildRequires:  pkgconfig(xt)
70 BuildRequires:  pkgconfig(xtst)
71 %endif
72
73 %if %{with wayland}
74 BuildRequires:  pkgconfig(wayland-client)
75 BuildRequires:  pkgconfig(wayland-cursor)
76 BuildRequires:  pkgconfig(wayland-egl)
77 BuildRequires:  pkgconfig(xkbcommon)
78 %else
79 BuildRequires:  pkgconfig(scim)
80 %endif
81
82 %description
83 Crosswalk is an app runtime based on Chromium. It is an open source project started by the Intel Open Source Technology Center (http://www.01.org).
84
85 %define _manifestdir /usr/share/packages
86 %define _manifestdir_ro /opt/share/packages
87 %define _desktop_icondir /usr/share/icons/default/small
88 %define _desktop_icondir_ro /opt/share/icons/default/small
89 %define _dbusservicedir /usr/share/dbus-1/services
90 %define _systemduserservicedir /usr/lib/systemd/user
91
92 %prep
93 %setup -q -n crosswalk
94
95 cp %{SOURCE1} .
96 cp %{SOURCE3} .
97 cp %{SOURCE1001} .
98 cp %{SOURCE1002} .
99 cp %{SOURCE1003} .
100 sed "s/@VERSION@/%{version}/g" %{name}.xml.in > %{name}.xml
101 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.in > xwalk
102 sed "s|@LIB_INSTALL_DIR@|%{_libdir}|g" xwalk.service.in > xwalk.service
103
104 cp -a src/AUTHORS AUTHORS.chromium
105 cp -a src/LICENSE LICENSE.chromium
106 cp -a src/xwalk/LICENSE LICENSE.xwalk
107
108 %patch1
109
110 %if "%{tizen}" < "3.0"
111 %patch2
112 %patch3
113 %patch4
114 %patch5 -p1
115 %patch6
116 %endif
117
118 %if %{with wayland}
119 %patch8
120 %endif
121
122 %patch9
123
124 %build
125
126 # For ffmpeg on ia32. The original CFLAGS set by the gyp and config files in
127 # src/third_party/ffmpeg already pass -O2 -fomit-frame-pointer, but Tizen's
128 # CFLAGS end up appending -fno-omit-frame-pointer. See http://crbug.com/37246
129 export CFLAGS=`echo $CFLAGS | sed s,-fno-omit-frame-pointer,,g`
130
131 # Building the RPM in the GBS chroot fails with errors such as
132 #   /usr/lib/gcc/i586-tizen-linux/4.7/../../../../i586-tizen-linux/bin/ld:
133 #       failed to set dynamic section sizes: Memory exhausted
134 # For now, work around it by passing a GNU ld-specific flag that optimizes the
135 # linker for memory usage.
136 export LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
137
138 # Support building in a non-standard directory, possibly outside %{_builddir}.
139 # Since the build root is erased every time a new build is performed, one way
140 # to avoid losing the build directory is to specify a location outside the
141 # build root to the BUILDDIR_NAME definition, such as "/var/tmp/xwalk-build"
142 # (remember all paths are still inside the chroot):
143 #    gbs build --define 'BUILDDIR_NAME /some/path'
144 BUILDDIR_NAME="%{?BUILDDIR_NAME}"
145 if [ -n "${BUILDDIR_NAME}" ]; then
146    mkdir -p "${BUILDDIR_NAME}"
147    ln -s "${BUILDDIR_NAME}" src/out
148 fi
149
150 %if %{with wayland}
151 GYP_EXTRA_FLAGS="${GYP_EXTRA_FLAGS} -Duse_ozone=1"
152 %endif
153
154 # --no-parallel is added because chroot does not mount a /dev/shm, this will
155 # cause python multiprocessing.SemLock error.
156 export GYP_GENERATORS='ninja'
157 ./src/xwalk/gyp_xwalk src/xwalk/xwalk.gyp \
158 --no-parallel \
159 ${GYP_EXTRA_FLAGS} \
160 -Dchromeos=0 \
161 -Ddisable_nacl=1 \
162 -Dtizen=1 \
163 -Dpython_ver=2.7 \
164 -Duse_aura=1 \
165 -Duse_cups=0 \
166 -Duse_gconf=0 \
167 -Duse_gnome_keyring=0 \
168 -Duse_kerberos=0 \
169 -Duse_system_bzip2=1 \
170 -Duse_system_libexif=1 \
171 -Duse_system_libxml=1 \
172 -Duse_system_nspr=1 \
173 -Denable_hidpi=1
174
175 ninja %{?_smp_mflags} -C src/out/Release xwalk xwalkctl xwalk_launcher xwalk-pkg-helper
176
177 %install
178 # Binaries.
179 install -p -D xwalk %{buildroot}%{_bindir}/xwalk
180 install -p -D %{SOURCE2} %{buildroot}%{_dbusservicedir}/org.crosswalkproject.Runtime1.service
181 install -p -D xwalk.service %{buildroot}%{_systemduserservicedir}/xwalk.service
182 install -p -D src/out/Release/xwalk %{buildroot}%{_libdir}/xwalk/xwalk
183 install -p -D src/out/Release/xwalkctl %{buildroot}%{_bindir}/xwalkctl
184 install -p -D src/out/Release/xwalk-launcher %{buildroot}%{_bindir}/xwalk-launcher
185 # xwalk-pkg-helper needs to be set-user-ID-root so it can finish the installation process.
186 install -m 06755 -p -D src/out/Release/xwalk-pkg-helper %{buildroot}%{_bindir}/xwalk-pkg-helper
187
188 # Supporting libraries and resources.
189 install -p -D src/out/Release/icudtl.dat %{buildroot}%{_libdir}/xwalk/icudtl.dat
190 install -p -D src/out/Release/libffmpegsumo.so %{buildroot}%{_libdir}/xwalk/libffmpegsumo.so
191 install -p -D src/out/Release/xwalk.pak %{buildroot}%{_libdir}/xwalk/xwalk.pak
192
193 # Register xwalk to the package manager.
194 install -p -D %{name}.xml %{buildroot}%{_manifestdir}/%{name}.xml
195 install -p -D %{name}.png %{buildroot}%{_desktop_icondir}/%{name}.png
196
197 %post
198 mkdir -p %{_desktop_icondir_ro}
199 mkdir -p %{_manifestdir_ro}
200
201 %files
202 %manifest %{name}.manifest
203 %license AUTHORS.chromium LICENSE.chromium LICENSE.xwalk
204 %{_bindir}/xwalk
205 %{_bindir}/xwalkctl
206 %{_bindir}/xwalk-launcher
207 %{_bindir}/xwalk-pkg-helper
208 %{_libdir}/xwalk/icudtl.dat
209 %{_libdir}/xwalk/libffmpegsumo.so
210 %{_libdir}/xwalk/xwalk
211 %{_libdir}/xwalk/xwalk.pak
212 %{_manifestdir}/%{name}.xml
213 %{_desktop_icondir}/%{name}.png
214 %{_dbusservicedir}/org.crosswalkproject.Runtime1.service
215 %{_systemduserservicedir}/xwalk.service