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: 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.6.35
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 Package, Patch, Pattern, and Product Management
140 Summary: Package, Patch, Pattern, and Product Management - developers files
141 Group: Development/Libraries/C and C++
142 Provides: yast2-packagemanager-devel
143 Obsoletes: yast2-packagemanager-devel
144 %if 0%{?suse_version} >= 1330
145 Requires: libboost_headers-devel
146 Requires: libboost_program_options-devel
147 Requires: libboost_test-devel
148 Requires: libboost_thread-devel
150 Requires: boost-devel
153 Requires: glibc-devel
154 Requires: libstdc++-devel
155 Requires: libxml2-devel
156 Requires: libzypp = %{version}
157 Requires: openssl-devel
159 Requires: rpm-devel > 4.4
161 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
162 Requires: libudev-devel
166 %if 0%{?suse_version}
167 %if 0%{?suse_version} >= 1100
169 Requires: libcurl-devel >= %{min_curl_version}
175 # Other distros (Fedora)
176 Requires: libcurl-devel >= %{min_curl_version}
178 %if 0%{?suse_version} >= 1100
179 %requires_ge libsolv-devel
181 Requires: libsolv-devel
185 Package, Patch, Pattern, and Product Management - developers files
188 Summary: Package, Patch, Pattern, and Product Management - developers files
189 Group: Documentation/HTML
191 %description devel-doc
192 Package, Patch, Pattern, and Product Management - developers files
200 export CFLAGS="$RPM_OPT_FLAGS"
201 export CXXFLAGS="$RPM_OPT_FLAGS"
202 unset EXTRA_CMAKE_OPTIONS
203 # No libproxy on SLE11
204 %if 0%{?suse_version} == 1110
205 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
208 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
209 -DDOC_INSTALL_DIR=%{_docdir} \
211 -DCMAKE_BUILD_TYPE=Release \
212 -DCMAKE_SKIP_RPATH=1 \
213 ${EXTRA_CMAKE_OPTIONS} \
215 make %{?_smp_mflags} VERBOSE=1
216 make -C doc/autodoc %{?_smp_mflags}
217 make -C po %{?_smp_mflags} translations
218 make -C tests %{?_smp_mflags}
221 rm -rf "$RPM_BUILD_ROOT"
223 make install DESTDIR=$RPM_BUILD_ROOT
224 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
225 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
226 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
230 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
231 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
232 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vars.d
233 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
234 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
235 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/credentials.d
236 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
237 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
238 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
239 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
240 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
241 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
242 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
243 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
244 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
245 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
247 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
248 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
249 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
252 make -C po install DESTDIR=$RPM_BUILD_ROOT
253 # Create filelist with translations
259 LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:${LD_LIBRARY_PATH} ctest .
264 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
266 # convert old lock file to new
267 # TODO make this a separate file?
268 # TODO run the sript only when updating form pre-11.0 libzypp versions
269 LOCKSFILE=%{_sysconfdir}/zypp/locks
270 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
273 # if no such file, exit with false (1 in bash)
274 test -f ${LOCKSFILE} || return 1
276 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
277 if [ -s ${TEMP_FILE} ]
317 if is_old ${LOCKSFILE}
319 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
320 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
322 append_new_lock $line
326 %postun -p /sbin/ldconfig
329 rm -rf "$RPM_BUILD_ROOT"
332 %defattr(-,root,root)
333 %if 0%{?suse_version} >= 1500
336 %dir %{_sysconfdir}/zypp
337 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
338 %{_sysconfdir}/zypp/repos.d
340 %dir %{_sysconfdir}/zypp/repos.d
342 %dir %{_sysconfdir}/zypp/services.d
343 %dir %{_sysconfdir}/zypp/systemCheck.d
344 %dir %{_sysconfdir}/zypp/vars.d
345 %dir %{_sysconfdir}/zypp/vendors.d
346 %dir %{_sysconfdir}/zypp/multiversion.d
347 %dir %{_sysconfdir}/zypp/credentials.d
348 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
349 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
350 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
351 %dir %{_var}/lib/zypp
352 %dir %{_var}/log/zypp
353 %dir %{_var}/cache/zypp
357 %{_libdir}/libzypp*so.*
358 %doc %{_mandir}/man1/*.1.*
359 %doc %{_mandir}/man5/*.5.*
362 %defattr(-,root,root)
363 %{_libdir}/libzypp.so
365 %{_datadir}/cmake/Modules/*
366 %{_libdir}/pkgconfig/libzypp.pc
369 %defattr(-,root,root)