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