tizen 2.3 release
[apps/livebox/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 dynamicboxes
5 Version: 1.0.0
6 Release: 1
7 Group: HomeTF/DynamicBox
8 License: Flora
9 Source0: %{name}-%{version}.tar.gz
10 Source1001: %{name}.manifest
11 BuildRequires: cmake, gettext-tools, smack, coreutils
12 BuildRequires: pkgconfig(dlog)
13 BuildRequires: pkgconfig(aul)
14 BuildRequires: pkgconfig(vconf)
15 BuildRequires: pkgconfig(sqlite3)
16 BuildRequires: pkgconfig(db-util)
17 BuildRequires: pkgconfig(glib-2.0)
18 BuildRequires: pkgconfig(gio-2.0)
19 BuildRequires: pkgconfig(libsmack)
20 BuildRequires: pkgconfig(bundle)
21
22 %if %{with wayland}
23 BuildRequires: pkgconfig(ecore-wayland)
24 %else
25 BuildRequires: pkgconfig(ecore-x)
26 BuildRequires: pkgconfig(x11)
27 BuildRequires: pkgconfig(libdri2)
28 BuildRequires: pkgconfig(libdrm)
29 BuildRequires: pkgconfig(libtbm)
30 BuildRequires: pkgconfig(xfixes)
31 BuildRequires: pkgconfig(dri2proto)
32 BuildRequires: pkgconfig(xext)
33 BuildRequires: pkgconfig(xdamage)
34 %endif
35
36 BuildRequires: pkgconfig(ecore)
37 BuildRequires: pkgconfig(eina)
38 BuildRequires: pkgconfig(com-core)
39 BuildRequires: pkgconfig(libxml-2.0)
40 BuildRequires: pkgconfig(pkgmgr)
41 BuildRequires: pkgconfig(pkgmgr-info)
42 BuildRequires: pkgconfig(dynamicbox_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(libsystemd-daemon)
50 BuildRequires: model-build-features
51 Requires(post): sys-assert
52 Requires(post): dbus
53
54 %description
55 Manage the 2nd stage dynamicbox service provider and communicate with the viewer application.
56 Keep trace on the life-cycle of the dynamicbox 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 export LIVEBOX_SHM="${LIVEBOX_SHM}.480x800"
98 export LIVEBOX=On
99
100 %ifarch %ix86
101 export TARGET=emulator
102 %else
103 export TARGET=device
104 %endif
105
106 %cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT} -DMOBILE=${MOBILE} -DWEARABLE=${WEARABLE} -DLIVEBOX=${LIVEBOX} -DTARGET=${TARGET}
107
108 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
109
110 %install
111 rm -rf %{buildroot}
112 %make_install
113 mkdir -p %{buildroot}/%{_datarootdir}/license
114 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
115 ln -sf ../data-provider-master.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/data-provider-master.service
116 mkdir -p %{buildroot}/opt/usr/share/live_magazine
117 mkdir -p %{buildroot}/opt/usr/share/live_magazine/log
118 mkdir -p %{buildroot}/opt/usr/share/live_magazine/reader
119 mkdir -p %{buildroot}/opt/usr/share/live_magazine/always
120 mkdir -p %{buildroot}/opt/usr/devel/usr/bin
121 mkdir -p %{buildroot}/opt/dbspace
122 touch %{buildroot}/opt/dbspace/.dynamicbox.db
123 touch %{buildroot}/opt/dbspace/.dynamicbox.db-journal
124 if [ ! -s %{buildroot}/opt/dbspace/.dynamicbox.db ]; then
125 echo "DynamicBox DB file is not exists, initiate it"
126 sqlite3 %{buildroot}/opt/dbspace/.dynamicbox.db <<EOF
127 CREATE TABLE version ( version INTEGER );
128 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);
129 CREATE TABLE client (pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, gbar_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
130 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);
131 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);
132 CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
133 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);
134 CREATE TABLE pkgmap ( pkgid TEXT PRIMARY KEY NOT NULL, appid TEXT, uiapp TEXT, prime INTEGER, category TEXT DEFAULT 'http://tizen.org/category/default' );
135 CREATE TABLE provider ( pkgid TEXT PRIMARY KEY NOT NULL, network INTEGER, abi TEXT, secured INTEGER, box_type INTEGER, box_src TEXT, box_group TEXT, gbar_type INTEGER, gbar_src TEXT, gbar_group TEXT, libexec TEXT, timeout INTEGER, period TEXT, script TEXT, pinup INTEGER, count INTEGER, direct_input INTEGER DEFAULT 0, hw_acceleration TEXT DEFAULT '', FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
136 EOF
137 fi
138
139 %pre
140 # Executing the stop script for stopping the service of installed provider (old version)
141 if [ -x %{_sysconfdir}/rc.d/init.d/data-provider-master ]; then
142         %{_sysconfdir}/rc.d/init.d/data-provider-master stop
143 fi
144
145 %post
146 chown 5000:5000 /opt/usr/share/live_magazine
147 chmod 750 /opt/usr/share/live_magazine
148 chown 5000:5000 /opt/usr/share/live_magazine/log
149 chmod 750 /opt/usr/share/live_magazine/log
150 chown 5000:5000 /opt/usr/share/live_magazine/reader
151 chmod 750 /opt/usr/share/live_magazine/reader
152 chown 5000:5000 /opt/usr/share/live_magazine/always
153 chmod 750 /opt/usr/share/live_magazine/always
154 chown 0:5000 /opt/dbspace/.dynamicbox.db
155 chmod 640 /opt/dbspace/.dynamicbox.db
156 chown 0:5000 /opt/dbspace/.dynamicbox.db-journal
157 chmod 640 /opt/dbspace/.dynamicbox.db-journal
158 vconftool set -t bool "memory/data-provider-master/started" 0 -i -u 5000 -f -s system::vconf_system
159 vconftool set -t int "memory/private/data-provider-master/restart_count" 0 -i -u 5000 -f -s data-provider-master
160 vconftool set -t string "db/data-provider-master/serveraddr" "/opt/usr/share/live_magazine/.client.socket" -i -u 5000 -f -s system::vconf_system
161 echo "Successfully installed. Please start a daemon again manually"
162 echo "%{_sysconfdir}/init.d/data-provider-master start"
163
164 %files -n data-provider-master
165 %manifest %{name}.manifest
166 %defattr(-,root,root,-)
167 %{_bindir}/data-provider-master
168 %{_libdir}/systemd/system/multi-user.target.wants/data-provider-master.service
169 %{_libdir}/systemd/system/data-provider-master.service
170 %{_datarootdir}/license/*
171 %if 0%{?tizen_build_binary_release_type_eng}
172 /opt/usr/devel/usr/bin/*
173 %endif
174 %{_prefix}/etc/package-manager/parserlib/*
175 %{_datarootdir}/data-provider-master/*
176 /opt/etc/dump.d/module.d/dump_dynamicbox.sh
177 /opt/usr/share/live_magazine/*
178 /opt/dbspace/.dynamicbox.db
179 /opt/dbspace/.dynamicbox.db-journal
180
181 # End of a file