Add gles dependency since wrt-client needs it when wrt-client is built with ewebkit2
[platform/framework/web/wrt.git] / packaging / wrt.spec
1 %bcond_with mesa
2 %bcond_with wayland
3 %bcond_with decrypt
4 %bcond_with multi_user
5
6 Name:       wrt
7 Summary:    Web runtime
8 Version:    0.8.198.3
9 Release:    1
10 Group:      Development/Libraries
11 License:    Apache-2.0
12 URL:        N/A
13 Source0:    %{name}-%{version}.tar.gz
14 ## wrt-launchpad-daemon #######################################################
15 ### systemd service for mono-user mode
16 Source101:  wrt_launchpad_daemon@.service
17 ### systemd service for multi-user mode
18 Source102:  wrt_launchpad_daemon_user.service
19 Source1001:     wrt.manifest
20 ###############################################################################
21
22 BuildRequires:  cmake
23 BuildRequires:  gettext
24 BuildRequires:  edje-tools
25 BuildRequires:  pkgconfig(aul)
26 BuildRequires:  pkgconfig(glib-2.0)
27 BuildRequires:  pkgconfig(ewebkit2)
28 BuildRequires:  pkgconfig(appcore-efl)
29 BuildRequires:  pkgconfig(openssl)
30 BuildRequires:  pkgconfig(cert-svc)
31 BuildRequires:  pkgconfig(dpl-efl)
32 BuildRequires:  pkgconfig(libpcrecpp)
33 BuildRequires:  pkgconfig(ecore)
34 BuildRequires:  pkgconfig(eina)
35 BuildRequires:  pkgconfig(ui-gadget-1)
36 BuildRequires:  pkgconfig(utilX)
37 BuildRequires:  pkgconfig(secure-storage)
38 BuildRequires:  pkgconfig(pkgmgr)
39 BuildRequires:  pkgconfig(libiri)
40 BuildRequires:  pkgconfig(appsvc)
41 BuildRequires:  pkgconfig(cert-svc-vcore)
42 BuildRequires:  pkgconfig(libsoup-2.4)
43 BuildRequires:  pkgconfig(security-core)
44 BuildRequires:  pkgconfig(security-client)
45 BuildRequires:  pkgconfig(notification)
46 BuildRequires:  pkgconfig(libprivilege-control)
47 BuildRequires:  pkgconfig(capi-appfw-app-manager)
48 BuildRequires:  pkgconfig(haptic)
49 BuildRequires:  pkgconfig(capi-web-url-download)
50 BuildRequires:  pkgconfig(wrt-plugin-loading)
51 BuildRequires:  pkgconfig(wrt-plugin-js-overlay)
52 BuildRequires:  pkgconfig(dpl-encryption)
53 BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
54 BuildRequires:  pkgconfig(wrt-popup-ace-runner)
55 BuildRequires:  pkgconfig(sysman)
56 BuildRequires:  pkgconfig(app2sd)
57 BuildRequires:  pkgconfig(capi-system-system-settings)
58 %if %{with decrypt}
59 BuildRequires:  pkgconfig(osp-appfw)
60 BuildRequires:  osp-appfw-internal-devel
61 Requires: osp-appfw
62 %endif
63 %if %{with mesa}
64 BuildRequires: pkgconfig(gl)
65 BuildRequires: pkgconfig(glesv2)
66 %else
67 BuildRequires: pkgconfig(gles20)
68 %endif
69 Requires(post): /sbin/ldconfig
70 Requires(postun): /sbin/ldconfig
71
72 ## wrt-launchpad-daemon #######################################################
73 BuildRequires:  pkgconfig(app-checker)
74 BuildRequires:  pkgconfig(bundle)
75 BuildRequires:  pkgconfig(dlog)
76 BuildRequires:  pkgconfig(dbus-glib-1)
77 BuildRequires:  pkgconfig(libsmack)
78 BuildRequires:  pkgconfig(sqlite3)
79 BuildRequires:  pkgconfig(x11)
80 BuildRequires:  pkgconfig(aul)
81 ###############################################################################
82
83 %description
84 web runtime
85
86 %package devel
87 Summary:    Wrt header files for external modules
88 Group:      Development/Libraries
89 Requires:   %{name} = %{version}
90
91 %description devel
92 wrt library development headers
93
94 %prep
95 %setup -q
96 cp %{SOURCE1001} .
97
98 %define with_tests 0
99 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
100     %define with_tests 1
101 %endif
102
103 %build
104 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
105
106 %cmake . -DDPL_LOG="ON"       \
107          -DPROJECT_VERSION=%{version} \
108          -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
109 %if %{with mesa}
110         -DUSE_MESA=On \
111 %endif
112 %if %{with wayland}
113          -DX11_SUPPORT=Off \
114 %else
115          -DX11_SUPPORT=On \
116 %endif
117 %if %{with decrypt}
118          -DDECRYPT_SUPPORT=On \
119 %else
120          -DDECRYPT_SUPPORT=Off \
121 %endif
122 %if %{with multi_user}
123          -DMULTI_USER_SUPPORT=On \
124 %else
125          -DMULTI_USER_SUPPORT=Off \
126 %endif
127
128         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
129
130 make %{?jobs:-j%jobs}
131
132 %install
133 mkdir -p %{buildroot}/usr/share/license
134 cp LICENSE %{buildroot}/usr/share/license/%{name}
135 %make_install
136
137 ## wrt-launchpad-daemon #######################################################
138 mkdir -p %{buildroot}/etc/init.d
139 install -m 755 src/wrt-launchpad-daemon/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/init.d
140
141 mkdir -p %{buildroot}/etc/rc.d/rc3.d
142 mkdir -p %{buildroot}/etc/rc.d/rc4.d
143 ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
144 ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
145
146 #systemd
147
148 %if %{with multi_user}
149 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/
150 install -m 0644 %SOURCE102 %{buildroot}%{_unitdir_user}/wrt_launchpad_daemon.service
151 ln -s ../wrt_launchpad_daemon.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
152 %else
153 mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
154 install -m 0644 %SOURCE101 %{buildroot}%{_unitdir}/wrt_launchpad_daemon@.service
155 ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
156 %endif
157
158 %preun
159 if [ $1 == 0 ]; then
160 %if %{with multi_user}
161         systemctl --user stop wrt_launchpad_daemon.service
162 %else
163         systemctl stop wrt_launchpad_daemon@app.service
164 %endif
165
166 fi
167
168
169
170
171 ###############################################################################
172
173
174
175
176 %clean
177 rm -rf %{buildroot}
178
179 %post
180 /sbin/ldconfig
181 chmod +s /usr/bin/wrt-launcher
182
183 ## wrt-launchpad-daemon #######################################################
184 #systemd
185 /sbin/ldconfig
186 systemctl daemon-reload
187 if [ $1 == 1 ]; then
188 %if %{with multi_user}
189     systemctl --user restart wrt_launchpad_daemon.service
190 %else
191     systemctl restart wrt_launchpad_daemon@app.service
192 %endif
193
194
195 fi
196 ###############################################################################
197
198 echo "[WRT] wrt postinst done ..."
199
200 ## wrt-launchpad-daemon #######################################################
201 #systemd
202 %postun -p /sbin/ldconfig
203 systemctl daemon-reload
204 ###############################################################################
205
206 %files
207 %manifest %{name}.manifest
208 %{_libdir}/*.so
209 %{_libdir}/*.so.*
210 %attr(755,root,root) %{_bindir}/wrt-client
211 %attr(755,root,root) %{_bindir}/wrt-launcher
212 %attr(755,root,root) %{_bindir}/wrt_reset_all.sh
213 %attr(755,root,root) %{_bindir}/wrt_reset_db.sh
214 %{_datadir}/locale/*
215 %{_datadir}/wrt-engine/*
216 %{_datadir}/license/%{name}
217 %attr(644,root,root) %{_datadir}/edje/wrt/*
218 %attr(644,root,root) %{_datadir}/edje/ace/*
219 %attr(644,root,root) /usr/etc/wrt/*
220 %if %{with_tests}
221     %attr(755,root,root) %{_bindir}/wrt-tests-general
222     /opt/share/widget/tests/general/*
223 %endif
224 %attr(755,root,root) %{_sysconfdir}/profile.d/wrt_env.sh
225
226 ## wrt-launchpad-daemon #######################################################
227 %attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
228 /usr/share/aul/preload_list_wrt.txt
229 %{_sysconfdir}/init.d/wrt_launchpad_run.sh
230 %attr(0755,root,root) %{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
231 %attr(0755,root,root) %{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
232 /etc/smack/accesses2.d/wrt_launchpad_daemon.rule
233 /opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
234 #systemd
235 %if %{with multi_user}
236 %{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
237 %{_unitdir_user}/wrt_launchpad_daemon.service
238 %else
239 %{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
240 %{_unitdir}/wrt_launchpad_daemon@.service
241 %endif
242
243 ###############################################################################
244
245 %files devel
246 %manifest %{name}.manifest
247 %{_includedir}/*
248 %{_libdir}/pkgconfig/*
249