Merge "modified license text in spec file." into tizen_2.3
[platform/core/api/notification.git] / packaging / notification.spec
1 Name:       notification
2 Summary:    notification library
3 Version:    0.2.23
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                         sound_type INTEGER default 0,
115                         sound_path TEXT,
116                         vibration_type INTEGER default 0,
117                         vibration_path TEXT,
118                         led_operation INTEGER default 0,
119                         led_argb INTEGER default 0,
120                         led_on_ms INTEGER default -1,
121                         led_off_ms INTEGER default -1,
122                         flags_for_property INTEGER default 0,
123                         flag_simmode INTEGER default 0,
124                         display_applist INTEGER,
125                         progress_size DOUBLE default 0,
126                         progress_percentage DOUBLE default 0,
127                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
128                         UNIQUE (caller_pkgname, priv_id)  
129                 ); 
130                 create table if not exists noti_group_data (
131                         caller_pkgname TEXT NOT NULL,
132                         group_id INTEGER default 0,
133                         badge INTEGER default 0,
134                         title TEXT,
135                         content TEXT,
136                         loc_title TEXT,
137                         loc_content TEXT,
138                         count_display_title INTEGER,
139                         count_display_content INTEGER,
140                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,
141                         UNIQUE (caller_pkgname, group_id)
142                 );
143                 create  table if not exists ongoing_list ( 
144                         caller_pkgname TEXT NOT NULL,
145                         launch_pkgname TEXT,
146                         icon_path TEXT,
147                         group_id INTEGER default 0,
148                         internal_group_id INTEGER default 0,  
149                         priv_id INTERGER NOT NULL,
150                         title TEXT,
151                         content TEXT,
152                         default_content TEXT,
153                         loc_title TEXT,
154                         loc_content TEXT,
155                         loc_default_content TEXT,
156                         text_domain TEXT,
157                         text_dir TEXT,
158                         args TEXT,  
159                         group_args TEXT,  
160                         flag INTEGER default 0,
161                         progress_size DOUBLE default 0,
162                         progress_percentage DOUBLE default 0,
163                         rowid INTEGER PRIMARY KEY AUTOINCREMENT,        
164                         UNIQUE (caller_pkgname, priv_id)  
165                 ); 
166         '
167 fi
168
169 chown :5000 /opt/dbspace/.notification.db
170 chown :5000 /opt/dbspace/.notification.db-journal
171 chmod 640 /opt/dbspace/.notification.db
172 chmod 640 /opt/dbspace/.notification.db-journal
173 if [ -f /usr/lib/rpm-plugins/msm.so ]
174 then
175     chsmack -a 'notification::db' /opt/dbspace/.notification.db*
176 fi
177 SMACK_OPTION="-s system::vconf_misc"
178 vconftool set -t string memory/private/libstatus/message "" -i -g 5000 -f  $SMACK_OPTION
179
180 %postun -p /sbin/ldconfig
181
182 %files
183 %manifest notification.manifest
184 %defattr(-,root,root,-)
185 %{_libdir}/libnotification.so*
186 /usr/share/license/%{name}
187
188 %files devel
189 %defattr(-,root,root,-)
190 %{_includedir}/notification/notification.h
191 %{_includedir}/notification/notification_internal.h
192 %{_includedir}/notification/notification_error.h
193 %{_includedir}/notification/notification_type.h
194 %{_includedir}/notification/notification_list.h
195 %{_includedir}/notification/notification_status.h
196 %{_libdir}/pkgconfig/notification.pc
197
198 %files service-devel
199 %defattr(-,root,root,-)
200 %{_includedir}/notification/service/notification_ipc.h
201 %{_includedir}/notification/service/notification_noti.h
202 %{_includedir}/notification/service/notification_setting_service.h
203 %{_libdir}/pkgconfig/notification-service.pc