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/
18 %if 0%{?is_opensuse} && (0%{?sle_version} >= 150100 || 0%{?suse_version} > 1500)
24 %bcond_without mediabackend_tests
30 Url: https://github.com/openSUSE/libzypp
31 Summary: Library for package, patch, pattern and product management
32 Group: System/Packages
33 BuildRoot: %{_tmppath}/%{name}-%{version}-build
34 Source: %{name}-%{version}.tar.bz2
35 Source1: %{name}-rpmlintrc
36 Provides: yast2-packagemanager
37 Obsoletes: yast2-packagemanager
39 # Features we provide (update doc/autoinclude/FeatureTest.doc):
40 Provides: libzypp(plugin) = 0.1
41 Provides: libzypp(plugin:appdata) = 0
42 Provides: libzypp(plugin:commit) = 1
43 Provides: libzypp(plugin:services) = 1
44 Provides: libzypp(plugin:system) = 1
45 Provides: libzypp(plugin:urlresolver) = 0
46 Provides: libzypp(repovarexpand) = 1.1
50 # lsof is used for 'zypper ps':
53 BuildRequires: cmake >= 3.1
54 BuildRequires: openssl-devel
55 BuildRequires: pkgconfig(libudev)
56 %if 0%{?suse_version} >= 1330
57 BuildRequires: libboost_headers-devel
58 BuildRequires: libboost_program_options-devel
59 BuildRequires: libboost_test-devel
60 BuildRequires: libboost_thread-devel
62 BuildRequires: boost-devel
64 BuildRequires: dejagnu
65 BuildRequires: doxygen
66 BuildRequires: gcc-c++ >= 7
67 BuildRequires: gettext-devel
68 BuildRequires: graphviz
69 BuildRequires: libxml2-devel
70 %if 0%{?suse_version} != 1110
72 BuildRequires: libproxy-devel
75 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
76 BuildRequires: pkgconfig
78 BuildRequires: pkg-config
81 BuildRequires: libsolv-devel >= 0.7.11
82 %if 0%{?suse_version} >= 1100
83 BuildRequires: libsolv-tools
84 %requires_eq libsolv-tools
86 Requires: libsolv-tools
89 BuildRequires: glib2-devel
90 BuildRequires: libsigc++2-devel
92 # required for testsuite
93 %if %{with mediabackend_tests}
100 BuildRequires: rpm-devel > 4.4
103 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
104 BuildRequires: popt-devel
105 BuildRequires: rpm-devel > 4.4
108 %if 0%{?mandriva_version}
109 BuildRequires: librpm-devel > 4.4
112 %if 0%{?suse_version}
113 BuildRequires: libgpgme-devel
115 %if %{with mediabackend_tests}
116 BuildRequires: FastCGI-devel
119 BuildRequires: gpgme-devel
121 %if %{with mediabackend_tests}
122 BuildRequires: fcgi-devel
126 %define min_curl_version 7.19.4
127 %if 0%{?suse_version}
128 %if 0%{?suse_version} >= 1100
130 BuildRequires: libcurl-devel >= %{min_curl_version}
131 Requires: libcurl4 >= %{min_curl_version}
134 BuildRequires: curl-devel
137 # Other distros (Fedora)
138 BuildRequires: libcurl-devel >= %{min_curl_version}
139 Requires: libcurl >= %{min_curl_version}
142 # required for documentation
143 %if 0%{?suse_version} >= 1330
144 BuildRequires: rubygem(asciidoctor)
146 BuildRequires: asciidoc
147 BuildRequires: libxslt-tools
151 BuildRequires: libzck-devel
155 libzypp is the package management library that powers applications
156 like YaST, zypper and the openSUSE/SLE implementation of PackageKit.
158 libzypp provides functionality for a package manager:
160 * An API for package repository management, supporting most common
161 repository metadata formats and signed repositories.
162 * An API for solving packages, products, patterns and patches
163 (installation, removal, update and distribution upgrade
164 operations) dependencies, with additional features like locking.
165 * An API for commiting the transaction to the system over a rpm
166 target. Supporting deltarpm calculation, media changing and
167 installation order calculation.
168 * An API for browsing available and installed software, with some
169 facilities for programs with an user interface.
172 Summary: Header files for libzypp, a library for package management
173 Group: Development/Libraries/C and C++
174 Provides: yast2-packagemanager-devel
175 Obsoletes: yast2-packagemanager-devel
176 %if 0%{?suse_version} >= 1330
177 Requires: libboost_headers-devel
178 Requires: libboost_program_options-devel
179 Requires: libboost_test-devel
180 Requires: libboost_thread-devel
182 Requires: boost-devel
185 Requires: glibc-devel
186 Requires: libstdc++-devel
187 Requires: libxml2-devel
188 Requires: libzypp = %{version}
189 Requires: openssl-devel
191 Requires: rpm-devel > 4.4
193 Requires: libudev-devel
194 %if 0%{?suse_version}
195 %if 0%{?suse_version} >= 1100
197 Requires: libcurl-devel >= %{min_curl_version}
203 # Other distros (Fedora)
204 Requires: libcurl-devel >= %{min_curl_version}
206 %if 0%{?suse_version} >= 1100
207 %requires_ge libsolv-devel
209 Requires: libsolv-devel
213 Development files for libzypp, a library for package, patch, pattern
214 and product management.
217 Summary: Developer documentation for libzypp
218 Group: Documentation/HTML
220 %description devel-doc
221 Developer documentation for libzypp.
229 export CFLAGS="%{optflags}"
230 export CXXFLAGS="%{optflags}"
231 unset EXTRA_CMAKE_OPTIONS
232 # No libproxy on SLE11
233 %if 0%{?suse_version} == 1110
234 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
237 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
238 -DENABLE_BUILD_DOCS=TRUE \
239 -DENABLE_BUILD_TRANS=TRUE \
240 -DENABLE_BUILD_TESTS=TRUE \
241 -DDOC_INSTALL_DIR=%{_docdir} \
243 -DCMAKE_BUILD_TYPE=Release \
244 -DCMAKE_SKIP_RPATH=1 \
245 %{?with_zchunk:-DENABLE_ZCHUNK_COMPRESSION=1} \
246 %{!?with_mediabackend_tests:-DDISABLE_MEDIABACKEND_TESTS=1} \
247 ${EXTRA_CMAKE_OPTIONS} \
249 make %{?_smp_mflags} VERBOSE=1
254 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
255 ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
257 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/repos.d
259 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/services.d
260 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/systemCheck.d
261 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vars.d
262 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vendors.d
263 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/multiversion.d
264 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/needreboot.d
265 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
266 mkdir -p %{buildroot}/%{_prefix}/lib/zypp
267 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins
268 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/appdata
269 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/commit
270 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/services
271 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/system
272 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/urlresolver
273 mkdir -p %{buildroot}/%{_var}/lib/zypp
274 mkdir -p %{buildroot}/%{_var}/log/zypp
275 mkdir -p %{buildroot}/%{_var}/cache/zypp
277 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
278 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
279 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
284 # Create filelist with translations
289 LD_LIBRARY_PATH="$(pwd)/../zypp:$LD_LIBRARY_PATH" ctest --output-on-failure .
294 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
296 # convert old lock file to new
297 # TODO make this a separate file?
298 # TODO run the sript only when updating form pre-11.0 libzypp versions
299 LOCKSFILE=%{_sysconfdir}/zypp/locks
300 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
303 # if no such file, exit with false (1 in bash)
304 test -f ${LOCKSFILE} || return 1
306 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
307 if [ -s ${TEMP_FILE} ]
347 if is_old ${LOCKSFILE}
349 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
350 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
352 append_new_lock $line
356 %postun -p /sbin/ldconfig
359 %defattr(-,root,root)
360 %if 0%{?suse_version} >= 1500
363 %dir %{_sysconfdir}/zypp
364 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
365 %{_sysconfdir}/zypp/repos.d
367 %dir %{_sysconfdir}/zypp/repos.d
369 %dir %{_sysconfdir}/zypp/services.d
370 %dir %{_sysconfdir}/zypp/systemCheck.d
371 %dir %{_sysconfdir}/zypp/vars.d
372 %dir %{_sysconfdir}/zypp/vendors.d
373 %dir %{_sysconfdir}/zypp/multiversion.d
374 %config(noreplace) %{_sysconfdir}/zypp/needreboot
375 %dir %{_sysconfdir}/zypp/needreboot.d
376 %dir %{_sysconfdir}/zypp/credentials.d
377 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
378 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
379 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
380 %dir %{_var}/lib/zypp
381 %dir %attr(750,root,root) %{_var}/log/zypp
382 %dir %{_var}/cache/zypp
386 %{_libdir}/libzypp*so.*
387 %doc %{_mandir}/man1/*.1.*
388 %doc %{_mandir}/man5/*.5.*
391 %defattr(-,root,root)
392 %{_libdir}/libzypp.so
394 %{_datadir}/cmake/Modules/*
395 %{_libdir}/pkgconfig/libzypp.pc
398 %defattr(-,root,root)