[Release] wrt_0.8.286
[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.286
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 multi-user mode
16 Source102:  wrt_launchpad_daemon_user.service
17 Source1001:     wrt.manifest
18 ###############################################################################
19
20 BuildRequires:  cmake
21 BuildRequires:  gettext
22 BuildRequires:  edje-tools
23 BuildRequires:  pkgconfig(ail)
24 BuildRequires:  pkgconfig(aul)
25 BuildRequires:  pkgconfig(glib-2.0)
26 BuildRequires:  pkgconfig(ewebkit2)
27 BuildRequires:  pkgconfig(appcore-efl)
28 BuildRequires:  pkgconfig(openssl)
29 BuildRequires:  pkgconfig(dpl-efl)
30 BuildRequires:  pkgconfig(libpcrecpp)
31 BuildRequires:  pkgconfig(ecore)
32 BuildRequires:  pkgconfig(eina)
33 BuildRequires:  pkgconfig(ui-gadget-1)
34 BuildRequires:  pkgconfig(utilX)
35 BuildRequires:  pkgconfig(secure-storage)
36 BuildRequires:  pkgconfig(pkgmgr)
37 BuildRequires:  pkgconfig(libiri)
38 BuildRequires:  pkgconfig(appsvc)
39 BuildRequires:  pkgconfig(cert-svc)
40 BuildRequires:  pkgconfig(cert-svc-vcore)
41 BuildRequires:  pkgconfig(libsoup-2.4)
42 BuildRequires:  pkgconfig(security-core)
43 BuildRequires:  pkgconfig(security-client)
44 BuildRequires:  pkgconfig(notification)
45 BuildRequires:  pkgconfig(libprivilege-control)
46 BuildRequires:  pkgconfig(capi-appfw-app-manager)
47 BuildRequires:  pkgconfig(capi-appfw-application)
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(wrt-plugins-ipc-message)
53 BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
54 BuildRequires:  pkgconfig(wrt-popup-ace-runner)
55 BuildRequires:  pkgconfig(sysman)
56 BuildRequires:  pkgconfig(capi-system-system-settings)
57 %if %{with mesa}
58 BuildRequires: pkgconfig(gl)
59 BuildRequires: pkgconfig(glesv2)
60 %else
61 BuildRequires: pkgconfig(gles20)
62 %endif
63 Requires(post): /sbin/ldconfig
64 Requires(postun): /sbin/ldconfig
65 BuildRequires:  pkgconfig(libsmack)
66 BuildRequires:  pkgconfig(efl-assist)
67 BuildRequires:  libss-client-devel
68 BuildRequires:  gettext
69 BuildRequires:  edje-tools
70 Requires: libss-client
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 BuildRequires:  pkgconfig(libsystemd-daemon)
82 %{?systemd_requires}
83
84 #Use these macro to avoid hard-coded path
85 #After upgrading systemd to v204 or higher macro can be deleted
86 %define _unitdir /usr/lib/systemd/system
87 ###############################################################################
88
89 %description
90 web runtime
91
92 %package devel
93 Summary:    Wrt header files for external modules
94 Group:      Development/Libraries
95 Requires:   %{name} = %{version}
96
97 %description devel
98 wrt library development headers
99
100 %prep
101 %setup -q
102 cp %{SOURCE1001} .
103
104 %define with_tests 0
105 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
106     %define with_tests 1
107 %endif
108
109 %build
110 %if 0%{?tizen_build_binary_release_type_eng}
111 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
112 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
113 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
114 %endif
115
116 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
117
118 %cmake . -DDPL_LOG="ON"       \
119          -DPROJECT_VERSION=%{version} \
120          -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
121 %if %{with mesa}
122         -DUSE_MESA=On \
123 %endif
124 %if %{with wayland}
125          -DX11_SUPPORT=Off \
126 %else
127          -DX11_SUPPORT=On \
128 %endif
129 %if %{with decrypt}
130          -DDECRYPT_SUPPORT=On \
131 %else
132          -DDECRYPT_SUPPORT=Off \
133 %endif
134 %if %{with multi_user}
135          -DMULTI_USER_SUPPORT=On \
136 %else
137          -DMULTI_USER_SUPPORT=Off \
138 %endif
139
140         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
141
142 make %{?jobs:-j%jobs}
143
144 %install
145 mkdir -p %{buildroot}/usr/share/license
146 cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
147 cat LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
148 %make_install
149
150 %if %{with multi_user}
151 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/
152 install -m 0644 %SOURCE102 %{buildroot}%{_unitdir_user}/wrt_launchpad_daemon.service
153 ln -s ../wrt_launchpad_daemon.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
154 %else
155 mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
156 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
157 ln -s %{_unitdir}/wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
158 ln -s %{_unitdir}/wrt_launchpad_daemon_1.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
159 ln -s %{_unitdir}/wrt_launchpad_daemon_2.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
160 %endif
161
162 %pre
163 if [ $1 -eq 2 ] ; then
164 %if %{with multi_user}
165     systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
166 %else
167     systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
168 %endif
169 fi
170
171 %preun
172 if [ $1 -eq 0 ] ; then
173 %if %{with multi_user}
174     systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
175 %else
176     systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
177 %endif
178 fi
179
180 %clean
181 rm -rf %{buildroot}
182
183 %post
184 /sbin/ldconfig
185 chmod +s /usr/bin/wrt-launcher
186
187 /sbin/ldconfig
188 systemctl daemon-reload
189 if [ $1 -eq 2 ] ; then
190 %if %{with multi_user}
191     systemctl --user start wrt_launchpad_daemon@app.service
192 %else
193     systemctl start wrt_launchpad_daemon@app.service
194 %endif
195 fi
196
197 %postun -p /sbin/ldconfig
198 systemctl daemon-reload
199
200 %files
201 %manifest %{name}.manifest
202 %{_libdir}/*.so
203 %{_libdir}/*.so.*
204 %attr(755,root,root) %{_bindir}/wrt-client
205 %attr(755,root,root) %{_bindir}/wrt-launcher
206 %attr(755,root,root) %{_bindir}/wrt_reset_all.sh
207 %attr(755,root,root) %{_bindir}/wrt_reset_db.sh
208 %{_datadir}/wrt-engine/*
209 %{_datadir}/license/%{name}
210 %attr(644,root,root) %{_datadir}/edje/wrt/*
211 %attr(644,root,root) %{_datadir}/edje/ace/*
212 %if %{with_tests}
213     %attr(755,root,root) %{_bindir}/wrt-tests-general
214     /opt/share/widget/tests/general/*
215 %endif
216 %attr(755,root,root) %{_sysconfdir}/profile.d/wrt_env.sh
217
218 ## wrt-launchpad-daemon #######################################################
219 %attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
220 /usr/share/aul/preload_list_wrt.txt
221 /etc/smack/accesses2.d/wrt_launchpad_daemon.rule
222 /opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
223 #systemd
224 %if %{with multi_user}
225 %{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
226 %{_unitdir_user}/wrt_launchpad_daemon.service
227 %else
228 %{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
229 %{_unitdir}/wrt_launchpad_daemon@.service
230 %{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
231 %{_unitdir}/wrt_launchpad_daemon_1.socket
232 %{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
233 %{_unitdir}/wrt_launchpad_daemon_2.socket
234 %endif
235 ###############################################################################
236
237 %files devel
238 %manifest %{name}.manifest
239 %{_includedir}/*
240 %{_libdir}/pkgconfig/*
241