2 Name: download-provider
3 Summary: Download the contents in background
6 Group: Development/Libraries
7 License: Apache License, Version 2.0
8 Source0: %{name}-%{version}.tar.gz
9 Source1: download-provider.service
10 Requires(post): /usr/bin/sqlite3
12 BuildRequires: pkgconfig(glib-2.0)
13 BuildRequires: pkgconfig(gobject-2.0)
14 BuildRequires: pkgconfig(dlog)
15 BuildRequires: pkgconfig(libsoup-2.4)
16 BuildRequires: pkgconfig(xdgmime)
17 BuildRequires: pkgconfig(vconf)
18 BuildRequires: pkgconfig(db-util)
19 BuildRequires: pkgconfig(sqlite3)
20 BuildRequires: pkgconfig(bundle)
21 BuildRequires: pkgconfig(capi-base-common)
22 BuildRequires: pkgconfig(capi-appfw-app-manager)
23 BuildRequires: pkgconfig(capi-network-connection)
24 BuildRequires: pkgconfig(notification)
25 BuildRequires: pkgconfig(appsvc)
26 BuildRequires: pkgconfig(dbus-1)
27 BuildRequires: pkgconfig(wifi-direct)
28 Requires(post): /sbin/ldconfig
29 Requires(postun): /sbin/ldconfig
31 Description: download the contents in background
34 Summary: Download-provider
35 Group: Development/Libraries
36 Requires: %{name} = %{version}-%{release}
39 Description: download the contents in background (developement files)
44 %define _imagedir /usr/share/download-provider
45 %define _databasedir /opt/usr/dbspace
46 %define _databasefile %{_databasedir}/.download-provider.db
47 %define _dbusservicedir /usr/share/dbus-1/services
48 %define _licensedir /usr/share/license
51 CFLAGS="${CFLAGS:-%optflags} -fPIC -D_REENTRANT -fvisibility=hidden"; export CFLAGS \
52 FFLAGS="${FFLAGS:-%optflags} -fPIC -fvisibility=hidden"; export FFLAGS \
53 LDFLAGS+=" -Wl,--as-needed -Wl,--hash-style=both"; export LDFLAGS \
55 -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\
56 -DBIN_INSTALL_DIR:PATH=%{_bindir} \\\
57 -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\
58 -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\
59 -DPKG_NAME=%{name} \\\
60 -DPKG_VERSION=%{version} \\\
61 -DPKG_RELEASE=%{release} \\\
62 -DIMAGE_DIR:PATH=%{_imagedir} \\\
63 -DDATABASE_FILE:PATH=%{_databasefile} \\\
64 -DDBUS_SERVICE_DIR:PATH=%{_dbusservicedir} \\\
65 -DLICENSE_DIR:PATH=%{_licensedir} \\\
66 -DSUPPORT_DBUS_SYSTEM:BOOL=ON \\\
67 -DSUPPORT_WIFI_DIRECT:BOOL=OFF \\\
68 -DSUPPORT_LOG_MESSAGE:BOOL=ON \\\
69 -DSUPPORT_CHECK_IPC:BOOL=ON \\\
70 %if "%{?_lib}" == "lib64" \
71 %{?_cmake_lib_suffix64} \\\
73 %{?_cmake_skip_rpath} \\\
74 -DBUILD_SHARED_LIBS:BOOL=ON
83 mkdir -p %{buildroot}%{_licensedir}
84 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
85 ln -s %{_sysconfdir}/rc.d/init.d/download-provider-service %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S70download-provider-service
86 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
87 ln -s %{_sysconfdir}/rc.d/init.d/download-provider-service %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S70download-provider-service
89 mkdir -p %{buildroot}/%{_unitdir_user}/tizen-middleware.target.wants
90 install %{SOURCE1} %{buildroot}/%{_unitdir_user}/
91 ln -s ../download-provider.service %{buildroot}/%{_unitdir_user}/tizen-middleware.target.wants/
93 mkdir -p %{buildroot}/opt/data/%{name}
94 mkdir -p %{buildroot}%{_databasedir}
95 if [ ! -f %{buildroot}%{_databasefile} ];
97 sqlite3 %{buildroot}%{_databasefile} 'PRAGMA journal_mode=PERSIST;
98 PRAGMA foreign_keys=ON;
101 id INTEGER UNIQUE PRIMARY KEY,
102 state INTEGER DEFAULT 0,
103 errorcode INTEGER DEFAULT 0,
104 startcount INTEGER DEFAULT 0,
105 packagename TEXT DEFAULT NULL,
110 CREATE TABLE requestinfo
112 id INTEGER UNIQUE PRIMARY KEY,
113 auto_download BOOLEAN DEFAULT 0,
114 state_event BOOLEAN DEFAULT 0,
115 progress_event BOOLEAN DEFAULT 0,
116 noti_enable BOOLEAN DEFAULT 0,
117 network_type TINYINT DEFAULT 0,
118 filename TEXT DEFAULT NULL,
119 destination TEXT DEFAULT NULL,
120 url TEXT DEFAULT NULL,
121 FOREIGN KEY(id) REFERENCES logging(id) ON DELETE CASCADE
124 CREATE TABLE downloadinfo
126 id INTEGER UNIQUE PRIMARY KEY,
127 http_status INTEGER DEFAULT 0,
128 content_size UNSIGNED BIG INT DEFAULT 0,
129 mimetype VARCHAR(64) DEFAULT NULL,
130 content_name TEXT DEFAULT NULL,
131 saved_path TEXT DEFAULT NULL,
132 tmp_saved_path TEXT DEFAULT NULL,
133 etag TEXT DEFAULT NULL,
134 FOREIGN KEY(id) REFERENCES logging(id) ON DELETE CASCADE
137 CREATE TABLE httpheaders
140 header_field TEXT DEFAULT NULL,
141 header_data TEXT DEFAULT NULL,
142 FOREIGN KEY(id) REFERENCES logging(id) ON DELETE CASCADE
145 CREATE TABLE notification
148 extra_key TEXT DEFAULT NULL,
149 extra_data TEXT DEFAULT NULL,
150 FOREIGN KEY(id) REFERENCES logging(id) ON DELETE CASCADE
153 CREATE UNIQUE INDEX requests_index ON logging (id, state, errorcode, packagename, createtime, accesstime);
166 %defattr(-,root,root,-)
167 %dir %attr(0775,root,app) /opt/data/%{name}
168 %manifest download-provider.manifest
170 %{_libdir}/libdownloadagent2.so.0.0.1
171 %{_libdir}/libdownloadagent2.so
172 %{_unitdir_user}/download-provider.service
173 %{_unitdir_user}/tizen-middleware.target.wants/download-provider.service
174 %{_libdir}/libdownload-provider-interface.so.%{version}
175 %{_libdir}/libdownload-provider-interface.so.0
177 %{_sysconfdir}/rc.d/init.d/download-provider-service
178 %{_sysconfdir}/rc.d/rc3.d/S70download-provider-service
179 %{_sysconfdir}/rc.d/rc5.d/S70download-provider-service
180 %{_licensedir}/%{name}
181 %{_dbusservicedir}/org.download-provider.service
182 %attr(660,root,app) /opt/usr/dbspace/.download-provider.db
183 %attr(660,root,app) /opt/usr/dbspace/.download-provider.db-journal
186 %defattr(-,root,root,-)
187 %{_libdir}/libdownloadagent2.so
188 %{_libdir}/libdownload-provider-interface.so
189 %{_includedir}/download-provider/download-provider-defs.h
190 %{_includedir}/download-provider/download-provider-interface.h
192 %{_libdir}/pkgconfig/download-provider.pc
193 %{_libdir}/pkgconfig/download-provider-interface.pc