Add cache support
[platform/framework/web/download-provider.git] / packaging / download-provider.spec
index d4daee4..1f93da3 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.2.2
+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)
@@ -67,6 +67,9 @@ Description: Download the contents in background (development files)
 %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
@@ -86,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} \
@@ -111,6 +115,7 @@ export LDFLAGS+=" -lgcov"
        -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} \
@@ -138,6 +143,9 @@ 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/
@@ -159,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,-)
@@ -166,6 +177,7 @@ 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/download-provider.socket
 /lib/systemd/system/sockets.target.wants/download-provider.socket
@@ -185,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*