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