add Requires(post), tigger submission to OBS
[apps/home/libslp-alarm.git] / packaging / libslp-alarm.spec
1 Name:       libslp-alarm
2 Summary:    libslp-alarm package
3 Version:    0.2.7
4 Release:    58
5 Group:      System/Libraries
6 License:    Samsung Proprietary License
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: packaging/libslp-alarm.manifest 
9 Requires(post):  /sbin/ldconfig
10 Requires(post):  /usr/bin/sqlite3
11 Requires(post):  /bin/chown
12 Requires(post):  /bin/chmod
13 Requires(postun):  /sbin/ldconfig
14 BuildRequires:  cmake 
15 BuildRequires:  pkgconfig(gobject-2.0)
16 BuildRequires:  pkgconfig(glib-2.0)
17 BuildRequires:  pkgconfig(vconf)
18 BuildRequires:  pkgconfig(db-util)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(vconf)
21 BuildRequires:  pkgconfig(dbus-1)
22 BuildRequires:  pkgconfig(alarm-service)
23 BuildRequires:  vconf-keys-devel
24
25 #Patch0: vconf.patch
26
27
28 %description
29 Alarm Libraries
30
31 %package devel
32 Summary:    libslp-alarm dev package
33 Group:      Development/Libraries
34 Requires:   %{name} = %{version}-%{release}
35
36 %description devel
37 Development files from %{name}.
38
39
40 %prep
41 %setup -q -n %{name}-%{version}
42 #%patch0 -p1
43
44
45 %build
46 cp %{SOURCE1001} .
47
48 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
49
50 make %{?jobs:-j%jobs}
51
52 %install
53 %make_install
54
55 rm -f %{buildroot}/usr/bin/test_alarmdb
56
57
58
59 %post 
60 /sbin/ldconfig
61 mkdir -p /opt/dbspace/
62 sqlite3 /opt/dbspace/.alarm.db 'PRAGMA journal_mode = PERSIST;
63                                create table if not exists alarm (id INTEGER PRIMARY KEY autoincrement, 
64                                                                                                         magic INTEGER,
65                                                                                                         alarm_mgr_id INTEGER, 
66                                                                                                         enable INTEGER, 
67                                                                                                         missed INTEGER, 
68                                                                                                         author INTEGER, 
69                                                                                                         name TEXT, 
70                                                                                                         stime INTEGER, 
71                                                                                                         atime INTEGER, 
72                                                                                                         etime INTEGER, 
73                                                                                                         sdate INTEGER, 
74                                                                                                         edate INTEGER, 
75                                                     timezone TEXT,
76                                                                                                         repeat_once INTEGER, 
77                                                                                                         repeat_every INTEGER, 
78                                                                                                         repeat_weekly INTEGER, 
79                                                                                                         snooze_enable INTEGER, 
80                                                                                                         snooze_min INTEGER, 
81                                                                                                         snooze_times INTEGER, 
82                                                                                                         count INTEGER, 
83                                                                                                         type INTEGER, 
84                                                                                                         tone TEXT, 
85                                                                                                         volume INTEGER, 
86                                                                                                         auto_power_on INTEGER   );'
87 chown :6001 /opt/dbspace/.alarm.db
88 chown :6001 /opt/dbspace/.alarm.db-journal
89 chmod 660 /opt/dbspace/.alarm.db
90 chmod 660 /opt/dbspace/.alarm.db-journal
91
92
93 %postun -p /sbin/ldconfig
94
95 %files
96 %manifest libslp-alarm.manifest
97 %{_libdir}/*.so*
98
99
100 %files devel
101 %manifest libslp-alarm.manifest
102 %{_includedir}/*
103 %{_libdir}/pkgconfig/*
104