Cleanup spec
[platform/core/appfw/ail.git] / packaging / ail.spec
1 #sbs-git:slp/pkgs/a/ail ail 0.2.22 29ac1f2c98453cad647cca6a92abc7da3dbb047b
2 Name:       ail
3 Summary:    Application Information Library
4 Version:    0.2.68
5 Release:    1
6 Group:      System/Libraries
7 License:    Apache License, Version 2.0
8 Source0:    %{name}-%{version}.tar.gz
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
33 %build
34 CFLAGS+=" -fpic"
35 %cmake .  -DBUILD_PKGTYPE=rpm
36
37 make %{?jobs:-j%jobs}
38
39 %install
40 %make_install
41
42 mkdir -p %{buildroot}/opt/dbspace/
43 mkdir -p %{buildroot}/opt/share/applications/
44
45 %post
46 vconftool set -t string db/ail/ail_info "0" -f
47 vconftool set -t string db/menuscreen/desktop "0" -f
48 vconftool set -t string db/menu_widget/language "US" -f
49
50 CHDBGID="6010"
51
52 update_DAC_for_db_file()
53 {
54         if [ ! -f $@ ]; then
55                 touch $@
56         fi
57
58         chown :$CHDBGID $@ 2>/dev/null
59         if [ $? -ne 0 ]; then
60                 echo "Failed to change the owner of $@"
61         fi
62         chmod 664 $@ 2>/dev/null
63         if [ $? -ne 0 ]; then
64                 echo "Failed to change the perms of $@"
65         fi
66 }
67 ail_initdb
68 update_DAC_for_db_file /opt/dbspace/.app_info.db
69 update_DAC_for_db_file /opt/dbspace/.app_info.db-journal
70
71 %postun
72 rm -f /opt/dbspace/.app_info.db*
73
74 %files
75 %manifest ail.manifest
76 %{_libdir}/libail.so.0
77 %{_libdir}/libail.so.0.1.0
78 /opt/dbspace
79 /opt/share/applications
80 /usr/bin/ail_initdb
81 /usr/share/install-info/*
82
83 %files devel
84 /usr/include/ail.h
85 %{_libdir}/libail.so
86 %{_libdir}/pkgconfig/ail.pc