Merge from tizen 2.4 latest
[platform/core/appfw/shortcut.git] / packaging / libshortcut.spec
1 Name: libshortcut
2 Summary: Shortcut add feature supporting library
3 Version: 0.6.16
4 Release: 0
5 Group: Applications/Core Applications
6 License: Apache-2.0
7 Source0: %{name}-%{version}.tar.gz
8 Source1001: %{name}.manifest
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12
13 BuildRequires: cmake, gettext-tools, coreutils
14 BuildRequires: pkgconfig(glib-2.0)
15 BuildRequires: pkgconfig(dlog)
16 BuildRequires: pkgconfig(db-util)
17 BuildRequires: pkgconfig(sqlite3)
18 BuildRequires: pkgconfig(com-core)
19 BuildRequires: pkgconfig(libxml-2.0)
20 BuildRequires: pkgconfig(vconf)
21 BuildRequires: pkgconfig(capi-base-common)
22 BuildRequires: pkgconfig(aul)
23 BuildRequires: pkgconfig(libtzplatform-config)
24
25 %description
26 [Shortcut] AddToHome feature supporting library for menu/home screen developers.
27
28 %package devel
29 Summary:    AddToHome feature supporting library development files
30 Group:      Development/Libraries
31 Requires:   %{name} = %{version}-%{release}
32
33 %description devel
34 [Shortcut] AddToHome feature supporting library for menu/home screen developers(dev).
35
36 %prep
37 %setup -q
38 cp %{SOURCE1001} .
39
40 %build
41 %if 0%{?sec_build_binary_debug_enable}
42 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
43 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
44 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
45 %endif
46 %if 0%{?tizen_build_binary_release_type_eng}
47 export CFLAGS="${CFLAGS} -DTIZEN_ENGINEER_MODE"
48 export CXXFLAGS="${CXXFLAGS} -DTIZEN_ENGINEER_MODE"
49 export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
50 %endif
51
52 %cmake . -DSYSCONFDIR=%{_sysconfdir} -DDB_PATH=%{TZ_SYS_DB}/.shortcut_service.db
53 make %{?jobs:-j%jobs}
54
55 %install
56 rm -rf %{buildroot}
57
58 %make_install
59 mkdir -p %{buildroot}%{TZ_SYS_DB}
60
61 %post
62 /sbin/ldconfig
63
64 if [ ! -d %{TZ_SYS_DB} ]
65 then
66         mkdir %{TZ_SYS_DB}
67 fi
68
69 if [ ! -f %{TZ_SYS_DB}/.shortcut_service.db ]
70 then
71         sqlite3 %{TZ_SYS_DB}/.shortcut_service.db 'PRAGMA journal_mode = PERSIST;
72                 CREATE TABLE shortcut_service (
73                 id INTEGER PRIMARY KEY AUTOINCREMENT,
74                 pkgid TEXT,
75                 appid TEXT,
76                 icon TEXT,
77                 name TEXT,
78                 extra_key TEXT,
79                 extra_data TEXT);
80
81                 CREATE TABLE shortcut_name (
82                 id INTEGER,
83                 pkgid TEXT,
84                 lang TEXT,
85                 name TEXT,
86                 icon TEXT);
87         '
88 fi
89
90 chmod 664 %{TZ_SYS_DB}/.shortcut_service.db
91 chmod 664 %{TZ_SYS_DB}/.shortcut_service.db-journal
92 chsmack -a User::Home %{TZ_SYS_DB}/.shortcut_service.db
93 chsmack -a User::Home %{TZ_SYS_DB}/.shortcut_service.db-journal
94
95 %postun -n %{name} -p /sbin/ldconfig
96
97 %files -n libshortcut
98 %manifest %{name}.manifest
99 %defattr(-,root,root,-)
100 %{_libdir}/*.so*
101 %{_sysconfdir}/package-manager/parserlib/*
102 %{_datarootdir}/license/*
103
104 %files devel
105 %manifest %{name}.manifest
106 %defattr(-,root,root,-)
107 %{_includedir}/shortcut/shortcut.h
108 %{_includedir}/shortcut/shortcut_private.h
109 %{_includedir}/shortcut/shortcut_manager.h
110 %{_libdir}/pkgconfig/shortcut.pc
111
112 # End of a file