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