Modification about smack label of db file belong to process.
[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 BuildRequires:  pkgconfig(libtzplatform-config)
17 Provides:       libail = %{version}-%{release}
18
19 %description
20 Application Information Library
21
22 %package devel
23 Summary:        Application Information Library Development files
24 Requires:       libail = %{version}-%{release}
25
26 %description devel
27 Application Information Library (devel)
28
29 %prep
30 %setup -q
31 cp %{SOURCE1001} .
32
33 %build
34 CFLAGS+=" -fpic"
35
36 %if 0%{?tizen_build_binary_release_type_eng}
37 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
38 export CXXFLAGS="$CXXFLAGS ?DTIZEN_ENGINEER_MODE"
39 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
40 %endif
41
42 %cmake .  -DBUILD_PKGTYPE=rpm \
43                   -DSMACK=Off
44
45 make %{?_smp_mflags}
46
47 %install
48 %make_install
49
50 mkdir -p %{buildroot}%{TZ_SYS_DB}/
51 mkdir -p %{buildroot}%{TZ_SYS_RW_DESKTOP_APP}/
52
53 %post
54 /sbin/ldconfig
55 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
56 vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
57 vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s system::vconf_inhouse
58
59 CHDBGID="6010"
60
61 update_DAC_for_db_file()
62 {
63         if [ ! -f $@ ]; then
64                 touch $@
65         fi
66
67         chown :$CHDBGID $@ 2>/dev/null
68         if [ $? -ne 0 ]; then
69                 echo "Failed to change the owner of $@"
70         fi
71         chmod 664 $@ 2>/dev/null
72         if [ $? -ne 0 ]; then
73                 echo "Failed to change the perms of $@"
74         fi
75 }
76 ail_initdb
77 mkdir -p %{TZ_SYS_RO_DESKTOP_APP}
78 mkdir -p %{TZ_SYS_RW_DESKTOP_APP}
79 mkdir -p %{TZ_SYS_DB}
80
81 update_DAC_for_db_file %{TZ_SYS_DB}/.app_info.db
82 update_DAC_for_db_file %{TZ_SYS_DB}/.app_info.db-journal
83 chsmack -a 'User' %{TZ_SYS_DB}/.app_info.db*
84
85 %postun
86 /sbin/ldconfig
87 if [ $1 == 0 ]; then
88 rm -f %{TZ_SYS_DB}/.app_info.db*
89 fi
90
91
92 %files
93 %manifest %{name}.manifest
94 %license LICENSE
95 %dir %{TZ_SYS_RW_DESKTOP_APP}
96 %{_bindir}/ail_initdb
97 %{_bindir}/ail_initdb
98 %{_bindir}/ail_fota
99 %{_bindir}/ail_desktop
100 %{_bindir}/ail_filter
101 %{_bindir}/ail_package
102 %{_datadir}/install-info/*
103 %{_libdir}/libail.so.0
104 %{_libdir}/libail.so.0.1.0
105
106 %files devel
107 %manifest %{name}.manifest
108 %{_includedir}/ail.h
109 %{_libdir}/libail.so
110 %{_libdir}/pkgconfig/ail.pc