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