Remove hardcoded path for multiuser support
[platform/framework/web/wrt-installer.git] / packaging / wrt-installer.spec
index 07d707a..196ca0b 100644 (file)
@@ -1,12 +1,17 @@
-#git:framework/web/wrt-installer
+%bcond_with livebox
+%bcond_with decrypt
+%bcond_with osp
+%bcond_with wayland
+%bcond_with x
+
 Name:       wrt-installer
 Summary:    Installer for tizen Webruntime
-Version:    0.1.131
+Version:    0.1.138
 Release:    1
-Group:      Development/Libraries
-License:    Apache License, Version 2.0
-URL:        N/A
+Group:      Web Framework/Utilities
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+Source1001:    wrt-installer.manifest
 BuildRequires:  cmake
 BuildRequires:  edje-tools
 BuildRequires:  pkgconfig(appsvc)
@@ -21,7 +26,12 @@ BuildRequires:  pkgconfig(dpl-wrt-dao-rw)
 BuildRequires:  pkgconfig(wrt-commons-i18n-dao-ro)
 BuildRequires:  pkgconfig(wrt-commons-widget-interface-dao)
 BuildRequires:  pkgconfig(security-install)
+%if %{with x}
 BuildRequires:  pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires:  pkgconfig(ecore-wayland)
+%endif
 BuildRequires:  pkgconfig(xmlsec1)
 BuildRequires:  pkgconfig(libidn)
 BuildRequires:  pkgconfig(libiri)
@@ -33,25 +43,38 @@ BuildRequires:  pkgconfig(pkgmgr-info)
 BuildRequires:  pkgconfig(pkgmgr)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(cert-svc)
-BuildRequires:  pkgconfig(utilX)
 BuildRequires:  pkgconfig(wrt-plugins-types)
 BuildRequires:  pkgconfig(tapi)
 BuildRequires:  pkgconfig(shortcut)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
 BuildRequires:  pkgconfig(app2sd)
+BuildRequires:  pkgconfig(libtzplatform-config)
+%if %{with livebox}
 BuildRequires:  pkgconfig(web-provider)
+%endif
 BuildRequires:  pkgconfig(libprivilege-control)
 BuildRequires:  pkgconfig(libsmack)
 BuildRequires:  libss-client-devel
 Requires: libss-client
+%if %{with osp}
 Requires: osp-installer
+%endif
 Requires: xmlsec1
+Requires: libtzplatform-config
 
 %description
 Description: Wrt Installer for Tizen apps and Wac apps
 
+%package preinstall-service
+Summary: Service for installing wgt files on first boot
+Group:   Web Framework/Utilities
+%description preinstall-service
+This package installs a first time boot systemd service for 
+completing the installation of preinstalled web apps.
+
 %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"
@@ -65,12 +88,35 @@ export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 %endif
 
-export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--hash-style=both -Wl,--as-needed"
+export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed"
 LDFLAGS="$LDFLAGS"
 
-cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+%cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+%if %{with livebox}
+        -DLIVEBOX_SUPPORT=On \
+%else
+        -DLIVEBOX_SUPPORT=Off \
+%endif
+%if %{with decrypt}
+         -DDECRYPT_SUPPORT=On \
+%else
+         -DDECRYPT_SUPPORT=Off \
+%endif
+%if %{with wayland}
+         -DWAYLAND_SUPPORT=On \
+%else
+         -DWAYLAND_SUPPORT=Off \
+%endif
+%if %{with x}
+         -DX11_SUPPORT=On \
+%else
+         -DX11_SUPPORT=Off \
+%endif
+        -DSYSCONFDIR=%{_sysconfdir} \
+        -DSMACK=Off \
         -DDPL_LOG=ON \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
+        -DTZ_SYS_APP_PREINSTALL=%TZ_SYS_APP_PREINSTALL \
         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
 make %{?jobs:-j%jobs}
 
@@ -80,15 +126,18 @@ mkdir -p %{buildroot}/usr/share/license
 cp LICENSE %{buildroot}/usr/share/license/%{name}
 %make_install
 
+mkdir -p %{buildroot}%{_unitdir}/graphical.target.wants
+ln -s ../wrt-preinstall-widgets.service %{buildroot}%{_unitdir}/graphical.target.wants
+
 %clean
 rm -rf %{buildroot}
 
 %post
 /sbin/ldconfig
-chmod +s /usr/bin/wrt-installer
+chmod +s %{_bindir}/wrt-installer
 
 #symlink for package manager
-%define pkg_manager_backend_path "/usr/etc/package-manager/backend"
+%define pkg_manager_backend_path %{_sysconfdir}"/package-manager/backend"
 ln -sf /usr/bin/wrt-installer %{pkg_manager_backend_path}/wgt
 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/Wgt
 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/wGt
@@ -98,22 +147,27 @@ ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/wGT
 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/WgT
 ln -sf %{pkg_manager_backend_path}/wgt %{pkg_manager_backend_path}/WGT
 
-
 #for booting recovery
-mkdir -p /opt/share/widget/temp_info
+mkdir -p %TZ_SYS_RW_WIDGET/temp_info
 
 # for downloadable Application icons path
-mkdir -p /opt/share/icons/default/small
+mkdir -p %TZ_SYS_SHARE/icons/default/small
 
 %postun -p /sbin/ldconfig
 
 %files
-%manifest wrt-installer.manifest
+%manifest %{name}.manifest
 %attr(755,root,root) %{_bindir}/wrt-installer
-/usr/etc/package-manager/backendlib/libwgt.so
-%attr(644,root,root) /usr/etc/wrt-installer/*.xsd
+%{_sysconfdir}/package-manager/backendlib/libwgt.so
+%attr(644,root,root) %{_sysconfdir}/wrt-installer/*.xsd
 %{_datadir}/license/%{name}
 %if %{with_tests}
     %attr(755,root,root) %{_bindir}/wrt-installer-tests-*
-    /opt/share/widget/tests/installer/widgets/*
+    %TZ_SYS_RW_WIDGET/tests/installer/widgets/*
 %endif
+
+%files preinstall-service
+%manifest %{name}.manifest
+%attr(755,root,root) %{_bindir}/wrt_preinstall_widgets.sh
+%{_unitdir}/wrt-preinstall-widgets.service
+%{_unitdir}/graphical.target.wants/wrt-preinstall-widgets.service