Replace com.samsung with org.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.43.1
6 Release: 1
7 Group: Web Framework/Service
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 %{with wayland}
78 export WAYLAND_SUPPORT=On
79 export X11_SUPPORT=Off
80 export LIVEBOX_SHM=wayland
81 %else
82 export WAYLAND_SUPPORT=Off
83 export X11_SUPPORT=On
84 export LIVEBOX_SHM=x11
85 %endif
86
87 %if "%{_repository}" == "wearable"
88 export LIVEBOX_SHM="${LIVEBOX_SHM}.wearable"
89 export MOBILE=Off
90 export WEARABLE=On
91 %else
92 export LIVEBOX_SHM="${LIVEBOX_SHM}.mobile"
93 export MOBILE=On
94 export WEARABLE=Off
95 %endif
96
97 %cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT} -DMOBILE=${MOBILE} -DWEARABLE=${WEARABLE}
98 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
99
100 %install
101 rm -rf %{buildroot}
102 %make_install
103 mkdir -p %{buildroot}/%{_datarootdir}/license
104 mkdir -p %{buildroot}/opt/usr/share/live_magazine
105 mkdir -p %{buildroot}/opt/usr/share/live_magazine/log
106 mkdir -p %{buildroot}/opt/usr/share/live_magazine/reader
107 mkdir -p %{buildroot}/opt/usr/share/live_magazine/always
108 mkdir -p %{buildroot}/opt/usr/devel/usr/bin
109 mkdir -p %{buildroot}/opt/dbspace
110 #mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
111 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
112 #mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
113 touch %{buildroot}/opt/dbspace/.livebox.db
114 touch %{buildroot}/opt/dbspace/.livebox.db-journal
115 #ln -sf %{_sysconfdir}/rc.d/init.d/data-provider-master %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
116 ln -sf %{_unitdir_user}/data-provider-master.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
117 #ln -sf %{_unitdir_user}/data-provider-master.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
118 if [ ! -s %{buildroot}/opt/dbspace/.livebox.db ]; then
119 echo "LiveBox DB file is not exists, initiate it"
120 sqlite3 %{buildroot}/opt/dbspace/.livebox.db <<EOF
121 CREATE TABLE version ( version INTEGER );
122 CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
123 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, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
124 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);
125 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);
126 CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
127 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);
128 CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER, category TEXT DEFAULT 'http://tizen.org/category/default' );
129 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);
130 EOF
131 fi
132
133 %pre
134 # Executing the stop script for stopping the service of installed provider (old version)
135 if [ -x %{_sysconfdir}/rc.d/init.d/data-provider-master ]; then
136         %{_sysconfdir}/rc.d/init.d/data-provider-master stop
137 fi
138
139 %post
140 chown 5000:5000 /opt/usr/share/live_magazine
141 chmod 750 /opt/usr/share/live_magazine
142 chown 5000:5000 /opt/usr/share/live_magazine/log
143 chmod 750 /opt/usr/share/live_magazine/log
144 chown 5000:5000 /opt/usr/share/live_magazine/reader
145 chmod 750 /opt/usr/share/live_magazine/reader
146 chown 5000:5000 /opt/usr/share/live_magazine/always
147 chmod 750 /opt/usr/share/live_magazine/always
148 chown 0:5000 /opt/dbspace/.livebox.db
149 chmod 640 /opt/dbspace/.livebox.db
150 chown 0:5000 /opt/dbspace/.livebox.db-journal
151 chmod 640 /opt/dbspace/.livebox.db-journal
152 vconftool set -t bool "memory/data-provider-master/started" 0 -i -u 5000 -f -s system::vconf_system
153 vconftool set -t int "memory/private/data-provider-master/restart_count" 0 -i -u 5000 -f -s data-provider-master
154 vconftool set -t string "db/data-provider-master/serveraddr" "/opt/usr/share/live_magazine/.client.socket" -i -u 5000 -f -s system::vconf_system
155 echo "Successfully installed. Please start a daemon again manually"
156 echo "%{_sysconfdir}/init.d/data-provider-master start"
157
158 %files -n data-provider-master
159 %manifest %{name}.manifest
160 %defattr(-,root,root,-)
161 #%{_sysconfdir}/rc.d/init.d/data-provider-master
162 #%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
163 %{_bindir}/data-provider-master
164 %{_prefix}/etc/package-manager/parserlib/*
165 %{_datarootdir}/data-provider-master/*
166 %{_unitdir_user}/data-provider-master.service
167 #%{_unitdir_user}/data-provider-master.socket
168 %{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
169 #%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
170
171 %{_datarootdir}/license/*
172 /opt/usr/share/live_magazine/*
173 /opt/etc/dump.d/module.d/dump_livebox.sh
174 %if 0%{?tizen_build_binary_release_type_eng}
175 /opt/usr/devel/usr/bin/*
176 %endif
177 /opt/dbspace/.livebox.db
178 /opt/dbspace/.livebox.db-journal
179 #/opt/etc/smack/accesses.d/*
180
181 # End of a file