Update the PATH for supporting multi-user
[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(com-core)
39 BuildRequires: pkgconfig(libxml-2.0)
40 BuildRequires: pkgconfig(pkgmgr)
41 BuildRequires: pkgconfig(livebox-service)
42 BuildRequires: pkgconfig(notification)
43 BuildRequires: pkgconfig(notification-service)
44 BuildRequires: pkgconfig(badge)
45 BuildRequires: pkgconfig(badge-service)
46 BuildRequires: pkgconfig(shortcut)
47 BuildRequires: pkgconfig(security-server)
48 BuildRequires: pkgconfig(libtzplatform-config)
49 Requires: libtzplatform-config
50 Requires(post): sys-assert
51 Requires(post): dbus
52
53 %description
54 Manage the 2nd stage livebox service provider and communicate with the viewer application.
55 Keep trace on the life-cycle of the livebox and status of the service providers, viewer applications.
56
57 %prep
58 %setup -q
59 cp %{SOURCE1001} .
60
61 %build
62 %if 0%{?sec_build_binary_debug_enable}
63 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
64 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
65 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
66 %endif
67
68 export ENGINEER=false
69 %if 0%{?tizen_build_binary_release_type_eng}
70 export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
71 export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
72 export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
73 export ENGINEER=true
74 %endif
75
76 %if 0%{?sec_product_feature_livebox_shm}
77 export LIVEBOX_SHM=baltic
78 %else
79 export LIVEBOX_SHM=private
80 %endif
81
82 %if %{with wayland}
83 export WAYLAND_SUPPORT=On
84 export X11_SUPPORT=Off
85 export LIVEBOX_SHM=wayland
86 %else
87 export WAYLAND_SUPPORT=Off
88 export X11_SUPPORT=On
89 %endif
90
91 %cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT}
92
93 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
94
95 %install
96 rm -rf %{buildroot}
97 %make_install
98 mkdir -p %{buildroot}/%{_datarootdir}/license
99 mkdir -p %{buildroot}/opt/usr/share/live_magazine
100 mkdir -p %{buildroot}/opt/usr/share/live_magazine/log
101 mkdir -p %{buildroot}/opt/usr/share/live_magazine/reader
102 mkdir -p %{buildroot}/opt/usr/share/live_magazine/always
103 mkdir -p %{buildroot}/opt/usr/devel/usr/bin
104 mkdir -p %{buildroot}/opt/dbspace
105 #mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
106 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
107 mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
108 touch %{buildroot}/opt/dbspace/.livebox.db
109 touch %{buildroot}/opt/dbspace/.livebox.db-journal
110 #ln -sf %{_sysconfdir}/rc.d/init.d/data-provider-master %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
111 ln -sf %{_unitdir_user}/data-provider-master.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
112 ln -sf %{_unitdir_user}/data-provider-master.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
113 if [ ! -s %{buildroot}/opt/dbspace/.livebox.db ]; then
114 echo "LiveBox DB file is not exists, initiate it"
115 sqlite3 %{buildroot}/opt/dbspace/.livebox.db <<EOF
116 CREATE TABLE version ( version INTEGER );
117 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);
118 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);
119 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);
120 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);
121 CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
122 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);
123 CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER, category TEXT DEFAULT 'http://tizen.org/category/default' );
124 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);
125 EOF
126 fi
127
128 %pre
129 # Executing the stop script for stopping the service of installed provider (old version)
130 if [ -x %{_sysconfdir}/rc.d/init.d/data-provider-master ]; then
131         %{_sysconfdir}/rc.d/init.d/data-provider-master stop
132 fi
133
134 %post
135 chown 5000:5000 /opt/usr/share/live_magazine
136 chmod 750 /opt/usr/share/live_magazine
137 chown 5000:5000 /opt/usr/share/live_magazine/log
138 chmod 750 /opt/usr/share/live_magazine/log
139 chown 5000:5000 /opt/usr/share/live_magazine/reader
140 chmod 750 /opt/usr/share/live_magazine/reader
141 chown 5000:5000 /opt/usr/share/live_magazine/always
142 chmod 750 /opt/usr/share/live_magazine/always
143 chown 0:5000 /opt/dbspace/.livebox.db
144 chmod 640 /opt/dbspace/.livebox.db
145 chown 0:5000 /opt/dbspace/.livebox.db-journal
146 chmod 640 /opt/dbspace/.livebox.db-journal
147 vconftool set -t bool "memory/data-provider-master/started" 0 -i -u 5000 -f -s system::vconf_system
148 vconftool set -t int "memory/private/data-provider-master/restart_count" 0 -i -u 5000 -f -s data-provider-master
149 vconftool set -t string "db/data-provider-master/serveraddr" "/opt/usr/share/live_magazine/.client.socket" -i -u 5000 -f -s system::vconf_system
150 echo "Successfully installed. Please start a daemon again manually"
151 echo "%{_sysconfdir}/init.d/data-provider-master start"
152
153 %files -n data-provider-master
154 %manifest %{name}.manifest
155 %defattr(-,root,root,-)
156 %{_sysconfdir}/rc.d/init.d/data-provider-master
157 #%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
158 %{_bindir}/data-provider-master
159 %{_prefix}/etc/package-manager/parserlib/*
160 %{_datarootdir}/data-provider-master/*
161 %{_unitdir_user}/data-provider-master.service
162 %{_unitdir_user}/data-provider-master.socket
163 %{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
164 %{_unitdir_user}/sockets.target.wants/data-provider-master.socket
165
166 %{_datarootdir}/license/*
167 /opt/usr/share/live_magazine/*
168 /opt/etc/dump.d/module.d/dump_livebox.sh
169 %if 0%{?tizen_build_binary_release_type_eng}
170 /opt/usr/devel/usr/bin/*
171 %endif
172 /opt/dbspace/.livebox.db
173 /opt/dbspace/.livebox.db-journal
174 /opt/etc/smack/accesses.d/*
175
176 # End of a file