Update package spec file for license
[platform/framework/web/wrt.git] / packaging / wrt.spec
index 0e2bf97..cf385c6 100644 (file)
@@ -1,24 +1,31 @@
-#git:framework/web/wrt wrt_0.8.169
+%bcond_with mesa
+%bcond_with wayland
+%bcond_with decrypt
+%bcond_with multi_user
+
 Name:       wrt
 Summary:    web runtime
-Version:    0.8.169
+Version:    0.8.278
 Release:    1
 Group:      Development/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0
 URL:        N/A
 Source0:    %{name}-%{version}.tar.gz
 ## wrt-launchpad-daemon #######################################################
-Source101:  wrt_launchpad_daemon@.service
+### 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(appcore-efl)
 BuildRequires:  pkgconfig(openssl)
-BuildRequires:  pkgconfig(cert-svc)
 BuildRequires:  pkgconfig(dpl-efl)
 BuildRequires:  pkgconfig(libpcrecpp)
 BuildRequires:  pkgconfig(ecore)
@@ -29,6 +36,7 @@ BuildRequires:  pkgconfig(secure-storage)
 BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(libiri)
 BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(cert-svc)
 BuildRequires:  pkgconfig(cert-svc-vcore)
 BuildRequires:  pkgconfig(libsoup-2.4)
 BuildRequires:  pkgconfig(security-core)
@@ -36,17 +44,31 @@ BuildRequires:  pkgconfig(security-client)
 BuildRequires:  pkgconfig(notification)
 BuildRequires:  pkgconfig(libprivilege-control)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
+BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(haptic)
 BuildRequires:  pkgconfig(capi-web-url-download)
 BuildRequires:  pkgconfig(wrt-plugin-loading)
 BuildRequires:  pkgconfig(wrt-plugin-js-overlay)
-BuildRequires:  pkgconfig(dpl-encryption)
+BuildRequires:  pkgconfig(wrt-plugins-ipc-message)
 BuildRequires:  pkgconfig(wrt-popup-wrt-runner)
 BuildRequires:  pkgconfig(wrt-popup-ace-runner)
 BuildRequires:  pkgconfig(sysman)
-BuildRequires:  pkgconfig(osp-appfw)
-BuildRequires:  osp-appfw-internal-devel
-Requires: osp-appfw
+BuildRequires:  pkgconfig(app2sd)
+BuildRequires:  pkgconfig(capi-system-system-settings)
+%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:  libss-client-devel
+BuildRequires:  gettext
+BuildRequires:  edje-tools
+Requires: libss-client
 
 ## wrt-launchpad-daemon #######################################################
 BuildRequires:  pkgconfig(app-checker)
@@ -57,6 +79,12 @@ BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  pkgconfig(sqlite3)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(aul)
+BuildRequires:  pkgconfig(libsystemd-daemon)
+%{?systemd_requires}
+
+#Use these macro to avoid hard-coded path
+#After upgrading systemd to v204 or higher macro can be deleted
+%define _unitdir /usr/lib/systemd/system
 ###############################################################################
 
 %description
@@ -72,6 +100,7 @@ wrt library development headers
 
 %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"
@@ -79,44 +108,85 @@ wrt library development headers
 %endif
 
 %build
-export LDFLAGS+="-Wl,--rpath=/usr/lib"
+%if 0%{?tizen_build_binary_release_type_eng}
+export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
+export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
+export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
+%endif
+
+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 %{buildroot}/usr/share/license/%{name}
+cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+cat LICENSE.Flora >> %{buildroot}/usr/share/license/%{name}
 %make_install
 
 ## wrt-launchpad-daemon #######################################################
-mkdir -p %{buildroot}/etc/init.d
-install -m 755 src/wrt-launchpad-daemon/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/init.d
-
-mkdir -p %{buildroot}/etc/rc.d/rc3.d
-mkdir -p %{buildroot}/etc/rc.d/rc4.d
-ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
-ln -sf ../../init.d/wrt_launchpad_run.sh %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
 
 #systemd
-mkdir -p %{buildroot}%{_libdir}/systemd/system/graphical.target.wants
-install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/wrt_launchpad_daemon@.service
-ln -s ../wrt_launchpad_daemon@.service %{buildroot}%{_libdir}/systemd/system/graphical.target.wants/wrt_launchpad_daemon@app.service
+
+%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
 
 %preun
 if [ $1 == 0 ]; then
-    systemctl stop wrt_launchpad_daemon@app.service
+%if %{with multi_user}
+       systemctl --user stop wrt_launchpad_daemon.service
+%else
+       systemctl stop wrt_launchpad_daemon@app.service
+%endif
+
 fi
+
+
+
+
 ###############################################################################
 
+
+
+
 %clean
 rm -rf %{buildroot}
 
 %post
+/sbin/ldconfig
 chmod +s /usr/bin/wrt-launcher
 
 ## wrt-launchpad-daemon #######################################################
@@ -124,7 +194,13 @@ chmod +s /usr/bin/wrt-launcher
 /sbin/ldconfig
 systemctl daemon-reload
 if [ $1 == 1 ]; then
+%if %{with multi_user}
+    systemctl --user restart wrt_launchpad_daemon.service
+%else
     systemctl restart wrt_launchpad_daemon@app.service
+%endif
+
+
 fi
 ###############################################################################
 
@@ -137,21 +213,17 @@ systemctl daemon-reload
 ###############################################################################
 
 %files
-%manifest wrt.manifest
+%manifest %{name}.manifest
 %{_libdir}/*.so
 %{_libdir}/*.so.*
-%{_libdir}/wrt-wk2-bundles/*.so
-%{_libdir}/wrt-wk2-bundles/*.so.*
 %attr(755,root,root) %{_bindir}/wrt-client
 %attr(755,root,root) %{_bindir}/wrt-launcher
 %attr(755,root,root) %{_bindir}/wrt_reset_all.sh
 %attr(755,root,root) %{_bindir}/wrt_reset_db.sh
-%{_datadir}/locale/*
 %{_datadir}/wrt-engine/*
 %{_datadir}/license/%{name}
 %attr(644,root,root) %{_datadir}/edje/wrt/*
 %attr(644,root,root) %{_datadir}/edje/ace/*
-%attr(644,root,root) /usr/etc/wrt/*
 %if %{with_tests}
     %attr(755,root,root) %{_bindir}/wrt-tests-general
     /opt/share/widget/tests/general/*
@@ -161,15 +233,24 @@ systemctl daemon-reload
 ## wrt-launchpad-daemon #######################################################
 %attr(755,root,root) %{_bindir}/wrt_launchpad_daemon
 /usr/share/aul/preload_list_wrt.txt
-%{_sysconfdir}/init.d/wrt_launchpad_run.sh
-%attr(0755,root,root) %{_sysconfdir}/rc.d/rc3.d/S15wrt_launchpad_run
-%attr(0755,root,root) %{_sysconfdir}/rc.d/rc4.d/S80wrt_launchpad_run
+/etc/smack/accesses2.d/wrt_launchpad_daemon.rule
+/opt/etc/smack/accesses.d/wrt_launchpad_daemon.rule
 #systemd
-%{_libdir}/systemd/system/graphical.target.wants/wrt_launchpad_daemon@app.service
-%{_libdir}/systemd/system/wrt_launchpad_daemon@.service
+%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/*