-#git:framework/web/wrt
+%bcond_with x
+%bcond_with mesa
+%bcond_with wayland
+%bcond_with decrypt
+%bcond_with multi_user
+
Name: wrt
Summary: web runtime
-Version: 0.8.270
-Release: 1
+Version: 0.8.288
+Release: 0
Group: Development/Libraries
-License: Apache License, Version 2.0
+License: Apache-2.0
URL: N/A
Source0: %{name}-%{version}.tar.gz
+## wrt-launchpad-daemon #######################################################
+### systemd service for multi-user mode
+Source102: wrt_launchpad_daemon_user.service
+Source1001: wrt.manifest
+###############################################################################
BuildRequires: cmake
BuildRequires: gettext
BuildRequires: edje-tools
+BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ewebkit2)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(libcurl)
+%if %{with x}
BuildRequires: pkgconfig(utilX)
+%endif
BuildRequires: pkgconfig(secure-storage)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(libiri)
BuildRequires: pkgconfig(wrt-popup-wrt-runner)
BuildRequires: pkgconfig(wrt-popup-ace-runner)
BuildRequires: pkgconfig(sysman)
-BuildRequires: pkgconfig(app2sd)
BuildRequires: pkgconfig(capi-system-system-settings)
+BuildRequires: pkgconfig(app2sd)
+BuildRequires: pkgconfig(libtzplatform-config)
+%if %{with mesa}
+BuildRequires: pkgconfig(gl)
+BuildRequires: pkgconfig(glesv2)
+%else
+BuildRequires: pkgconfig(gles20)
+%endif
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(efl-assist)
+BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: libss-client-devel
BuildRequires: gettext
BuildRequires: edje-tools
Requires: libss-client
+Requires: libtzplatform-config
## wrt-launchpad-daemon #######################################################
BuildRequires: pkgconfig(app-checker)
%prep
%setup -q
+cp %{SOURCE1001} .
%define with_tests 0
%if "%{WITH_TESTS}" == "ON" || "%{WITH_TESTS}" == "Y" || "%{WITH_TESTS}" == "YES" || "%{WITH_TESTS}" == "TRUE" || "%{WITH_TESTS}" == "1"
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
%endif
-export LDFLAGS+="-Wl,--rpath=/usr/lib"
+export LDFLAGS+="-Wl,--rpath=%{_libdir}"
+
+%cmake . -DDPL_LOG="ON" \
+ -DPROJECT_VERSION=%{version} \
+ -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
+%if %{with mesa}
+ -DUSE_MESA=On \
+%endif
+%if %{with wayland}
+ -DX11_SUPPORT=Off \
+%else
+ -DX11_SUPPORT=On \
+%endif
+%if %{with decrypt}
+ -DDECRYPT_SUPPORT=On \
+%else
+ -DDECRYPT_SUPPORT=Off \
+%endif
+%if %{with multi_user}
+ -DMULTI_USER_SUPPORT=On \
+%else
+ -DMULTI_USER_SUPPORT=Off \
+%endif
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DDPL_LOG="ON" \
- -DPROJECT_VERSION=%{version} \
- -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
%{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
+
make %{?jobs:-j%jobs}
%install
mkdir -p %{buildroot}/usr/share/license
cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
-cp LICENSE.Flora %{buildroot}/usr/share/license/%{name}
+cat LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
%make_install
-## wrt-launchpad-daemon #######################################################
-
-#systemd
+%if %{with multi_user}
+mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/
+install -m 0644 %SOURCE102 %{buildroot}%{_unitdir_user}/wrt_launchpad_daemon.service
+ln -s ../wrt_launchpad_daemon.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
+%else
mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
ln -s %{_unitdir}/wrt_launchpad_daemon@.service %{buildroot}%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
ln -s %{_unitdir}/wrt_launchpad_daemon_1.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
ln -s %{_unitdir}/wrt_launchpad_daemon_2.socket %{buildroot}%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
+%endif
+
+%pre
+if [ $1 -eq 2 ] ; then
+%if %{with multi_user}
+ systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+%else
+ systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+%endif
+fi
%preun
-if [ $1 == 0 ]; then
- systemctl stop wrt_launchpad_daemon@app.service
+if [ $1 -eq 0 ] ; then
+%if %{with multi_user}
+ systemctl --user stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+%else
+ systemctl stop wrt_launchpad_daemon@app.service wrt_launchpad_daemon_1.socket wrt_launchpad_daemon_2.socket
+%endif
fi
-###############################################################################
%clean
rm -rf %{buildroot}
%post
+/sbin/ldconfig
chmod +s /usr/bin/wrt-launcher
-## wrt-launchpad-daemon #######################################################
-#systemd
/sbin/ldconfig
systemctl daemon-reload
-if [ $1 == 1 ]; then
- systemctl restart wrt_launchpad_daemon@app.service
+if [ $1 -eq 2 ] ; then
+%if %{with multi_user}
+ systemctl --user start wrt_launchpad_daemon@app.service
+%else
+ systemctl start wrt_launchpad_daemon@app.service
+%endif
fi
-###############################################################################
-
-echo "[WRT] wrt postinst done ..."
-## wrt-launchpad-daemon #######################################################
-#systemd
%postun -p /sbin/ldconfig
systemctl daemon-reload
-###############################################################################
%files
-%manifest wrt.manifest
+%manifest %{name}.manifest
%{_libdir}/*.so
%{_libdir}/*.so.*
%attr(755,root,root) %{_bindir}/wrt-client
## wrt-launchpad-daemon #######################################################
%attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
/usr/share/aul/preload_list_wrt.txt
-/etc/smack/accesses2.d/wrt_launchpad_daemon.rule
-/opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
#systemd
+%if %{with multi_user}
+%{_unitdir_user}/tizen-middleware.target.wants/wrt_launchpad_daemon.service
+%{_unitdir_user}/wrt_launchpad_daemon.service
+%else
%{_unitdir}/graphical.target.wants/wrt_launchpad_daemon@app.service
%{_unitdir}/wrt_launchpad_daemon@.service
%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_1.socket
%{_unitdir}/wrt_launchpad_daemon_1.socket
%{_unitdir}/sockets.target.wants/wrt_launchpad_daemon_2.socket
%{_unitdir}/wrt_launchpad_daemon_2.socket
+%endif
###############################################################################
%files devel
+%manifest %{name}.manifest
%{_includedir}/*
%{_libdir}/pkgconfig/*