Modification about smack label of db file belong to process.
[apps/core/preloaded/libslp-alarm.git] / packaging / libslp-alarm.spec
1 #sbs-git:slp/apps/l/libslp-alarm libslp-alarm 0.2.7 743c13367284f1394db6db3a2d5a936be5279784
2 # >> macros
3 # << macros
4
5 Name:       libslp-alarm
6 Summary:    libslp-alarm package
7 Version:    0.2.7
8 Release:    59
9 Group:      System/Libraries
10 License:    TBD
11 Source0:    %{name}-%{version}.tar.gz
12 Source1001:     libslp-alarm.manifest
13 Requires(post):  /sbin/ldconfig
14 Requires(post):  /usr/bin/sqlite3
15 Requires(postun):  /sbin/ldconfig
16 BuildRequires:  cmake 
17 BuildRequires:  pkgconfig(gobject-2.0)
18 BuildRequires:  pkgconfig(glib-2.0)
19 BuildRequires:  pkgconfig(vconf)
20 BuildRequires:  pkgconfig(db-util)
21 BuildRequires:  pkgconfig(dlog)
22 BuildRequires:  pkgconfig(alarm-service)
23
24 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
25
26 %description
27
28
29 %package devel
30 Summary:    libslp-alarm dev package
31 Group:      Development/Libraries
32 Requires:   %{name} = %{version}-%{release}
33
34 %description devel
35
36
37 %prep
38 %setup -q -n %{name}-%{version}
39 cp %{SOURCE1001} .
40
41 # >> setup
42 # << setup
43
44 %build
45 # >> build pre
46 # << build pre
47
48 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
49
50 # Call make instruction with smp support
51 make %{?jobs:-j%jobs}
52
53 # >> build post
54 # << build post
55 %install
56 rm -rf %{buildroot}
57 # >> install pre
58 # << install pre
59 %make_install
60
61 # >> install post
62 rm -f %{buildroot}/usr/bin/test_alarmdb
63 # << install post
64
65 %clean
66 rm -rf %{buildroot}
67
68
69
70 %post 
71 /sbin/ldconfig
72 mkdir -p /opt/dbspace/
73 sqlite3 /opt/dbspace/.alarm.db 'PRAGMA journal_mode = PERSIST;
74                                create table if not exists alarm (id INTEGER PRIMARY KEY,
75                                                                           magic INTEGER,
76                                                                           alarm_mgr_id INTEGER,
77                                                                           enable INTEGER,
78                                                                           missed INTEGER,
79                                                                           author INTEGER,
80                                                                           name TEXT,
81                                                                           stime INTEGER,
82                                                                           atime INTEGER,
83                                                                           etime INTEGER,
84                                                                           sdate INTEGER,
85                                                                           edate INTEGER,
86                                                                           timezone TEXT,
87                                                                           repeat_once INTEGER,
88                                                                           repeat_every INTEGER,
89                                                                           repeat_weekly INTEGER,
90                                                                           snooze_enable INTEGER,
91                                                                           snooze_min INTEGER,
92                                                                           snooze_times INTEGER,
93                                                                           count INTEGER,
94                                                                           type INTEGER,
95                                                                           tone TEXT,
96                                                                           volume INTEGER,
97                                                                           auto_power_on INTEGER   );'
98
99
100 # Change file owner
101 #1.libraries
102 #2.executables
103 #3.configurations
104 #4.images
105 #5.edje
106 #6.internatialize
107 #7.etc
108 #chown :5000 /opt/dbspace
109 chown :6001 /opt/dbspace/.alarm.db
110 chown :6001 /opt/dbspace/.alarm.db-journal
111 #chown root:root /opt/dbspace/.alarm.db
112 #chown root:root /opt/dbspace/.alarm.db-journal
113
114 # Change file permissions
115 #1.libraries
116 #2.executables
117 #3.configurations
118 #4.images
119 #5.edje
120 #6.internatialize
121 #7.etc
122 #chmod 775 /opt/dbspace
123 chmod 660 /opt/dbspace/.alarm.db
124 chmod 660 /opt/dbspace/.alarm.db-journal
125 #chmod 600 /opt/dbspace/.alarm.db
126 #chmod 600 /opt/dbspace/.alarm.db-journal
127
128 chsmack -a 'User' /opt/dbspace/.alarm.db*
129
130 %postun -p /sbin/ldconfig
131
132
133
134 %files
135 %manifest %{name}.manifest
136 %defattr(-,root,root,-)
137 # >> files
138 %{_libdir}/*.so*
139 # << files
140
141
142 %files devel
143 %manifest %{name}.manifest
144 %defattr(-,root,root,-)
145 # >> files devel
146 %{_includedir}/*
147 %{_libdir}/pkgconfig/*
148 # << files devel
149