Fixed memory leaks
[platform/core/api/notification.git] / packaging / notification.spec
1 Name:       notification
2 Summary:    notification library
3 Version:    0.2.2
4 Release:    1
5 Group:      TBD
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires: pkgconfig(sqlite3)
9 BuildRequires: pkgconfig(db-util)
10 BuildRequires: pkgconfig(heynoti)
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
21 BuildRequires: cmake
22 Requires(post): /sbin/ldconfig
23 Requires(post): /usr/bin/sqlite3
24 Requires(postun): /sbin/ldconfig
25
26 %description
27 Notificaiton library.
28
29 %prep
30 %setup -q
31
32 %package devel
33 Summary:    Notification library (devel)
34 Group:      Development/Libraries
35 Requires:   %{name} = %{version}-%{release}
36
37 %description devel
38 Notificaiton library (devel).
39
40 %build
41 export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--as-needed"
42 %cmake .
43 make %{?jobs:-j%jobs}
44
45 %install
46 %make_install
47
48 mkdir -p %{buildroot}/usr/share/license
49 cp -f LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}
50
51 %post
52 /sbin/ldconfig
53
54 if [ ! -d /opt/dbspace ]
55 then
56         mkdir /opt/dbspace
57 fi
58
59 if [ ! -f /opt/dbspace/.notification.db ]
60 then
61         sqlite3 /opt/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
62                 create  table if not exists noti_list ( 
63                         type INTEGER NOT NULL,
64                         layout INTEGER NOT NULL default 0,
65                         caller_pkgname TEXT NOT NULL,
66                         launch_pkgname TEXT,
67                         image_path TEXT,
68                         group_id INTEGER default 0,  
69                         internal_group_id INTEGER default 0,  
70                         priv_id INTERGER NOT NULL,  
71                         title_key TEXT,
72                         b_text TEXT,
73                         b_key TEXT,
74                         b_format_args TEXT,
75                         num_format_args INTEGER default 0,
76                         text_domain TEXT,
77                         text_dir TEXT,
78                         time INTEGER default 0,  
79                         insert_time INTEGER default 0,  
80                         args TEXT,  
81                         group_args TEXT,  
82                         b_execute_option TEXT,
83                         b_service_responding TEXT,
84                         b_service_single_launch TEXT,
85                         b_service_multi_launch TEXT,
86                         sound_type INTEGER default 0,
87                         sound_path TEXT,
88                         vibration_type INTEGER default 0,
89                         vibration_path TEXT,
90                         led_operation INTEGER default 0,
91                         led_argb INTEGER default 0,
92                         flags_for_property INTEGER default 0,
93                         flag_simmode INTEGER default 0,
94                         display_applist INTEGER,
95                         progress_size DOUBLE default 0,
96                         progress_percentage DOUBLE default 0,
97                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
98                         UNIQUE (caller_pkgname, priv_id)  
99                 ); 
100                 create table if not exists noti_group_data (
101                         caller_pkgname TEXT NOT NULL,
102                         group_id INTEGER default 0,
103                         badge INTEGER default 0,
104                         title TEXT,
105                         content TEXT,
106                         loc_title TEXT,
107                         loc_content TEXT,
108                         count_display_title INTEGER,
109                         count_display_content INTEGER,
110                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
111                         UNIQUE (caller_pkgname, group_id)
112                 );
113                 create  table if not exists ongoing_list ( 
114                         caller_pkgname TEXT NOT NULL,
115                         launch_pkgname TEXT,
116                         icon_path TEXT,
117                         group_id INTEGER default 0,
118                         internal_group_id INTEGER default 0,  
119                         priv_id INTERGER NOT NULL,
120                         title TEXT,
121                         content TEXT,
122                         default_content TEXT,
123                         loc_title TEXT,
124                         loc_content TEXT,
125                         loc_default_content TEXT,
126                         text_domain TEXT,
127                         text_dir TEXT,
128                         args TEXT,  
129                         group_args TEXT,  
130                         flag INTEGER default 0,
131                         progress_size DOUBLE default 0,
132                         progress_percentage DOUBLE default 0,
133                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
134                         UNIQUE (caller_pkgname, priv_id)  
135                 ); 
136         '
137 fi
138
139 chown :5000 /opt/dbspace/.notification.db
140 chown :5000 /opt/dbspace/.notification.db-journal
141 chmod 660 /opt/dbspace/.notification.db
142 chmod 660 /opt/dbspace/.notification.db-journal
143 chsmack -a 'notification::db' /opt/dbspace/.notification.db*
144 vconftool set -t string memory/private/libstatus/message "" -i -g 5000
145
146 %postun -p /sbin/ldconfig
147
148 %files
149 %manifest notification.manifest
150 %defattr(-,root,root,-)
151 %{_libdir}/libnotification.so*
152 /usr/share/license/%{name}
153
154 %files devel
155 %defattr(-,root,root,-)
156 %{_includedir}/notification/*.h
157 %{_libdir}/pkgconfig/notification.pc