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