[DF180926-00154] Add speed limit
[platform/framework/web/download-provider.git] / packaging / download-provider.spec
1 Name:       download-provider
2 Summary:    Download the contents in background
3 Version:    2.1.103
4 Release:    0
5 Group:      Development/Libraries
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Requires(post): sqlite
9 Requires(post): connman
10 Requires: security-config
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(dlog)
13 BuildRequires:  pkgconfig(gobject-2.0)
14 BuildRequires:  pkgconfig(xdgmime)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(sqlite3)
17 BuildRequires:  pkgconfig(bundle)
18 BuildRequires:  pkgconfig(capi-base-common)
19 BuildRequires:  pkgconfig(capi-appfw-app-manager)
20 BuildRequires:  pkgconfig(capi-appfw-application)
21 BuildRequires:  pkgconfig(capi-network-connection)
22 BuildRequires:  pkgconfig(appsvc)
23 BuildRequires:  pkgconfig(libcurl)
24 BuildRequires:  pkgconfig(capi-content-mime-type)
25 BuildRequires:  gettext-devel
26 BuildRequires:  pkgconfig(libsystemd-daemon)
27 BuildRequires:  pkgconfig(capi-network-wifi-direct)
28 BuildRequires:  pkgconfig(storage)
29 BuildRequires:  pkgconfig(notification)
30 BuildRequires:  pkgconfig(cynara-client)
31 BuildRequires:  pkgconfig(cynara-client-async)
32 BuildRequires:  pkgconfig(cynara-creds-socket)
33 BuildRequires:  pkgconfig(cynara-creds-dbus)
34 BuildRequires:  pkgconfig(tpkp-curl)
35 BuildRequires:  pkgconfig(libtzplatform-config)
36
37
38 %if 0%{?gtests:1}
39 BuildRequires:  pkgconfig(gmock)
40 %endif
41
42 %description
43 Description: Download the contents in background
44
45 %package devel
46 Summary:    download-provider
47 Group:      Development/Libraries
48 Requires:   %{name} = %{version}-%{release}
49
50 %description devel
51 Description: Download the contents in background (development files)
52
53 %prep
54 %setup -q
55
56 %define _data_install_path %{TZ_SYS_GLOBALUSER_DATA}/%{name}
57 %define _resource_install_path /usr/share/%{name}
58 %define _imagedir %{_resource_install_path}/images
59 %define _localedir %{_resource_install_path}/locales
60 %define _databasedir %{_data_install_path}/database
61 %define _database_client_dir %{_databasedir}/clients
62 %define _notifydir %{_data_install_path}/notify
63 %define _ipc_socket /tmp/.download-provider.sock
64 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
65 %define _http_lib libcurl
66 %define _manifest_name %{name}.manifest
67
68 %build
69 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
70 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
71 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
72
73 %if 0%{?gcov:1}
74 export LDFLAGS+=" -lgcov"
75 %endif
76
77 %cmake -DTZ_SYS_GLOBALUSER_DATA=%TZ_SYS_GLOBALUSER_DATA \
78         -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
79         -DBIN_INSTALL_DIR:PATH=%{_bindir} \
80         -DLIB_INSTALL_DIR:PATH=%{_libdir} \
81         -DLIB_AGENT_PATH="/usr/%{?_lib}/libdownloadagent2.so.0.1.0" \
82         -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
83         -DPKG_NAME=%{name} \
84         -DPKG_VERSION=%{version} \
85         -DPKG_RELEASE=%{release} \
86         -DIPC_SOCKET:PATH=%{_ipc_socket} \
87         -DPROVIDER_DIR:PATH=%{_data_install_path} \
88         -DNOTIFY_DIR:PATH=%{_notifydir} \
89         -DDATABASE_DIR:PATH=%{_databasedir} \
90         -DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \
91         -DIMAGE_DIR:PATH=%{_imagedir} \
92         -DLOCALE_DIR:PATH=%{_localedir} \
93         -DSUPPORT_WIFI_DIRECT:BOOL=OFF \
94         -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \
95         -DSUPPORT_NOTIFICATION:BOOL=ON \
96         -DSUPPORT_LOG_MESSAGE:BOOL=ON \
97         -DSUPPORT_OMA_DRM:BOOL=OFF \
98         -DSUPPORT_COMPANION_MODE:BOOL=OFF \
99         -DTIZEN_2_3_UX:BOOL=ON \
100         -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \
101         -DHTTP_LIB=%{_http_lib} \
102 %if "%{?_lib}" == "lib64"
103         %{?_cmake_lib_suffix64} \
104 %endif
105         %{?_cmake_skip_rpath} \
106         -DBUILD_SHARED_LIBS:BOOL=ON \
107         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
108          -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
109         .
110
111 make %{?jobs:-j%jobs}
112
113 %install
114 rm -rf %{buildroot}
115 %make_install
116 %if "%{?tizen_profile_name}" == "tv"
117 mkdir -p %{buildroot}/etc/notstrip/
118 install -m 644 packaging/download-provider.notstrip %{buildroot}/etc/notstrip/download-provider.notstrip
119 %endif
120
121 ## container_enable
122 mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/
123 mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/
124
125 mkdir -p %{buildroot}/lib/systemd/system/graphical.target.wants
126 mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants
127 ln -s ../download-provider.service %{buildroot}/lib/systemd/system/graphical.target.wants/
128 ln -s ../download-provider.socket %{buildroot}/lib/systemd/system/sockets.target.wants/
129
130 %post
131 #make notify dir in post section for smack
132 mkdir %{TZ_SYS_GLOBALUSER_DATA}/download-provider
133 mkdir -p %{_notifydir}
134 chown -R web_fw:web_fw %{_notifydir}
135 chsmack -a 'System::Shared' %{_notifydir}
136 chsmack -t %{_notifydir}
137 mkdir -p --mode=0700 %{_databasedir}
138 chown -R web_fw:web_fw %{_databasedir}
139 chsmack -a 'System' %{_databasedir}
140 mkdir -p --mode=0700 %{_database_client_dir}
141 chsmack -a 'System' %{_database_client_dir}
142 chown -R web_fw:web_fw %{_database_client_dir}
143 chown -R web_fw:web_fw %{_data_install_path}
144
145 %files
146 %defattr(-,root,root,-)
147 %manifest %{_manifest_name}
148 %{_imagedir}/*.png
149 %{_localedir}/*/*/download-provider.mo
150 %{_libdir}/*.so.*
151 /lib/systemd/system/download-provider.service
152 /lib/systemd/system/graphical.target.wants/download-provider.service
153 /lib/systemd/system/download-provider.socket
154 /lib/systemd/system/sockets.target.wants/download-provider.socket
155 %{_bindir}/%{name}
156 %attr(0544,root,root) %{_logdump_script_dir}/dump-%{name}.sh
157 ## container_enable
158 %attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res
159 %if "%{?tizen_profile_name}" == "tv"
160 /etc/notstrip/download-provider.notstrip
161 %endif
162 %license LICENSE.APLv2
163
164 %files devel
165 %defattr(-,root,root,-)
166 %{_bindir}/%{name}
167 %{_libdir}/*.so
168 %{_libdir}/pkgconfig/download-provider.pc
169 %{_libdir}/pkgconfig/download-provider-interface.pc
170 %{_libdir}/pkgconfig/download-agent.pc
171 %{_includedir}/download-provider/download-provider.h
172 %{_includedir}/download-provider/download-provider-interface.h
173 %{_includedir}/download-provider/download-agent-interface.h
174
175 %if 0%{?gtests:1}
176 %{_bindir}/gtest*
177 %endif