Merge "Add missing package." into tizen
[platform/framework/web/data-provider-master.git] / packaging / data-provider-master.spec
1 %bcond_with wayland
2
3 Name: data-provider-master
4 Summary: Master service provider for liveboxes
5 Version: 0.41.1
6 Release: 1
7 Group: HomeTF/Livebox
8 License: Flora
9 Source0: %{name}-%{version}.tar.gz
10 Source1001: %{name}.manifest
11 BuildRequires: cmake, gettext-tools, smack, coreutils
12 BuildRequires: pkgconfig(ail)
13 BuildRequires: pkgconfig(dlog)
14 BuildRequires: pkgconfig(aul)
15 BuildRequires: pkgconfig(vconf)
16 BuildRequires: pkgconfig(sqlite3)
17 BuildRequires: pkgconfig(db-util)
18 BuildRequires: pkgconfig(glib-2.0)
19 BuildRequires: pkgconfig(gio-2.0)
20 BuildRequires: pkgconfig(libsmack)
21 BuildRequires: pkgconfig(bundle)
22
23 %if %{with wayland}
24 BuildRequires: pkgconfig(ecore-wayland)
25 %else
26 BuildRequires: pkgconfig(ecore-x)
27 BuildRequires: pkgconfig(x11)
28 BuildRequires: pkgconfig(libdri2)
29 BuildRequires: pkgconfig(libdrm)
30 BuildRequires: pkgconfig(libtbm)
31 BuildRequires: pkgconfig(xfixes)
32 BuildRequires: pkgconfig(dri2proto)
33 BuildRequires: pkgconfig(xext)
34 BuildRequires: pkgconfig(xdamage)
35 %endif
36
37 BuildRequires: pkgconfig(ecore)
38 BuildRequires: pkgconfig(eina)
39 BuildRequires: pkgconfig(com-core)
40 BuildRequires: pkgconfig(libxml-2.0)
41 BuildRequires: pkgconfig(pkgmgr)
42 BuildRequires: pkgconfig(livebox-service)
43 BuildRequires: pkgconfig(notification)
44 BuildRequires: pkgconfig(notification-service)
45 BuildRequires: pkgconfig(badge)
46 BuildRequires: pkgconfig(badge-service)
47 BuildRequires: pkgconfig(shortcut)
48 BuildRequires: pkgconfig(security-server)
49 BuildRequires: pkgconfig(libtzplatform-config)
50 Requires: libtzplatform-config
51 Requires(post): sys-assert
52 Requires(post): dbus
53
54 %description
55 Manage the 2nd stage livebox service provider and communicate with the viewer application.
56 Keep trace on the life-cycle of the livebox and status of the service providers, viewer applications.
57
58 %prep
59 %setup -q
60 cp %{SOURCE1001} .
61
62 %build
63 %if 0%{?sec_build_binary_debug_enable}
64 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
65 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
66 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
67 %endif
68
69 export ENGINEER=false
70 %if 0%{?tizen_build_binary_release_type_eng}
71 export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
72 export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
73 export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
74 export ENGINEER=true
75 %endif
76
77 %if 0%{?sec_product_feature_livebox_shm}
78 export LIVEBOX_SHM=baltic
79 %else
80 export LIVEBOX_SHM=private
81 %endif
82
83 %if %{with wayland}
84 export WAYLAND_SUPPORT=On
85 export X11_SUPPORT=Off
86 export LIVEBOX_SHM=wayland
87 %else
88 export WAYLAND_SUPPORT=Off
89 export X11_SUPPORT=On
90 %endif
91
92 %cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT}
93
94 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
95
96 %install
97 rm -rf %{buildroot}
98 %make_install
99 mkdir -p %{buildroot}/%{_datarootdir}/license
100 mkdir -p %{buildroot}/opt/usr/share/live_magazine
101 mkdir -p %{buildroot}/opt/usr/share/live_magazine/log
102 mkdir -p %{buildroot}/opt/usr/share/live_magazine/reader
103 mkdir -p %{buildroot}/opt/usr/share/live_magazine/always
104 mkdir -p %{buildroot}/opt/usr/devel/usr/bin
105 mkdir -p %{buildroot}/opt/dbspace
106 #mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
107 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
108 mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
109 touch %{buildroot}/opt/dbspace/.livebox.db
110 touch %{buildroot}/opt/dbspace/.livebox.db-journal
111 #ln -sf %{_sysconfdir}/rc.d/init.d/data-provider-master %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
112 ln -sf %{_unitdir_user}/data-provider-master.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
113 ln -sf %{_unitdir_user}/data-provider-master.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
114 if [ ! -s %{buildroot}/opt/dbspace/.livebox.db ]; then
115 echo "LiveBox DB file is not exists, initiate it"
116 sqlite3 %{buildroot}/opt/dbspace/.livebox.db <<EOF
117 CREATE TABLE version ( version INTEGER );
118 CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
119 CREATE TABLE client (pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
120 CREATE TABLE groupinfo ( id INTEGER PRIMARY KEY AUTOINCREMENT, cluster TEXT NOT NULL, category TEXT NOT NULL, pkgid TEXT NOT NULL, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
121 CREATE TABLE groupmap (option_id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER, pkgid TEXT NOT NULL, ctx_item TEXT NOT NULL, FOREIGN KEY(id) REFERENCES groupinfo(id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
122 CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
123 CREATE TABLE option ( pkgid TEXT NOT NULL, option_id INTEGER, key TEXT NOT NULL, value TEXT NOT NULL, FOREIGN KEY(option_id) REFERENCES groupmap(option_id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
124 CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER, category TEXT DEFAULT 'http://tizen.org/category/default' );
125 CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, pd_type INTEGER, pd_src TEXT, pd_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
126 EOF
127 fi
128
129 %pre
130 # Executing the stop script for stopping the service of installed provider (old version)
131 if [ -x %{_sysconfdir}/rc.d/init.d/data-provider-master ]; then
132         %{_sysconfdir}/rc.d/init.d/data-provider-master stop
133 fi
134
135 %post
136 chown 5000:5000 /opt/usr/share/live_magazine
137 chmod 750 /opt/usr/share/live_magazine
138 chown 5000:5000 /opt/usr/share/live_magazine/log
139 chmod 750 /opt/usr/share/live_magazine/log
140 chown 5000:5000 /opt/usr/share/live_magazine/reader
141 chmod 750 /opt/usr/share/live_magazine/reader
142 chown 5000:5000 /opt/usr/share/live_magazine/always
143 chmod 750 /opt/usr/share/live_magazine/always
144 chown 0:5000 /opt/dbspace/.livebox.db
145 chmod 640 /opt/dbspace/.livebox.db
146 chown 0:5000 /opt/dbspace/.livebox.db-journal
147 chmod 640 /opt/dbspace/.livebox.db-journal
148 vconftool set -t bool "memory/data-provider-master/started" 0 -i -u 5000 -f -s system::vconf_system
149 vconftool set -t int "memory/private/data-provider-master/restart_count" 0 -i -u 5000 -f -s data-provider-master
150 vconftool set -t string "db/data-provider-master/serveraddr" "/opt/usr/share/live_magazine/.client.socket" -i -u 5000 -f -s system::vconf_system
151 echo "Successfully installed. Please start a daemon again manually"
152 echo "%{_sysconfdir}/init.d/data-provider-master start"
153
154 %files -n data-provider-master
155 %manifest %{name}.manifest
156 %defattr(-,root,root,-)
157 %{_sysconfdir}/rc.d/init.d/data-provider-master
158 #%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
159 %{_bindir}/data-provider-master
160 %{_prefix}/etc/package-manager/parserlib/*
161 %{_datarootdir}/data-provider-master/*
162 %{_unitdir_user}/data-provider-master.service
163 %{_unitdir_user}/data-provider-master.socket
164 %{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
165 %{_unitdir_user}/sockets.target.wants/data-provider-master.socket
166
167 %{_datarootdir}/license/*
168 /opt/usr/share/live_magazine/*
169 /opt/etc/dump.d/module.d/dump_livebox.sh
170 %if 0%{?tizen_build_binary_release_type_eng}
171 /opt/usr/devel/usr/bin/*
172 %endif
173 /opt/dbspace/.livebox.db
174 /opt/dbspace/.livebox.db-journal
175 /opt/etc/smack/accesses.d/*
176
177 # End of a file