Fix potential thread cancel issue
[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.116
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 %if "%{?profile}" != "wearable"
29 BuildRequires:  pkgconfig(notification)
30 %endif
31 BuildRequires:  pkgconfig(storage)
32 BuildRequires:  pkgconfig(cynara-client)
33 BuildRequires:  pkgconfig(cynara-client-async)
34 BuildRequires:  pkgconfig(cynara-creds-socket)
35 BuildRequires:  pkgconfig(cynara-creds-dbus)
36 BuildRequires:  pkgconfig(tpkp-curl)
37 BuildRequires:  pkgconfig(libtzplatform-config)
38
39 %if 0%{?gtests:1}
40 BuildRequires:  pkgconfig(gmock)
41 %endif
42
43 %description
44 Description: Download the contents in background
45
46 %package devel
47 Summary:    download-provider
48 Group:      Development/Libraries
49 Requires:   %{name} = %{version}-%{release}
50
51 %description devel
52 Description: Download the contents in background (development files)
53
54 %prep
55 %setup -q
56
57 %define _data_install_path %{TZ_SYS_GLOBALUSER_DATA}/%{name}
58 %define _resource_install_path /usr/share/%{name}
59 %define _imagedir %{_resource_install_path}/images
60 %define _localedir %{_resource_install_path}/locales
61 %define _databasedir %{_data_install_path}/database
62 %define _database_client_dir %{_databasedir}/clients
63 %define _notifydir %{_data_install_path}/notify
64 %define _ipc_socket /tmp/.download-provider.sock
65 %define _logdump_script_dir %{TZ_SYS_ETC}/dump.d/module.d
66 %define _http_lib libcurl
67 %define _manifest_name %{name}.manifest
68
69 %build
70 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
71 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
72 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
73
74 %if 0%{?gcov:1}
75 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
76 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
77 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
78 export LDFLAGS+=" -lgcov"
79 %endif
80
81 %cmake -DTZ_SYS_GLOBALUSER_DATA=%TZ_SYS_GLOBALUSER_DATA \
82         -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
83         -DBIN_INSTALL_DIR:PATH=%{_bindir} \
84         -DLIB_INSTALL_DIR:PATH=%{_libdir} \
85         -DLIB_AGENT_PATH="/usr/%{?_lib}/libdownloadagent2.so.0.1.0" \
86         -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
87         -DPKG_NAME=%{name} \
88         -DPKG_VERSION=%{version} \
89         -DPKG_RELEASE=%{release} \
90         -DIPC_SOCKET:PATH=%{_ipc_socket} \
91         -DPROVIDER_DIR:PATH=%{_data_install_path} \
92         -DNOTIFY_DIR:PATH=%{_notifydir} \
93         -DDATABASE_DIR:PATH=%{_databasedir} \
94         -DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \
95         -DIMAGE_DIR:PATH=%{_imagedir} \
96         -DLOCALE_DIR:PATH=%{_localedir} \
97         -DSUPPORT_WIFI_DIRECT:BOOL=OFF \
98         -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \
99 %if "%{?profile}" == "wearable"
100         -DSUPPORT_NOTIFICATION:BOOL=OFF \
101 %else
102         -DSUPPORT_NOTIFICATION:BOOL=ON \
103 %endif
104         -DSUPPORT_LOG_MESSAGE:BOOL=ON \
105         -DSUPPORT_OMA_DRM:BOOL=OFF \
106         -DSUPPORT_COMPANION_MODE:BOOL=OFF \
107         -DTIZEN_2_3_UX:BOOL=ON \
108 %if "%{?profile}" == "wearable"
109         -DSUPPORT_MULTILINGUAL:BOOL=ON \
110 %else
111         -DSUPPORT_MULTILINGUAL:BOOL=OFF \
112 %endif
113         -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \
114         -DHTTP_LIB=%{_http_lib} \
115 %if "%{?_lib}" == "lib64"
116         %{?_cmake_lib_suffix64} \
117 %endif
118         %{?_cmake_skip_rpath} \
119         -DBUILD_SHARED_LIBS:BOOL=ON \
120         -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
121         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
122         -DSUPPORT_LARGE_FILE:BOOL=ON \
123         .
124
125 make %{?jobs:-j%jobs}
126
127 %install
128 rm -rf %{buildroot}
129 %make_install
130 %if "%{?tizen_profile_name}" == "tv"
131 mkdir -p %{buildroot}/etc/notstrip/
132 install -m 644 packaging/download-provider.notstrip %{buildroot}/etc/notstrip/download-provider.notstrip
133 %endif
134
135 ## container_enable
136 mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/
137 mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/
138
139 mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants
140 ln -s ../download-provider.socket %{buildroot}/lib/systemd/system/sockets.target.wants/
141
142 %post
143 #make notify dir in post section for smack
144 mkdir %{TZ_SYS_GLOBALUSER_DATA}/download-provider
145 mkdir -p %{_notifydir}
146 chown -R web_fw:web_fw %{_notifydir}
147 chsmack -a 'System::Shared' %{_notifydir}
148 chsmack -t %{_notifydir}
149 mkdir -p --mode=0700 %{_databasedir}
150 chown -R web_fw:web_fw %{_databasedir}
151 chsmack -a 'System' %{_databasedir}
152 mkdir -p --mode=0700 %{_database_client_dir}
153 chsmack -a 'System' %{_database_client_dir}
154 chown -R web_fw:web_fw %{_database_client_dir}
155 chown -R web_fw:web_fw %{_data_install_path}
156
157 %files
158 %defattr(-,root,root,-)
159 %manifest %{_manifest_name}
160 %{_imagedir}/*.png
161 %{_localedir}/*/*/download-provider.mo
162 %{_libdir}/*.so.*
163 /lib/systemd/system/download-provider.service
164 /lib/systemd/system/download-provider.socket
165 /lib/systemd/system/sockets.target.wants/download-provider.socket
166 %{_bindir}/%{name}
167 %attr(0544,root,root) %{_logdump_script_dir}/dump-%{name}.sh
168 ## container_enable
169 %attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res
170 %if "%{?tizen_profile_name}" == "tv"
171 /etc/notstrip/download-provider.notstrip
172 %endif
173 %license LICENSE.APLv2
174
175 %files devel
176 %defattr(-,root,root,-)
177 %{_bindir}/%{name}
178 %{_libdir}/*.so
179 %{_libdir}/pkgconfig/download-provider.pc
180 %{_libdir}/pkgconfig/download-provider-interface.pc
181 %{_libdir}/pkgconfig/download-agent.pc
182 %{_includedir}/download-provider/download-provider.h
183 %{_includedir}/download-provider/download-provider-interface.h
184 %{_includedir}/download-provider/download-agent-interface.h
185
186 %if 0%{?gtests:1}
187 %{_bindir}/gtest*
188 %endif