fix: use EINA_* booleans instread of TRUE/FALSE
[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.288
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 BuildRequires:  pkgconfig(app2sd)
58 %if %{with mesa}
59 BuildRequires: pkgconfig(gl)
60 BuildRequires: pkgconfig(glesv2)
61 %else
62 BuildRequires: pkgconfig(gles20)
63 %endif
64 Requires(post): /sbin/ldconfig
65 Requires(postun): /sbin/ldconfig
66 BuildRequires:  pkgconfig(libsmack)
67 BuildRequires:  pkgconfig(efl-assist)
68 BuildRequires:  pkgconfig(pkgmgr-info)
69 BuildRequires:  libss-client-devel
70 BuildRequires:  gettext
71 BuildRequires:  edje-tools
72 Requires: libss-client
73
74 ## wrt-launchpad-daemon #######################################################
75 BuildRequires:  pkgconfig(app-checker)
76 BuildRequires:  pkgconfig(bundle)
77 BuildRequires:  pkgconfig(dlog)
78 BuildRequires:  pkgconfig(dbus-glib-1)
79 BuildRequires:  pkgconfig(libsmack)
80 BuildRequires:  pkgconfig(sqlite3)
81 BuildRequires:  pkgconfig(x11)
82 BuildRequires:  pkgconfig(aul)
83 BuildRequires:  pkgconfig(libsystemd-daemon)
84 %{?systemd_requires}
85
86 #Use these macro to avoid hard-coded path
87 #After upgrading systemd to v204 or higher macro can be deleted
88 %define _unitdir /usr/lib/systemd/system
89 ###############################################################################
90
91 %description
92 web runtime
93
94 %package devel
95 Summary:    Wrt header files for external modules
96 Group:      Development/Libraries
97 Requires:   %{name} = %{version}
98
99 %description devel
100 wrt library development headers
101
102 %prep
103 %setup -q
104 cp %{SOURCE1001} .
105
106 %define with_tests 0
107 %if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
108     %define with_tests 1
109 %endif
110
111 %build
112 %if 0%{?tizen_build_binary_release_type_eng}
113 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
114 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
115 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
116 %endif
117
118 export LDFLAGS+="-Wl,--rpath=%{_libdir}"
119
120 %cmake . -DDPL_LOG="ON"       \
121          -DPROJECT_VERSION=%{version} \
122          -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
123 %if %{with mesa}
124         -DUSE_MESA=On \
125 %endif
126 %if %{with wayland}
127          -DX11_SUPPORT=Off \
128 %else
129          -DX11_SUPPORT=On \
130 %endif
131 %if %{with decrypt}
132          -DDECRYPT_SUPPORT=On \
133 %else
134          -DDECRYPT_SUPPORT=Off \
135 %endif
136 %if %{with multi_user}
137          -DMULTI_USER_SUPPORT=On \
138 %else
139          -DMULTI_USER_SUPPORT=Off \
140 %endif
141
142         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
143
144 make %{?jobs:-j%jobs}
145
146 %install
147 mkdir -p %{buildroot}/usr/share/license
148 cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
149 cat LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
150 %make_install
151
152 %if %{with multi_user}
153 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/
154 install -m 0644 %SOURCE102 %{buildroot}%{_unitdir_user}/wrt_launchpad_daemon.service
155 ln -s ../wrt_launchpad_daemon.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
156 %else
157 mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
158 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
159 ln -s %{_unitdir}/wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
160 ln -s %{_unitdir}/wrt_launchpad_daemon_1.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
161 ln -s %{_unitdir}/wrt_launchpad_daemon_2.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
162 %endif
163
164 %pre
165 if [ $1 -eq 2 ] ; then
166 %if %{with multi_user}
167     systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
168 %else
169     systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
170 %endif
171 fi
172
173 %preun
174 if [ $1 -eq 0 ] ; then
175 %if %{with multi_user}
176     systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
177 %else
178     systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
179 %endif
180 fi
181
182 %clean
183 rm -rf %{buildroot}
184
185 %post
186 /sbin/ldconfig
187 chmod +s /usr/bin/wrt-launcher
188
189 /sbin/ldconfig
190 systemctl daemon-reload
191 if [ $1 -eq 2 ] ; then
192 %if %{with multi_user}
193     systemctl --user start wrt_launchpad_daemon@app.service
194 %else
195     systemctl start wrt_launchpad_daemon@app.service
196 %endif
197 fi
198
199 %postun -p /sbin/ldconfig
200 systemctl daemon-reload
201
202 %files
203 %manifest %{name}.manifest
204 %{_libdir}/*.so
205 %{_libdir}/*.so.*
206 %attr(755,root,root) %{_bindir}/wrt-client
207 %attr(755,root,root) %{_bindir}/wrt-launcher
208 %attr(755,root,root) %{_bindir}/wrt_reset_all.sh
209 %attr(755,root,root) %{_bindir}/wrt_reset_db.sh
210 %{_datadir}/wrt-engine/*
211 %{_datadir}/license/%{name}
212 %attr(644,root,root) %{_datadir}/edje/wrt/*
213 %attr(644,root,root) %{_datadir}/edje/ace/*
214 %if %{with_tests}
215     %attr(755,root,root) %{_bindir}/wrt-tests-general
216     /opt/share/widget/tests/general/*
217 %endif
218 %attr(755,root,root) %{_sysconfdir}/profile.d/wrt_env.sh
219
220 ## wrt-launchpad-daemon #######################################################
221 %attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
222 /usr/share/aul/preload_list_wrt.txt
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