Sync to the latest code
[platform/core/appfw/ail.git] / packaging / ail.spec
1 Name:           ail
2 Version:        0.2.80
3 Release:        1
4 License:        Apache-2.0
5 Summary:        Application Information Library
6 Group:          Application Framework/Libraries
7 Source0:        %{name}-%{version}.tar.gz
8 Source1001:     ail.manifest
9 BuildRequires:  cmake
10 BuildRequires:  vconf-keys-devel
11 BuildRequires:  pkgconfig(db-util)
12 BuildRequires:  pkgconfig(dlog)
13 BuildRequires:  pkgconfig(sqlite3)
14 BuildRequires:  pkgconfig(vconf)
15 BuildRequires:  pkgconfig(xdgmime)
16 Provides:       libail = %{version}-%{release}
17
18 %description
19 Application Information Library
20
21 %package devel
22 Summary:        Application Information Library Development files
23 Requires:       libail = %{version}-%{release}
24
25 %description devel
26 Application Information Library (devel)
27
28 %prep
29 %setup -q
30 cp %{SOURCE1001} .
31
32 %build
33 CFLAGS+=" -fpic"
34
35 %if 0%{?tizen_build_binary_release_type_eng}
36 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
37 export CXXFLAGS="$CXXFLAGS ?DTIZEN_ENGINEER_MODE"
38 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
39 %endif
40
41 %cmake .  -DBUILD_PKGTYPE=rpm \
42                   -DSMACK=Off
43
44 make %{?_smp_mflags}
45
46 %install
47 %make_install
48
49 mkdir -p %{buildroot}/opt/dbspace/
50 mkdir -p %{buildroot}/opt/share/applications/
51
52 %post
53 /sbin/ldconfig
54 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
55 vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
56 vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s system::vconf_inhouse
57
58 CHDBGID="6010"
59
60 update_DAC_for_db_file()
61 {
62         if [ ! -f $@ ]; then
63                 touch $@
64         fi
65
66         chown :$CHDBGID $@ 2>/dev/null
67         if [ $? -ne 0 ]; then
68                 echo "Failed to change the owner of $@"
69         fi
70         chmod 664 $@ 2>/dev/null
71         if [ $? -ne 0 ]; then
72                 echo "Failed to change the perms of $@"
73         fi
74 }
75 ail_initdb
76 mkdir -p /usr/share/applications
77 mkdir -p /opt/share/applications
78 mkdir -p /opt/dbspace/
79
80 update_DAC_for_db_file /opt/dbspace/.app_info.db
81 update_DAC_for_db_file /opt/dbspace/.app_info.db-journal
82
83 %postun
84 /sbin/ldconfig
85 if [ $1 == 0 ]; then
86 rm -f /opt/dbspace/.app_info.db*
87 fi
88
89
90 %files
91 %manifest %{name}.manifest
92 %license LICENSE
93 %dir /opt/share/applications
94 %{_bindir}/ail_initdb
95 %{_datadir}/install-info/*
96 %{_libdir}/libail.so.0
97 %{_libdir}/libail.so.0.1.0
98 /usr/bin/ail_initdb
99 /usr/bin/ail_fota
100 /usr/bin/ail_desktop
101 /usr/bin/ail_filter
102 /usr/bin/ail_package
103 /usr/share/install-info/*
104
105 %files devel
106 %manifest %{name}.manifest
107 %{_includedir}/ail.h
108 %{_libdir}/libail.so
109 %{_libdir}/pkgconfig/ail.pc