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