Merge branch 'tizen_2.2' into tizen
[platform/core/appfw/ail.git] / packaging / ail.spec
1 Name:       ail
2 Summary:    Application Information Library
3 Version:    0.2.73
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache License, Version 2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001:     ail.manifest
9 Requires(post): /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11 BuildRequires:  cmake
12 BuildRequires:  vconf-keys-devel
13 BuildRequires:  pkgconfig(sqlite3)
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(db-util)
17 BuildRequires:  pkgconfig(xdgmime)
18
19 %description
20 Application Information Library
21
22 %package devel
23 Summary:    Application Information Library Development files
24 Group:      Development/Libraries
25 Requires:   %{name} = %{version}-%{release}
26
27 %description devel
28 Application Information Library (devel)
29
30 %prep
31 %setup -q
32 cp %{SOURCE1001} .
33
34 %build
35 CFLAGS+=" -fpic"
36 %cmake .  -DBUILD_PKGTYPE=rpm
37
38 make %{?jobs:-j%jobs}
39
40 %install
41 %make_install
42
43 mkdir -p %{buildroot}/opt/dbspace/
44 mkdir -p %{buildroot}/opt/share/applications/
45
46 %post
47 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
48 vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
49 vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s system::vconf_inhouse
50
51 CHDBGID="6010"
52
53 update_DAC_for_db_file()
54 {
55         if [ ! -f $@ ]; then
56                 touch $@
57         fi
58
59         chown :$CHDBGID $@ 2>/dev/null
60         if [ $? -ne 0 ]; then
61                 echo "Failed to change the owner of $@"
62         fi
63         chmod 664 $@ 2>/dev/null
64         if [ $? -ne 0 ]; then
65                 echo "Failed to change the perms of $@"
66         fi
67 }
68 ail_initdb
69 update_DAC_for_db_file /opt/dbspace/.app_info.db
70 update_DAC_for_db_file /opt/dbspace/.app_info.db-journal
71
72 %postun
73 if [ $1 == 0 ]; then
74 rm -f /opt/dbspace/.app_info.db*
75 fi
76
77 %files
78 %manifest %{name}.manifest
79 %{_libdir}/libail.so.0
80 %{_libdir}/libail.so.0.1.0
81 /opt/share/applications
82 /usr/bin/ail_initdb
83 /usr/share/install-info/*
84
85 %files devel
86 %manifest %{name}.manifest
87 /usr/include/ail.h
88 %{_libdir}/libail.so
89 %{_libdir}/pkgconfig/ail.pc