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 BuildRequires: pkgconfig(libudev)
49 %if 0%{?suse_version} >= 1330
50 BuildRequires: libboost_headers-devel
51 BuildRequires: libboost_program_options-devel
52 BuildRequires: libboost_test-devel
53 BuildRequires: libboost_thread-devel
55 BuildRequires: boost-devel
57 BuildRequires: dejagnu
58 BuildRequires: doxygen
59 BuildRequires: gcc-c++ >= 4.6
60 BuildRequires: gettext-devel
61 BuildRequires: graphviz
62 BuildRequires: libxml2-devel
63 %if 0%{?suse_version} != 1110
65 BuildRequires: libproxy-devel
68 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
69 BuildRequires: pkgconfig
71 BuildRequires: pkg-config
74 BuildRequires: libsolv-devel >= 0.7.2
75 %if 0%{?suse_version} >= 1100
76 BuildRequires: libsolv-tools
77 %requires_eq libsolv-tools
79 Requires: libsolv-tools
82 # required for testsuite, webrick
88 BuildRequires: rpm-devel > 4.4
91 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
92 BuildRequires: glib2-devel
93 BuildRequires: popt-devel
94 BuildRequires: rpm-devel > 4.4
97 %if 0%{?mandriva_version}
98 BuildRequires: glib2-devel
99 BuildRequires: librpm-devel > 4.4
102 %if 0%{?suse_version}
103 BuildRequires: libgpgme-devel
105 BuildRequires: gpgme-devel
108 %define min_curl_version 7.19.4
109 %if 0%{?suse_version}
110 %if 0%{?suse_version} >= 1100
112 BuildRequires: libcurl-devel >= %{min_curl_version}
113 Requires: libcurl4 >= %{min_curl_version}
116 BuildRequires: curl-devel
119 # Other distros (Fedora)
120 BuildRequires: libcurl-devel >= %{min_curl_version}
121 Requires: libcurl >= %{min_curl_version}
124 # required for documentation
125 %if 0%{?suse_version} >= 1330
126 BuildRequires: rubygem(asciidoctor)
128 BuildRequires: asciidoc
129 BuildRequires: libxslt-tools
133 libzypp is the package management library that powers applications
134 like YaST, zypper and the openSUSE/SLE implementation of PackageKit.
136 libzypp provides functionality for a package manager:
138 * An API for package repository management, supporting most common
139 repository metadata formats and signed repositories.
140 * An API for solving packages, products, patterns and patches
141 (installation, removal, update and distribution upgrade
142 operations) dependencies, with additional features like locking.
143 * An API for commiting the transaction to the system over a rpm
144 target. Supporting deltarpm calculation, media changing and
145 installation order calculation.
146 * An API for browsing available and installed software, with some
147 facilities for programs with an user interface.
150 Summary: Header files for libzypp, a library for package management
151 Group: Development/Libraries/C and C++
152 Provides: yast2-packagemanager-devel
153 Obsoletes: yast2-packagemanager-devel
154 %if 0%{?suse_version} >= 1330
155 Requires: libboost_headers-devel
156 Requires: libboost_program_options-devel
157 Requires: libboost_test-devel
158 Requires: libboost_thread-devel
160 Requires: boost-devel
163 Requires: glibc-devel
164 Requires: libstdc++-devel
165 Requires: libxml2-devel
166 Requires: libzypp = %{version}
167 Requires: openssl-devel
169 Requires: rpm-devel > 4.4
171 Requires: libudev-devel
172 %if 0%{?suse_version}
173 %if 0%{?suse_version} >= 1100
175 Requires: libcurl-devel >= %{min_curl_version}
181 # Other distros (Fedora)
182 Requires: libcurl-devel >= %{min_curl_version}
184 %if 0%{?suse_version} >= 1100
185 %requires_ge libsolv-devel
187 Requires: libsolv-devel
191 Development files for libzypp, a library for package, patch, pattern
192 and product management.
195 Summary: Developer documentation for libzypp
196 Group: Documentation/HTML
198 %description devel-doc
199 Developer documentation for libzypp.
207 export CFLAGS="%{optflags}"
208 export CXXFLAGS="%{optflags}"
209 unset EXTRA_CMAKE_OPTIONS
210 # No libproxy on SLE11
211 %if 0%{?suse_version} == 1110
212 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
215 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
216 -DENABLE_BUILD_DOCS=TRUE \
217 -DENABLE_BUILD_TRANS=TRUE \
218 -DENABLE_BUILD_TESTS=TRUE \
219 -DDOC_INSTALL_DIR=%{_docdir} \
221 -DCMAKE_BUILD_TYPE=Release \
222 -DCMAKE_SKIP_RPATH=1 \
223 ${EXTRA_CMAKE_OPTIONS} \
225 make %{?_smp_mflags} VERBOSE=1
230 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
231 ln -s %{_sysconfdir}/yum.repos.d %{buildroot}/%{_sysconfdir}/zypp/repos.d
233 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/repos.d
235 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/services.d
236 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/systemCheck.d
237 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vars.d
238 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/vendors.d
239 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/multiversion.d
240 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/needreboot.d
241 mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
242 mkdir -p %{buildroot}/%{_prefix}/lib/zypp
243 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins
244 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/appdata
245 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/commit
246 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/services
247 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/system
248 mkdir -p %{buildroot}/%{_prefix}/lib/zypp/plugins/urlresolver
249 mkdir -p %{buildroot}/%{_var}/lib/zypp
250 mkdir -p %{buildroot}/%{_var}/log/zypp
251 mkdir -p %{buildroot}/%{_var}/cache/zypp
253 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
254 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
255 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
260 # Create filelist with translations
265 LD_LIBRARY_PATH="%{buildroot}/%{_libdir}:$LD_LIBRARY_PATH" ctest --output-on-failure .
270 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
272 # convert old lock file to new
273 # TODO make this a separate file?
274 # TODO run the sript only when updating form pre-11.0 libzypp versions
275 LOCKSFILE=%{_sysconfdir}/zypp/locks
276 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
279 # if no such file, exit with false (1 in bash)
280 test -f ${LOCKSFILE} || return 1
282 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
283 if [ -s ${TEMP_FILE} ]
323 if is_old ${LOCKSFILE}
325 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
326 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
328 append_new_lock $line
332 %postun -p /sbin/ldconfig
335 %defattr(-,root,root)
336 %if 0%{?suse_version} >= 1500
339 %dir %{_sysconfdir}/zypp
340 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
341 %{_sysconfdir}/zypp/repos.d
343 %dir %{_sysconfdir}/zypp/repos.d
345 %dir %{_sysconfdir}/zypp/services.d
346 %dir %{_sysconfdir}/zypp/systemCheck.d
347 %dir %{_sysconfdir}/zypp/vars.d
348 %dir %{_sysconfdir}/zypp/vendors.d
349 %dir %{_sysconfdir}/zypp/multiversion.d
350 %config(noreplace) %{_sysconfdir}/zypp/needreboot
351 %dir %{_sysconfdir}/zypp/needreboot.d
352 %dir %{_sysconfdir}/zypp/credentials.d
353 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
354 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
355 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
356 %dir %{_var}/lib/zypp
357 %dir %attr(750,root,root) %{_var}/log/zypp
358 %dir %{_var}/cache/zypp
362 %{_libdir}/libzypp*so.*
363 %doc %{_mandir}/man1/*.1.*
364 %doc %{_mandir}/man5/*.5.*
367 %defattr(-,root,root)
368 %{_libdir}/libzypp.so
370 %{_datadir}/cmake/Modules/*
371 %{_libdir}/pkgconfig/libzypp.pc
374 %defattr(-,root,root)