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)
28 Url: https://github.com/openSUSE/libzypp
29 Summary: Library for package, patch, pattern and product management
30 Group: System/Packages
31 BuildRoot: %{_tmppath}/%{name}-%{version}-build
32 Source: %{name}-%{version}.tar.bz2
33 Source1: %{name}-rpmlintrc
34 Provides: yast2-packagemanager
35 Obsoletes: yast2-packagemanager
37 # Features we provide (update doc/autoinclude/FeatureTest.doc):
38 Provides: libzypp(plugin) = 0.1
39 Provides: libzypp(plugin:appdata) = 0
40 Provides: libzypp(plugin:commit) = 1
41 Provides: libzypp(plugin:services) = 1
42 Provides: libzypp(plugin:system) = 1
43 Provides: libzypp(plugin:urlresolver) = 0
44 Provides: libzypp(repovarexpand) = 1.1
48 # lsof is used for 'zypper ps':
52 BuildRequires: openssl-devel
53 BuildRequires: pkgconfig(libudev)
54 %if 0%{?suse_version} >= 1330
55 BuildRequires: libboost_headers-devel
56 BuildRequires: libboost_program_options-devel
57 BuildRequires: libboost_test-devel
58 BuildRequires: libboost_thread-devel
60 BuildRequires: boost-devel
62 BuildRequires: dejagnu
63 BuildRequires: doxygen
64 BuildRequires: gcc-c++ >= 4.6
65 BuildRequires: gettext-devel
66 BuildRequires: graphviz
67 BuildRequires: libxml2-devel
68 %if 0%{?suse_version} != 1110
70 BuildRequires: libproxy-devel
73 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
74 BuildRequires: pkgconfig
76 BuildRequires: pkg-config
79 BuildRequires: libsolv-devel >= 0.7.11
80 %if 0%{?suse_version} >= 1100
81 BuildRequires: libsolv-tools
82 %requires_eq libsolv-tools
84 Requires: libsolv-tools
87 BuildRequires: glib2-devel
88 BuildRequires: libsigc++2-devel
90 # required for testsuite
96 BuildRequires: rpm-devel > 4.4
99 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
100 BuildRequires: popt-devel
101 BuildRequires: rpm-devel > 4.4
104 %if 0%{?mandriva_version}
105 BuildRequires: librpm-devel > 4.4
108 %if 0%{?suse_version}
109 BuildRequires: libgpgme-devel
111 BuildRequires: FastCGI-devel
113 BuildRequires: gpgme-devel
115 BuildRequires: fcgi-devel
118 %define min_curl_version 7.19.4
119 %if 0%{?suse_version}
120 %if 0%{?suse_version} >= 1100
122 BuildRequires: libcurl-devel >= %{min_curl_version}
123 Requires: libcurl4 >= %{min_curl_version}
126 BuildRequires: curl-devel
129 # Other distros (Fedora)
130 BuildRequires: libcurl-devel >= %{min_curl_version}
131 Requires: libcurl >= %{min_curl_version}
134 # required for documentation
135 %if 0%{?suse_version} >= 1330
136 BuildRequires: rubygem(asciidoctor)
138 BuildRequires: asciidoc
139 BuildRequires: libxslt-tools
143 BuildRequires: libzck-devel
147 libzypp is the package management library that powers applications
148 like YaST, zypper and the openSUSE/SLE implementation of PackageKit.
150 libzypp provides functionality for a package manager:
152 * An API for package repository management, supporting most common
153 repository metadata formats and signed repositories.
154 * An API for solving packages, products, patterns and patches
155 (installation, removal, update and distribution upgrade
156 operations) dependencies, with additional features like locking.
157 * An API for commiting the transaction to the system over a rpm
158 target. Supporting deltarpm calculation, media changing and
159 installation order calculation.
160 * An API for browsing available and installed software, with some
161 facilities for programs with an user interface.
164 Summary: Header files for libzypp, a library for package management
165 Group: Development/Libraries/C and C++
166 Provides: yast2-packagemanager-devel
167 Obsoletes: yast2-packagemanager-devel
168 %if 0%{?suse_version} >= 1330
169 Requires: libboost_headers-devel
170 Requires: libboost_program_options-devel
171 Requires: libboost_test-devel
172 Requires: libboost_thread-devel
174 Requires: boost-devel
177 Requires: glibc-devel
178 Requires: libstdc++-devel
179 Requires: libxml2-devel
180 Requires: libzypp = %{version}
181 Requires: openssl-devel
183 Requires: rpm-devel > 4.4
185 Requires: libudev-devel
186 %if 0%{?suse_version}
187 %if 0%{?suse_version} >= 1100
189 Requires: libcurl-devel >= %{min_curl_version}
195 # Other distros (Fedora)
196 Requires: libcurl-devel >= %{min_curl_version}
198 %if 0%{?suse_version} >= 1100
199 %requires_ge libsolv-devel
201 Requires: libsolv-devel
205 Development files for libzypp, a library for package, patch, pattern
206 and product management.
209 Summary: Developer documentation for libzypp
210 Group: Documentation/HTML
212 %description devel-doc
213 Developer documentation for libzypp.
221 export CFLAGS="%{optflags}"
222 export CXXFLAGS="%{optflags}"
223 unset EXTRA_CMAKE_OPTIONS
224 # No libproxy on SLE11
225 %if 0%{?suse_version} == 1110
226 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
229 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
230 -DENABLE_BUILD_DOCS=TRUE \
231 -DENABLE_BUILD_TRANS=TRUE \
232 -DENABLE_BUILD_TESTS=TRUE \
233 -DDOC_INSTALL_DIR=%{_docdir} \
235 -DCMAKE_BUILD_TYPE=Release \
236 -DCMAKE_SKIP_RPATH=1 \
237 %{?with_zchunk:-DENABLE_ZCHUNK_COMPRESSION=1} \
238 ${EXTRA_CMAKE_OPTIONS} \
240 make %{?_smp_mflags} VERBOSE=1
245 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
246 ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
248 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/repos.d
250 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/services.d
251 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/systemCheck.d
252 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vars.d
253 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vendors.d
254 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/multiversion.d
255 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/needreboot.d
256 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
257 mkdir -p %{buildroot}/%{_prefix}/lib/zypp
258 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins
259 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/appdata
260 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/commit
261 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/services
262 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/system
263 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/urlresolver
264 mkdir -p %{buildroot}/%{_var}/lib/zypp
265 mkdir -p %{buildroot}/%{_var}/log/zypp
266 mkdir -p %{buildroot}/%{_var}/cache/zypp
268 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
269 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
270 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
275 # Create filelist with translations
280 LD_LIBRARY_PATH="$(pwd)/../zypp:$LD_LIBRARY_PATH" ctest --output-on-failure .
285 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
287 # convert old lock file to new
288 # TODO make this a separate file?
289 # TODO run the sript only when updating form pre-11.0 libzypp versions
290 LOCKSFILE=%{_sysconfdir}/zypp/locks
291 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
294 # if no such file, exit with false (1 in bash)
295 test -f ${LOCKSFILE} || return 1
297 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
298 if [ -s ${TEMP_FILE} ]
338 if is_old ${LOCKSFILE}
340 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
341 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
343 append_new_lock $line
347 %postun -p /sbin/ldconfig
350 %defattr(-,root,root)
351 %if 0%{?suse_version} >= 1500
354 %dir %{_sysconfdir}/zypp
355 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
356 %{_sysconfdir}/zypp/repos.d
358 %dir %{_sysconfdir}/zypp/repos.d
360 %dir %{_sysconfdir}/zypp/services.d
361 %dir %{_sysconfdir}/zypp/systemCheck.d
362 %dir %{_sysconfdir}/zypp/vars.d
363 %dir %{_sysconfdir}/zypp/vendors.d
364 %dir %{_sysconfdir}/zypp/multiversion.d
365 %config(noreplace) %{_sysconfdir}/zypp/needreboot
366 %dir %{_sysconfdir}/zypp/needreboot.d
367 %dir %{_sysconfdir}/zypp/credentials.d
368 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
369 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
370 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
371 %dir %{_var}/lib/zypp
372 %dir %attr(750,root,root) %{_var}/log/zypp
373 %dir %{_var}/cache/zypp
377 %{_libdir}/libzypp*so.*
378 %doc %{_mandir}/man1/*.1.*
379 %doc %{_mandir}/man5/*.5.*
382 %defattr(-,root,root)
383 %{_libdir}/libzypp.so
385 %{_datadir}/cmake/Modules/*
386 %{_libdir}/pkgconfig/libzypp.pc
389 %defattr(-,root,root)