Add pkg db recovery tool
[platform/core/appfw/pkgmgr-info.git] / packaging / pkgmgr-info.spec
1 Name:       pkgmgr-info
2 Summary:    Packager Manager infomation api for package
3 Version:    0.3.1
4 Release:    1
5 Group:      Application Framework/Package Management
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: pkgmgr-info.manifest
9 BuildRequires: cmake
10 BuildRequires: pkgconfig(dlog)
11 BuildRequires: pkgconfig(vconf)
12 BuildRequires: pkgconfig(sqlite3)
13 BuildRequires: pkgconfig(db-util)
14 BuildRequires: pkgconfig(libxml-2.0)
15 BuildRequires: pkgconfig(libtzplatform-config)
16 BuildRequires: pkgconfig(libsmack)
17 BuildRequires: pkgconfig(bundle)
18 BuildRequires: pkgconfig(capi-system-info)
19
20 %description
21 Packager Manager infomation api for packaging
22
23 %package devel
24 Summary:    Packager Manager infomation api (devel)
25 Requires:   %{name} = %{version}-%{release}
26 %description devel
27 Packager Manager infomation api (devel)
28
29 %package parser
30 Summary:    Library for manifest parser
31 Requires:   %{name} = %{version}-%{release}
32
33 %description parser
34 Library for manifest parser
35
36 %package parser-devel
37 Summary:    Dev package for libpkgmgr-parser
38 Requires:   %{name}-parser = %{version}-%{release}
39 Requires:       pkgconfig(libtzplatform-config)
40
41 %description parser-devel
42 Dev package for libpkgmgr-parser
43
44
45 %prep
46 %setup -q
47 cp %{SOURCE1001} .
48
49 %build
50 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
51 %cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
52                 -DTIZEN_MAJOR_VER=%{tizen_version_major} \
53                 -DTIZEN_MINOR_VER=%{tizen_version_minor} \
54                 -DTIZEN_PATCH_VER=%{tizen_version_patch} \
55                 -DUNITDIR=%{_unitdir}
56
57 %__make %{?jobs:-j%jobs}
58
59 %install
60 %make_install
61
62 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
63 ln -sf ../pkg-db-recovery.service %{buildroot}%{_unitdir}/multi-user.target.wants/pkg-db-recovery.service
64
65 mkdir -p %{buildroot}/usr/share/license
66 cp LICENSE %{buildroot}/usr/share/license/%{name}
67 cp LICENSE %{buildroot}/usr/share/license/%{name}-parser
68
69 %post
70 /sbin/ldconfig
71
72 %postun -p /sbin/ldconfig
73
74 %post -n pkgmgr-info-parser -p /sbin/ldconfig
75
76 %postun  -n pkgmgr-info-parser -p /sbin/ldconfig
77
78 %files
79 %manifest %{name}.manifest
80 %defattr(-,root,root,-)
81 %{_libdir}/libpkgmgr-info.so.*
82 /usr/share/license/%{name}
83 %{_bindir}/pkg-db-recovery
84 %{_unitdir}/pkg-db-recovery.service
85 %{_unitdir}/multi-user.target.wants/pkg-db-recovery.service
86
87 %files devel
88 %manifest %{name}.manifest
89 %defattr(-,root,root,-)
90 %{_includedir}/*.h
91 %{_libdir}/pkgconfig/pkgmgr-info.pc
92 %{_libdir}/libpkgmgr-info.so
93
94 %files parser
95 %manifest %{name}.manifest
96 %defattr(-,root,root,-)
97 %{_libdir}/libpkgmgr_parser.so.*
98 %config %{_sysconfdir}/package-manager/preload/manifest.xsd
99 %config %{_sysconfdir}/package-manager/preload/xml.xsd
100 %config %{_sysconfdir}/package-manager/parser_path.conf
101 %config %{_sysconfdir}/package-manager/parserlib/metadata/mdparser_list.txt
102 %config %{_sysconfdir}/package-manager/parserlib/category/category_parser_list.txt
103 %config %{_sysconfdir}/package-manager/parserlib/tag_parser_list.txt
104 /usr/share/license/%{name}-parser
105
106 %files parser-devel
107 %manifest %{name}.manifest
108 %defattr(-,root,root,-)
109 %{_includedir}/pkgmgr/*.h
110 %{_libdir}/pkgconfig/pkgmgr-parser.pc
111 %{_libdir}/libpkgmgr_parser.so