2 # spec file for package libzypp
4 # Copyright (c) 2005-2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
6 # All modifications and additions to the file contributed by third parties
7 # remain the property of their copyright owners, unless otherwise agreed
8 # upon. The license for this file, and modifications and additions to the
9 # file, is the same license as for the pristine package itself (unless the
10 # license for the pristine package is not an Open Source License, in which
11 # case the license is the MIT License). An "Open Source License" is a
12 # license that conforms to the Open Source Definition (Version 1.9)
13 # published by the Open Source Initiative.
15 # Please submit bugfixes or comments via http://bugs.opensuse.org/
23 Url: https://github.com/openSUSE/libzypp
24 Summary: Library for package, patch, pattern and product management
25 Group: System/Packages
26 BuildRoot: %{_tmppath}/%{name}-%{version}-build
27 Source: %{name}-%{version}.tar.bz2
28 Source1: %{name}-rpmlintrc
29 Provides: yast2-packagemanager
30 Obsoletes: yast2-packagemanager
32 # Features we provide (update doc/autoinclude/FeatureTest.doc):
33 Provides: libzypp(plugin) = 0.1
34 Provides: libzypp(plugin:appdata) = 0
35 Provides: libzypp(plugin:commit) = 1
36 Provides: libzypp(plugin:services) = 1
37 Provides: libzypp(plugin:system) = 1
38 Provides: libzypp(plugin:urlresolver) = 0
39 Provides: libzypp(repovarexpand) = 1.1
43 # lsof is used for 'zypper ps':
47 BuildRequires: openssl-devel
48 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
49 BuildRequires: pkgconfig(libudev)
51 BuildRequires: hal-devel
53 %if 0%{?suse_version} >= 1330
54 BuildRequires: libboost_headers-devel
55 BuildRequires: libboost_program_options-devel
56 BuildRequires: libboost_test-devel
57 BuildRequires: libboost_thread-devel
59 BuildRequires: boost-devel
61 BuildRequires: dejagnu
62 BuildRequires: doxygen
63 BuildRequires: gcc-c++ >= 4.6
64 BuildRequires: gettext-devel
65 BuildRequires: graphviz
66 BuildRequires: libxml2-devel
67 %if 0%{?suse_version} != 1110
69 BuildRequires: libproxy-devel
72 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
73 BuildRequires: pkgconfig
75 BuildRequires: pkg-config
78 BuildRequires: libsolv-devel >= 0.7.1
79 %if 0%{?suse_version} >= 1100
80 BuildRequires: libsolv-tools
81 %requires_eq libsolv-tools
83 Requires: libsolv-tools
86 # required for testsuite, webrick
92 BuildRequires: rpm-devel > 4.4
95 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
96 BuildRequires: glib2-devel
97 BuildRequires: popt-devel
98 BuildRequires: rpm-devel > 4.4
101 %if 0%{?mandriva_version}
102 BuildRequires: glib2-devel
103 BuildRequires: librpm-devel > 4.4
106 %if 0%{?suse_version}
107 BuildRequires: libgpgme-devel
109 BuildRequires: gpgme-devel
112 %define min_curl_version 7.19.4
113 %if 0%{?suse_version}
114 %if 0%{?suse_version} >= 1100
116 BuildRequires: libcurl-devel >= %{min_curl_version}
117 Requires: libcurl4 >= %{min_curl_version}
120 BuildRequires: curl-devel
123 # Other distros (Fedora)
124 BuildRequires: libcurl-devel >= %{min_curl_version}
125 Requires: libcurl >= %{min_curl_version}
128 # required for documentation
129 %if 0%{?suse_version} >= 1330
130 BuildRequires: rubygem(asciidoctor)
132 BuildRequires: asciidoc
133 BuildRequires: libxslt-tools
137 libzypp is the package management library that powers applications
138 like YaST, zypper and the openSUSE/SLE implementation of PackageKit.
140 libzypp provides functionality for a package manager:
142 * An API for package repository management, supporting most common
143 repository metadata formats and signed repositories.
144 * An API for solving packages, products, patterns and patches
145 (installation, removal, update and distribution upgrade
146 operations) dependencies, with additional features like locking.
147 * An API for commiting the transaction to the system over a rpm
148 target. Supporting deltarpm calculation, media changing and
149 installation order calculation.
150 * An API for browsing available and installed software, with some
151 facilities for programs with an user interface.
154 Summary: Header files for libzypp, a library for package management
155 Group: Development/Libraries/C and C++
156 Provides: yast2-packagemanager-devel
157 Obsoletes: yast2-packagemanager-devel
158 %if 0%{?suse_version} >= 1330
159 Requires: libboost_headers-devel
160 Requires: libboost_program_options-devel
161 Requires: libboost_test-devel
162 Requires: libboost_thread-devel
164 Requires: boost-devel
167 Requires: glibc-devel
168 Requires: libstdc++-devel
169 Requires: libxml2-devel
170 Requires: libzypp = %{version}
171 Requires: openssl-devel
173 Requires: rpm-devel > 4.4
175 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
176 Requires: libudev-devel
180 %if 0%{?suse_version}
181 %if 0%{?suse_version} >= 1100
183 Requires: libcurl-devel >= %{min_curl_version}
189 # Other distros (Fedora)
190 Requires: libcurl-devel >= %{min_curl_version}
192 %if 0%{?suse_version} >= 1100
193 %requires_ge libsolv-devel
195 Requires: libsolv-devel
199 Development files for libzypp, a library for package, patch, pattern
200 and product management.
203 Summary: Developer documentation for libzypp
204 Group: Documentation/HTML
206 %description devel-doc
207 Developer documentation for libzypp.
215 export CFLAGS="%{optflags}"
216 export CXXFLAGS="%{optflags}"
217 unset EXTRA_CMAKE_OPTIONS
218 # No libproxy on SLE11
219 %if 0%{?suse_version} == 1110
220 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
223 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
224 -DDOC_INSTALL_DIR=%{_docdir} \
226 -DCMAKE_BUILD_TYPE=Release \
227 -DCMAKE_SKIP_RPATH=1 \
228 ${EXTRA_CMAKE_OPTIONS} \
230 make %{?_smp_mflags} VERBOSE=1
231 make -C doc/autodoc %{?_smp_mflags}
232 make -C po %{?_smp_mflags} translations
233 make -C tests %{?_smp_mflags}
238 %make_install -C doc/autodoc
239 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
240 ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
242 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/repos.d
244 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/services.d
245 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/systemCheck.d
246 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vars.d
247 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vendors.d
248 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/multiversion.d
249 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/needreboot.d
250 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
251 mkdir -p %{buildroot}/%{_prefix}/lib/zypp
252 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins
253 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/appdata
254 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/commit
255 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/services
256 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/system
257 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/urlresolver
258 mkdir -p %{buildroot}/%{_var}/lib/zypp
259 mkdir -p %{buildroot}/%{_var}/log/zypp
260 mkdir -p %{buildroot}/%{_var}/cache/zypp
262 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
263 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
264 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
268 # Create filelist with translations
274 LD_LIBRARY_PATH="%{buildroot}/%{_libdir}:$LD_LIBRARY_PATH" ctest .
279 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
281 # convert old lock file to new
282 # TODO make this a separate file?
283 # TODO run the sript only when updating form pre-11.0 libzypp versions
284 LOCKSFILE=%{_sysconfdir}/zypp/locks
285 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
288 # if no such file, exit with false (1 in bash)
289 test -f ${LOCKSFILE} || return 1
291 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
292 if [ -s ${TEMP_FILE} ]
332 if is_old ${LOCKSFILE}
334 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
335 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
337 append_new_lock $line
341 %postun -p /sbin/ldconfig
344 %defattr(-,root,root)
345 %if 0%{?suse_version} >= 1500
348 %dir %{_sysconfdir}/zypp
349 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
350 %{_sysconfdir}/zypp/repos.d
352 %dir %{_sysconfdir}/zypp/repos.d
354 %dir %{_sysconfdir}/zypp/services.d
355 %dir %{_sysconfdir}/zypp/systemCheck.d
356 %dir %{_sysconfdir}/zypp/vars.d
357 %dir %{_sysconfdir}/zypp/vendors.d
358 %dir %{_sysconfdir}/zypp/multiversion.d
359 %config(noreplace) %{_sysconfdir}/zypp/needreboot
360 %dir %{_sysconfdir}/zypp/needreboot.d
361 %dir %{_sysconfdir}/zypp/credentials.d
362 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
363 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
364 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
365 %dir %{_var}/lib/zypp
366 %dir %{_var}/log/zypp
367 %dir %{_var}/cache/zypp
371 %{_libdir}/libzypp*so.*
372 %doc %{_mandir}/man1/*.1.*
373 %doc %{_mandir}/man5/*.5.*
376 %defattr(-,root,root)
377 %{_libdir}/libzypp.so
379 %{_datadir}/cmake/Modules/*
380 %{_libdir}/pkgconfig/libzypp.pc
383 %defattr(-,root,root)