1a0c9068fb843e10a9372996fb6eb6d859f34888
[packages/AppStream.git] / AppStream.spec
1 #
2 # Conditional build:
3 %bcond_without  apidocs         # API documentation build
4 %bcond_without  qt              # Qt library (libappstream-qt)
5 %bcond_with     qt4             # Qt 4.x instead of Qt 5 (note: devel supports only single package at a time)
6 %bcond_without  vala            # Vala API (VAPI)
7
8 Summary:        AppStream-Core library and tools
9 Summary(pl.UTF-8):      Biblioteka i narzędzia AppStream-Core
10 Name:           AppStream
11 Version:        0.8.0
12 Release:        2
13 License:        LGPL v2.1+
14 Group:          Libraries
15 Source0:        http://www.freedesktop.org/software/appstream/releases/%{name}-%{version}.tar.xz
16 # Source0-md5:  9efd0d73f7b0b9391c862cb925b729cf
17 Patch0:         %{name}-cmake.patch
18 URL:            http://www.freedesktop.org/wiki/Distributions/AppStream/Software/
19 BuildRequires:  cmake >= 2.8.12
20 BuildRequires:  gettext-tools
21 BuildRequires:  glib2-devel >= 1:2.36
22 BuildRequires:  gobject-introspection-devel
23 BuildRequires:  intltool
24 BuildRequires:  libstdc++-devel
25 BuildRequires:  libxml2-devel >= 2.0
26 BuildRequires:  pkgconfig
27 BuildRequires:  tar >= 1:1.22
28 %{?with_vala:BuildRequires:     vala}
29 BuildRequires:  xapian-core-devel >= 1.2
30 BuildRequires:  xz
31 BuildRequires:  yaml-devel >= 0.1
32 %if %{with qt}
33 %if %{with qt4}
34 BuildRequires:  QtCore-devel >= 4.8.0
35 BuildRequires:  qt4-qmake >= 4.8.0
36 %else
37 BuildRequires:  Qt5Core-devel >= 5.0
38 BuildRequires:  qt5-qmake >= 5.0
39 %endif
40 %endif
41 %if %{with apidocs}
42 BuildRequires:  gtk-doc
43 BuildRequires:  publican
44 BuildRequires:  xmlto
45 %endif
46 Requires:       glib2 >= 1:2.36
47 Requires:       xapian-core-libs >= 1.2
48 Obsoletes:      PackageKit-plugin-appstream
49 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50
51 %description
52 AppStream-Core library and tools to access the AppStream component
53 database.
54
55 %description -l pl.UTF-8
56 Biblioteka i narzędzia AppStream-Core służące do dostępu do bazy
57 danych komponentu AppStream.
58
59 %package devel
60 Summary:        Header files for AppStream library
61 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppStream
62 Group:          Development/Libraries
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       glib2-devel >= 1:2.36
65
66 %description devel
67 Header files for AppStream library.
68
69 %description devel -l pl.UTF-8
70 Pliki nagłówkowe biblioteki AppStream.
71
72 %package apidocs
73 Summary:        AppStream API documentation
74 Summary(pl.UTF-8):      Dokumentacja API biblioteki AppStream
75 Group:          Documentation
76 %if "%{_rpmversion}" >= "5"
77 BuildArch:      noarch
78 %endif
79
80 %description apidocs
81 API documentation for AppStream library.
82
83 %description apidocs -l pl.UTF-8
84 Dokumentacja API biblioteki AppStream.
85
86 %package qt
87 Summary:        AppstreamQt library
88 Summary(pl.UTF-8):      Biblioteka AppstreamQt
89 Group:          Libraries
90 %if %{with qt4}
91 Requires:       QtCore >= 4.8.0
92 %else
93 Requires:       Qt5Core >= 5.0
94 %endif
95 Requires:       xapian-core-libs >= 1.2
96
97 %description qt
98 AppstreamQt library.
99
100 %description qt -l pl.UTF-8
101 Biblioteka AppstreamQt.
102
103 %package qt-devel
104 Summary:        Header files for AppstreamQt library
105 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki AppstreamQt
106 Group:          Libraries
107 Requires:       %{name}-qt = %{version}-%{release}
108 %if %{with qt4}
109 Requires:       QtCore-devel >= 4.8.0
110 %else
111 Requires:       Qt5Core-devel >= 5.0
112 %endif
113
114 %description qt-devel
115 Header files for AppstreamQt library.
116
117 %description qt-devel -l pl.UTF-8
118 Pliki nagłówkowe biblioteki AppstreamQt.
119
120 %package -n vala-appstream
121 Summary:        Vala API for AppStream library
122 Summary(pl.UTF-8):      API języka Vala do biblioteki AppStream
123 Group:          Development/Libraries
124 Requires:       %{name}-devel = %{version}-%{release}
125 Requires:       vala
126
127 %description -n vala-appstream
128 Vala API for AppStream library.
129
130 %description -n vala-appstream -l pl.UTF-8
131 API języka Vala do biblioteki AppStream.
132
133 %prep
134 %setup -q
135 %patch0 -p1
136
137 %build
138 install -d build
139 cd build
140 %cmake .. \
141         %{?with_apidocs:-DDOCUMENTATION=ON} \
142         %{?with_qt:-DQT=ON %{?with_qt4:-DAPPSTREAM_QT_VERSION=4}} \
143         %{?with_vala:-DVAPI=ON}
144
145 %{__make} -j1
146
147 %install
148 rm -rf $RPM_BUILD_ROOT
149
150 %{__make} -C build install \
151         DESTDIR=$RPM_BUILD_ROOT
152
153 install -d $RPM_BUILD_ROOT%{_docdir}
154 %{__mv} $RPM_BUILD_ROOT%{_datadir}/gtk-doc $RPM_BUILD_ROOT%{_docdir}
155
156 %find_lang appstream
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161 %post   -p /sbin/ldconfig
162 %postun -p /sbin/ldconfig
163
164 %post   qt -p /sbin/ldconfig
165 %postun qt -p /sbin/ldconfig
166
167 %files -f appstream.lang
168 %defattr(644,root,root,755)
169 %doc AUTHORS MAINTAINERS NEWS README.md RELEASE
170 %attr(755,root,root) %{_bindir}/appstream-index
171 %attr(755,root,root) %{_bindir}/appstream-validate
172 %attr(755,root,root) %{_libdir}/libappstream.so.*.*.*
173 %attr(755,root,root) %ghost %{_libdir}/libappstream.so.2
174 %{_libdir}/girepository-1.0/AppStream-0.8.typelib
175 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/appstream.conf
176 %dir %{_datadir}/app-info
177 %{_datadir}/app-info/categories.xml
178 %{_mandir}/man1/appstream-index.1*
179 %{_mandir}/man1/appstream-validate.1*
180
181 %files devel
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{_libdir}/libappstream.so
184 %{_datadir}/gir-1.0/AppStream-0.8.gir
185 %{_includedir}/AppStream
186 %{_pkgconfigdir}/appstream.pc
187
188 %if %{with apidocs}
189 %files apidocs
190 %defattr(644,root,root,755)
191 %{_docdir}/appstream
192 %{_gtkdocdir}/appstream
193 %endif
194
195 %if %{with qt}
196 %files qt
197 %defattr(644,root,root,755)
198 %attr(755,root,root) %{_libdir}/libAppstreamQt.so.*.*.*
199 %if %{with qt4}
200 %attr(755,root,root) %ghost %{_libdir}/libAppstreamQt.so.0
201 %else
202 %attr(755,root,root) %ghost %{_libdir}/libAppstreamQt.so.1
203 %endif
204
205 %files qt-devel
206 %defattr(644,root,root,755)
207 %attr(755,root,root) %{_libdir}/libAppstreamQt.so
208 %{_includedir}/AppstreamQt
209 %{_libdir}/cmake/AppstreamQt
210 %endif
211
212 %if %{with vala}
213 %files -n vala-appstream
214 %defattr(644,root,root,755)
215 %{_datadir}/vala/vapi/appstream.vapi
216 %endif
This page took 0.090261 seconds and 2 git commands to generate.