Using gdbus for IPC instead of com-core package
[platform/core/api/notification.git] / packaging / notification.spec
1 %bcond_with wayland
2 Name:       notification
3 Summary:    Notification library
4 Version:    0.2.41
5 Release:    1
6 Group:      TBD
7 License:    Apache-2.0
8 Source0:    %{name}-%{version}.tar.gz
9 BuildRequires: pkgconfig(sqlite3)
10 BuildRequires: pkgconfig(db-util)
11 BuildRequires: pkgconfig(vconf)
12 BuildRequires: pkgconfig(bundle)
13 BuildRequires: pkgconfig(dbus-1)
14 BuildRequires: pkgconfig(dlog)
15 BuildRequires: pkgconfig(ail)
16 BuildRequires: pkgconfig(aul)
17 BuildRequires: pkgconfig(appsvc)
18 BuildRequires: pkgconfig(dbus-glib-1)
19 BuildRequires: pkgconfig(com-core)
20 BuildRequires: pkgconfig(appcore-common)
21 BuildRequires: pkgconfig(capi-appfw-application)
22 BuildRequires: pkgconfig(capi-appfw-app-manager)
23 BuildRequires: pkgconfig(capi-appfw-package-manager)
24 BuildRequires: pkgconfig(pkgmgr-info)
25 BuildRequires: pkgconfig(edbus)
26 BuildRequires: pkgconfig(elementary)
27 BuildRequires: pkgconfig(ecore)
28 BuildRequires: pkgconfig(eina)
29 BuildRequires: pkgconfig(libtzplatform-config)
30 BuildRequires: pkgconfig(gio-2.0)
31 BuildRequires: pkgconfig(glib-2.0)
32
33 BuildRequires: cmake
34 Requires(post): /sbin/ldconfig
35 Requires(post): %{TZ_SYS_BIN}/sqlite3
36 Requires(postun): /sbin/ldconfig
37
38 %description
39 Client/Server library for sending notifications.
40
41 %prep
42 %setup -q
43
44 %package devel
45 Summary:    Notification library (devel)
46 Group:      Development/Libraries
47 Requires:   %{name} = %{version}-%{release}
48
49 %description devel
50 Development files needed to build software that needs to system a system notification.
51
52 %build
53 %if 0%{?tizen_build_binary_release_type_eng}
54 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
55 export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
56 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
57 %endif
58 %if 0%{?sec_build_binary_debug_enable}
59 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
60 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
61 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
62 %endif
63 export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
64 LDFLAGS="$LDFLAGS"
65 %if %{with wayland}
66 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_WAYLAND=On
67 %else
68 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_X11=On
69 %endif
70 make %{?jobs:-j%jobs}
71
72 %install
73 rm -rf %{buildroot}
74 %make_install
75
76 mkdir -p %{buildroot}%{TZ_SYS_SHARE}/license
77 cp -f LICENSE %{buildroot}%{TZ_SYS_SHARE}/license/%{name}
78
79 %clean
80 rm -rf %{buildroot}
81
82 %post
83 /sbin/ldconfig
84
85 if [ ! -d %{TZ_SYS_DB} ]
86 then
87         mkdir %{TZ_SYS_DB}
88 fi
89
90 if [ ! -f %{TZ_SYS_DB}/.notification.db ]
91 then
92         sqlite3 %{TZ_SYS_DB}/.notification.db 'PRAGMA journal_mode = PERSIST;
93                 create  table if not exists noti_list ( 
94                         type INTEGER NOT NULL,
95                         layout INTEGER NOT NULL default 0,
96                         caller_pkgname TEXT NOT NULL,
97                         launch_pkgname TEXT,
98                         image_path TEXT,
99                         group_id INTEGER default 0,  
100                         internal_group_id INTEGER default 0,  
101                         priv_id INTERGER NOT NULL,  
102                         title_key TEXT,
103                         b_text TEXT,
104                         b_key TEXT,
105                         tag TEXT,
106                         b_format_args TEXT,
107                         num_format_args INTEGER default 0,
108                         text_domain TEXT,
109                         text_dir TEXT,
110                         time INTEGER default 0,  
111                         insert_time INTEGER default 0,  
112                         args TEXT,  
113                         group_args TEXT,  
114                         b_execute_option TEXT,
115                         b_service_responding TEXT,
116                         b_service_single_launch TEXT,
117                         b_service_multi_launch TEXT,
118                         b_event_handler_click_on_button_1 TEXT,
119                         b_event_handler_click_on_button_2 TEXT,
120                         b_event_handler_click_on_button_3 TEXT,
121                         b_event_handler_click_on_button_4 TEXT,
122                         b_event_handler_click_on_button_5 TEXT,
123                         b_event_handler_click_on_button_6 TEXT,
124                         b_event_handler_click_on_icon TEXT,
125                         b_event_handler_click_on_thumbnail TEXT,
126                         sound_type INTEGER default 0,
127                         sound_path TEXT,
128                         vibration_type INTEGER default 0,
129                         vibration_path TEXT,
130                         led_operation INTEGER default 0,
131                         led_argb INTEGER default 0,
132                         led_on_ms INTEGER default -1,
133                         led_off_ms INTEGER default -1,
134                         flags_for_property INTEGER default 0,
135                         flag_simmode INTEGER default 0,
136                         display_applist INTEGER,
137                         progress_size DOUBLE default 0,
138                         progress_percentage DOUBLE default 0,
139                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
140                         ongoing_flag INTEGER default 0,
141                         auto_remove INTEGER default 1,
142                         UNIQUE (caller_pkgname, priv_id)  
143                 ); 
144                 create table if not exists noti_group_data (
145                         caller_pkgname TEXT NOT NULL,
146                         group_id INTEGER default 0,
147                         badge INTEGER default 0,
148                         title TEXT,
149                         content TEXT,
150                         loc_title TEXT,
151                         loc_content TEXT,
152                         count_display_title INTEGER,
153                         count_display_content INTEGER,
154                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
155                         UNIQUE (caller_pkgname, group_id)
156                 );
157                 create table if not exists ongoing_list ( 
158                         caller_pkgname TEXT NOT NULL,
159                         launch_pkgname TEXT,
160                         icon_path TEXT,
161                         group_id INTEGER default 0,
162                         internal_group_id INTEGER default 0,  
163                         priv_id INTERGER NOT NULL,
164                         title TEXT,
165                         content TEXT,
166                         default_content TEXT,
167                         loc_title TEXT,
168                         loc_content TEXT,
169                         loc_default_content TEXT,
170                         text_domain TEXT,
171                         text_dir TEXT,
172                         args TEXT,  
173                         group_args TEXT,  
174                         flag INTEGER default 0,
175                         progress_size DOUBLE default 0,
176                         progress_percentage DOUBLE default 0,
177                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
178                         UNIQUE (caller_pkgname, priv_id)
179                 ); 
180                 CREATE TABLE IF NOT EXISTS notification_setting ( 
181                         priv_id INTEGER PRIMARY KEY AUTOINCREMENT,
182                         package_name TEXT NOT NULL,
183                         allow_to_notify INTEGER DEFAULT 1,
184                         do_not_disturb_except INTEGER DEFAULT 0,
185                         visibility_class INTEGER DEFAULT 0,
186                         UNIQUE (priv_id, package_name)
187                 ); 
188                 CREATE TABLE IF NOT EXISTS notification_system_setting ( 
189                         priv_id INTERGER PRIMARY KEY,
190                         do_not_disturb INTEGER DEFAULT 0,
191                         visibility_class INTEGER DEFAULT 0,
192                         UNIQUE (priv_id)
193                 ); 
194
195                 INSERT INTO notification_system_setting (priv_id, do_not_disturb, visibility_class) VALUES (0, 0, 0);
196
197                 CREATE UNIQUE INDEX package_name_idx1 ON notification_setting (package_name);
198         '
199 else
200         echo %{TZ_SYS_DB}/.notification.db ": DB file is already exists"
201 fi
202
203 chown :5000 %{TZ_SYS_DB}/.notification.db
204 chown :5000 %{TZ_SYS_DB}/.notification.db-journal
205 chmod 644 %{TZ_SYS_DB}/.notification.db
206 chmod 644 %{TZ_SYS_DB}/.notification.db-journal
207
208 %postun -p /sbin/ldconfig
209
210 %files
211 %manifest notification.manifest
212 %defattr(-,root,root,-)
213 %{_libdir}/libnotification.so*
214 %{TZ_SYS_SHARE}/license/%{name}
215
216 %files devel
217 %defattr(-,root,root,-)
218 %{_includedir}/notification/notification.h
219 %{_includedir}/notification/notification_internal.h
220 %{_includedir}/notification/notification_error.h
221 %{_includedir}/notification/notification_type.h
222 %{_includedir}/notification/notification_list.h
223 %{_includedir}/notification/notification_ongoing_flag.h
224 %{_includedir}/notification/notification_text_domain.h
225 %{_includedir}/notification/notification_status.h
226 %{_includedir}/notification/notification_status_internal.h
227 %{_includedir}/notification/notification_setting.h
228 %{_includedir}/notification/notification_setting_internal.h
229 %{_includedir}/notification/notification_ipc.h
230 %{_includedir}/notification/notification_noti.h
231 %{_includedir}/notification/notification_setting_service.h
232 %{_libdir}/pkgconfig/notification.pc