Add cache support
[platform/framework/web/download-provider.git] / packaging / download-provider.spec
index 116bcae..1f93da3 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.115
+Version:    2.3.11
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0
@@ -23,7 +23,7 @@ BuildRequires:  pkgconfig(appsvc)
 BuildRequires:  pkgconfig(libcurl)
 BuildRequires:  pkgconfig(capi-content-mime-type)
 BuildRequires:  gettext-devel
-BuildRequires:  pkgconfig(libsystemd-daemon)
+BuildRequires:  pkgconfig(libsystemd)
 BuildRequires:  pkgconfig(capi-network-wifi-direct)
 %if "%{?profile}" != "wearable"
 BuildRequires:  pkgconfig(notification)
@@ -33,7 +33,6 @@ BuildRequires:  pkgconfig(cynara-client)
 BuildRequires:  pkgconfig(cynara-client-async)
 BuildRequires:  pkgconfig(cynara-creds-socket)
 BuildRequires:  pkgconfig(cynara-creds-dbus)
-BuildRequires:  pkgconfig(tpkp-curl)
 BuildRequires:  pkgconfig(libtzplatform-config)
 
 %if 0%{?gtests:1}
@@ -65,6 +64,13 @@ Description: Download the contents in background (development files)
 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
 %define _http_lib libcurl
 %define _manifest_name %{name}.manifest
+%if "%{?tizen_profile_name}" == "tv"
+%define _ca_cert /opt/data/cert/vdca.pem
+%define _ca_path /opt/data/cert/user/
+%define max_concurrent_downloads 15
+%else
+%define max_concurrent_downloads 50
+%endif
 
 %build
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
@@ -83,6 +89,7 @@ export LDFLAGS+=" -lgcov"
        -DBIN_INSTALL_DIR:PATH=%{_bindir} \
        -DLIB_INSTALL_DIR:PATH=%{_libdir} \
        -DLIB_AGENT_PATH="/usr/%{?_lib}/libdownloadagent2.so.0.1.0" \
+       -DLIB_CACHE_AGENT_PATH="/usr/%{?_lib}/libcacheagent.so.0.1.0" \
        -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
        -DPKG_NAME=%{name} \
        -DPKG_VERSION=%{version} \
@@ -104,11 +111,11 @@ export LDFLAGS+=" -lgcov"
        -DSUPPORT_LOG_MESSAGE:BOOL=ON \
        -DSUPPORT_OMA_DRM:BOOL=OFF \
        -DSUPPORT_COMPANION_MODE:BOOL=OFF \
-       -DTIZEN_2_3_UX:BOOL=ON \
 %if "%{?profile}" == "wearable"
        -DSUPPORT_MULTILINGUAL:BOOL=ON \
 %else
        -DSUPPORT_MULTILINGUAL:BOOL=OFF \
+       -DMAX_CONCURRENT_DOWNLOADS=%{?max_concurrent_downloads}\
 %endif
        -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \
        -DHTTP_LIB=%{_http_lib} \
@@ -120,6 +127,10 @@ export LDFLAGS+=" -lgcov"
        -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
        -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
        -DSUPPORT_LARGE_FILE:BOOL=ON \
+%if "%{?tizen_profile_name}" == "tv"
+       -DCA_CERT=%{_ca_cert} \
+       -DCA_PATH=%{_ca_path} \
+%endif
        .
 
 make %{?jobs:-j%jobs}
@@ -132,13 +143,14 @@ mkdir -p %{buildroot}/etc/notstrip/
 install -m 644 packaging/download-provider.notstrip %{buildroot}/etc/notstrip/download-provider.notstrip
 %endif
 
+mkdir -p %{buildroot}/var/lib/download-provider/
+install -m 600 res/var/lib/download-provider/settings %{buildroot}/var/lib/download-provider/settings
+
 ## container_enable
 mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/
 mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/
 
-mkdir -p %{buildroot}/lib/systemd/system/graphical.target.wants
 mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants
-ln -s ../download-provider.service %{buildroot}/lib/systemd/system/graphical.target.wants/
 ln -s ../download-provider.socket %{buildroot}/lib/systemd/system/sockets.target.wants/
 
 %post
@@ -155,6 +167,9 @@ mkdir -p --mode=0700 %{_database_client_dir}
 chsmack -a 'System' %{_database_client_dir}
 chown -R web_fw:web_fw %{_database_client_dir}
 chown -R web_fw:web_fw %{_data_install_path}
+chown -R web_fw:web_fw /var/lib/download-provider/
+mkdir -p /opt/usr/data/download_cache
+chown -R web_fw:web_fw /opt/usr/data/download_cache
 
 %files
 %defattr(-,root,root,-)
@@ -162,8 +177,8 @@ chown -R web_fw:web_fw %{_data_install_path}
 %{_imagedir}/*.png
 %{_localedir}/*/*/download-provider.mo
 %{_libdir}/*.so.*
+%attr(0600,web_fw,web_fw) /var/lib/download-provider/settings
 /lib/systemd/system/download-provider.service
-/lib/systemd/system/graphical.target.wants/download-provider.service
 /lib/systemd/system/download-provider.socket
 /lib/systemd/system/sockets.target.wants/download-provider.socket
 %{_bindir}/%{name}
@@ -182,9 +197,11 @@ chown -R web_fw:web_fw %{_data_install_path}
 %{_libdir}/pkgconfig/download-provider.pc
 %{_libdir}/pkgconfig/download-provider-interface.pc
 %{_libdir}/pkgconfig/download-agent.pc
+%{_libdir}/pkgconfig/cache-agent.pc
 %{_includedir}/download-provider/download-provider.h
 %{_includedir}/download-provider/download-provider-interface.h
 %{_includedir}/download-provider/download-agent-interface.h
+%{_includedir}/download-provider/cache-agent-interface.h
 
 %if 0%{?gtests:1}
 %{_bindir}/gtest*