36983a5d9e3fc638108ca28f0944a24434bc49ce
[platform/core/appfw/ail.git] / packaging / ail.spec
1 Name:           ail
2 Version:        0.2.80
3 Release:        0
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(libsmack)
14 BuildRequires:  pkgconfig(sqlite3)
15 BuildRequires:  pkgconfig(vconf)
16 BuildRequires:  pkgconfig(xdgmime)
17 BuildRequires:  pkgconfig(libtzplatform-config)
18 Provides:       libail = %{version}-%{release}
19
20 %description
21 Application Information Library package
22
23 %package devel
24 Summary:        Application Information Library Development files
25 Requires:       libail = %{version}-%{release}
26 Requires:       pkgconfig(libtzplatform-config)
27 Requires:       pkgconfig(libsmack)
28
29 %description devel
30 Application Information Library Development files package
31
32 %prep
33 %setup -q
34 cp %{SOURCE1001} .
35
36 %build
37 CFLAGS="$CFLAGS -fpic"
38
39 %if 0%{?tizen_build_binary_release_type_eng}
40 export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
41 export CXXFLAGS="$CXXFLAGS ?DTIZEN_ENGINEER_MODE"
42 export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
43 %endif
44
45 %cmake .  -DTZ_SYS_RW_DESKTOP_APP=%TZ_SYS_RW_DESKTOP_APP \
46           -DBUILD_PKGTYPE=rpm
47
48 %__make %{?_smp_mflags}
49
50 %install
51 %make_install
52
53 %post
54 ldconfig
55 # Create tizenglobalapp user needed for global installation
56 useradd -d %TZ_SYS_RW_APP -m %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g root
57
58 #mkdir -p %%TZ_SYS_RW_APP/.config/xwalk-service/applications
59 #cd %%TZ_SYS_RW_APP/
60 #ln -s .config/xwalk-service/applications/
61
62 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
63 vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
64 vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s system::vconf_inhouse
65 chsmack -a User %TZ_SYS_CONFIG/db/ail
66 chsmack -a User %TZ_SYS_CONFIG/db/ail/ail_info
67 chsmack -a User %TZ_SYS_CONFIG/db/menuscreen
68 chsmack -a User %TZ_SYS_CONFIG/db/menuscreen/desktop
69 chsmack -a User %TZ_SYS_CONFIG/db/menu_widget
70 chsmack -a User %TZ_SYS_CONFIG/db/menu_widget/language
71
72 mkdir -p %{TZ_SYS_RO_DESKTOP_APP}
73 mkdir -p %{TZ_SYS_RW_DESKTOP_APP}
74 mkdir -p %{TZ_SYS_RW_APP}
75 mkdir -p %{TZ_SYS_DB}
76 mkdir -p %{TZ_SYS_RW_ICONS}/default/small
77
78 chsmack -a '*' %{TZ_SYS_DB}
79 chsmack -a '*' %{TZ_SYS_RW_APP}
80 chsmack -a '*' %{TZ_SYS_RW_DESKTOP_APP}
81 chsmack -a '*' %{TZ_SYS_RO_DESKTOP_APP}
82 chsmack -a '*' %{TZ_SYS_RW_ICONS}
83 chsmack -a '*' %{TZ_SYS_RW_ICONS}/default
84 chsmack -a '*' %{TZ_SYS_RW_ICONS}/default/small/
85
86 chmod g+w %{TZ_SYS_RW_DESKTOP_APP}
87 chmod g+w %{TZ_SYS_RO_DESKTOP_APP}
88 chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RW_DESKTOP_APP}
89 chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RO_DESKTOP_APP}
90 chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RW_APP}
91 chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_DB}
92 chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_DB}
93 chown %TZ_SYS_GLOBALAPP_USER:root -R %{TZ_SYS_RW_ICONS}
94
95 ail_createdb 2>/dev/null
96 ail_syncdb 2>/dev/null
97 chsmack -a '*' %{TZ_SYS_DB}/.app_info.db*
98  
99 %postun
100 /sbin/ldconfig
101 if [ $1 == 0 ]; then
102     rm -f %{TZ_SYS_DB}/.app_info.db*
103 fi
104
105 %files
106 %manifest %{name}.manifest
107 %license LICENSE
108 %attr(06775,root,root) %{_bindir}/ail_createdb
109 %attr(0775,root,root) %{_bindir}/ail_createdb_user
110 %attr(06775,root,root) %{_bindir}/ail_syncdb
111 %attr(0775,root,root) %{_bindir}/ail_syncdb_user
112 #obsolete tools
113 %attr(06775,root,root) %{_bindir}/ail_initdb
114 %attr(0775,root,root) %{_bindir}/ail_initdb_user
115 %{_bindir}/ail_fota
116 %{_bindir}/ail_desktop
117 %{_bindir}/ail_filter
118 %{_bindir}/ail_list
119 %{_bindir}/ail_package
120 %{_datadir}/install-info/*
121 %{_libdir}/libail.so.0
122 %{_libdir}/libail.so.0.1.0
123
124 %files devel
125 %manifest %{name}.manifest
126 %{_includedir}/ail.h
127 %{_libdir}/libail.so
128 %{_libdir}/pkgconfig/ail.pc