f45c5d9a17ed406a400ac85896ebc08598452811
[platform/core/api/notification.git] / packaging / notification.spec
1 Name:       notification
2 Summary:    notification library
3 Version:    0.1.1
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
20 BuildRequires: cmake
21 Requires(post): /sbin/ldconfig
22 Requires(post): /usr/bin/sqlite3
23 requires(postun): /sbin/ldconfig
24
25 %description
26 Notificaiton library.
27
28 %prep
29 %setup -q
30
31 %package devel
32 Summary:    Notification library (devel)
33 Group:      Development/Libraries
34 Requires:   %{name} = %{version}-%{release}
35
36 %description devel
37 Notificaiton library (devel).
38
39 %build
40 export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
41 LDFLAGS="$LDFLAGS" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
42 make %{?jobs:-j%jobs}
43
44 %install
45 rm -rf %{buildroot}
46 %make_install
47
48 %clean
49 rm -rf %{buildroot}
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                         caller_pkgname TEXT NOT NULL,
65                         launch_pkgname TEXT,
66                         image_path TEXT,
67                         group_id INTEGER default 0,  
68                         internal_group_id INTEGER default 0,  
69                         priv_id INTERGER NOT NULL,  
70                         title_key TEXT,
71                         b_text TEXT,
72                         b_key TEXT,
73                         b_format_args TEXT,
74                         num_format_args INTEGER default 0,
75                         text_domain TEXT,
76                         text_dir TEXT,
77                         time INTEGER default 0,  
78                         insert_time INTEGER default 0,  
79                         args TEXT,  
80                         group_args TEXT,  
81                         b_execute_option TEXT,
82                         b_service_responding TEXT,
83                         b_service_single_launch TEXT,
84                         b_service_multi_launch TEXT,
85                         sound_type INTEGER default 0,
86                         sound_path TEXT,
87                         vibration_type INTEGER default 0,
88                         vibration_path TEXT,
89                         flags_for_property INTEGER default 0,
90                         flag_simmode INTEGER default 0,
91                         display_applist INTEGER,
92                         progress_size DOUBLE default 0,
93                         progress_percentage DOUBLE default 0,
94                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
95                         UNIQUE (caller_pkgname, priv_id)  
96                 ); 
97                 create table if not exists noti_group_data (
98                         caller_pkgname TEXT NOT NULL,
99                         group_id INTEGER default 0,
100                         badge INTEGER default 0,
101                         title TEXT,
102                         content TEXT,
103                         loc_title TEXT,
104                         loc_content TEXT,
105                         count_display_title INTEGER,
106                         count_display_content INTEGER,
107                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
108                         UNIQUE (caller_pkgname, group_id)
109                 );
110                 create  table if not exists ongoing_list ( 
111                         caller_pkgname TEXT NOT NULL,
112                         launch_pkgname TEXT,
113                         icon_path TEXT,
114                         group_id INTEGER default 0,
115                         internal_group_id INTEGER default 0,  
116                         priv_id INTERGER NOT NULL,
117                         title TEXT,
118                         content TEXT,
119                         default_content TEXT,
120                         loc_title TEXT,
121                         loc_content TEXT,
122                         loc_default_content TEXT,
123                         text_domain TEXT,
124                         text_dir TEXT,
125                         args TEXT,  
126                         group_args TEXT,  
127                         flag INTEGER default 0,
128                         progress_size DOUBLE default 0,
129                         progress_percentage DOUBLE default 0,
130                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
131                         UNIQUE (caller_pkgname, priv_id)  
132                 ); 
133         '
134 fi
135
136 chown root:5000 /opt/dbspace/.notification.db
137 chown root:5000 /opt/dbspace/.notification.db-journal
138 chmod 660 /opt/dbspace/.notification.db
139 chmod 660 /opt/dbspace/.notification.db-journal
140
141 %postun -p /sbin/ldconfig
142
143 %files
144 %defattr(-,root,root,-)
145 %{_libdir}/libnotification.so*
146
147 %files devel
148 %defattr(-,root,root,-)
149 %{_includedir}/notification/*.h
150 %{_libdir}/pkgconfig/notification.pc
151