41d9d3b1d93345192234417644a3f8b0eb07ee40
[platform/core/api/notification.git] / packaging / notification.spec
1 Name:       notification
2 Summary:    notification library
3 Version:    0.2.5
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                         led_on_ms INTEGER default -1,
93                         led_off_ms INTEGER default -1,
94                         flags_for_property INTEGER default 0,
95                         flag_simmode INTEGER default 0,
96                         display_applist INTEGER,
97                         progress_size DOUBLE default 0,
98                         progress_percentage DOUBLE default 0,
99                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
100                         UNIQUE (caller_pkgname, priv_id)  
101                 ); 
102                 create table if not exists noti_group_data (
103                         caller_pkgname TEXT NOT NULL,
104                         group_id INTEGER default 0,
105                         badge INTEGER default 0,
106                         title TEXT,
107                         content TEXT,
108                         loc_title TEXT,
109                         loc_content TEXT,
110                         count_display_title INTEGER,
111                         count_display_content INTEGER,
112                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
113                         UNIQUE (caller_pkgname, group_id)
114                 );
115                 create  table if not exists ongoing_list ( 
116                         caller_pkgname TEXT NOT NULL,
117                         launch_pkgname TEXT,
118                         icon_path TEXT,
119                         group_id INTEGER default 0,
120                         internal_group_id INTEGER default 0,  
121                         priv_id INTERGER NOT NULL,
122                         title TEXT,
123                         content TEXT,
124                         default_content TEXT,
125                         loc_title TEXT,
126                         loc_content TEXT,
127                         loc_default_content TEXT,
128                         text_domain TEXT,
129                         text_dir TEXT,
130                         args TEXT,  
131                         group_args TEXT,  
132                         flag INTEGER default 0,
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         '
139 fi
140
141 chown :5000 /opt/dbspace/.notification.db
142 chown :5000 /opt/dbspace/.notification.db-journal
143 chmod 660 /opt/dbspace/.notification.db
144 chmod 660 /opt/dbspace/.notification.db-journal
145 chsmack -a 'notification::db' /opt/dbspace/.notification.db*
146 vconftool set -t string memory/private/libstatus/message "" -i -g 5000 -f
147
148 %postun -p /sbin/ldconfig
149
150 %files
151 %manifest notification.manifest
152 %defattr(-,root,root,-)
153 %{_libdir}/libnotification.so*
154 /usr/share/license/%{name}
155
156 %files devel
157 %defattr(-,root,root,-)
158 %{_includedir}/notification/*.h
159 %{_libdir}/pkgconfig/notification.pc