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