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: git://gitorious.org/opensuse/libzypp.git
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.27
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 BuildRequires: asciidoc
130 BuildRequires: libxslt-tools
133 Package, Patch, Pattern, and Product Management
136 Summary: Package, Patch, Pattern, and Product Management - developers files
137 Group: Development/Libraries/C and C++
138 Provides: yast2-packagemanager-devel
139 Obsoletes: yast2-packagemanager-devel
140 %if 0%{?suse_version} >= 1330
141 Requires: libboost_headers-devel
142 Requires: libboost_program_options-devel
143 Requires: libboost_test-devel
144 Requires: libboost_thread-devel
146 Requires: boost-devel
149 Requires: glibc-devel
150 Requires: libstdc++-devel
151 Requires: libxml2-devel
152 Requires: libzypp = %{version}
153 Requires: openssl-devel
155 Requires: rpm-devel > 4.4
157 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
158 Requires: libudev-devel
163 %if 0%{?suse_version}
164 %if 0%{?suse_version} >= 1100
166 Requires: libcurl-devel >= %{min_curl_version}
172 # Other distros (Fedora)
173 Requires: libcurl-devel >= %{min_curl_version}
175 %if 0%{?suse_version} >= 1100
176 %requires_ge libsolv-devel
178 Requires: libsolv-devel
182 Package, Patch, Pattern, and Product Management - developers files
185 Summary: Package, Patch, Pattern, and Product Management - developers files
186 Group: Documentation/HTML
188 %description devel-doc
189 Package, Patch, Pattern, and Product Management - developers files
197 export CFLAGS="$RPM_OPT_FLAGS"
198 export CXXFLAGS="$RPM_OPT_FLAGS"
199 unset EXTRA_CMAKE_OPTIONS
200 # No libproxy on SLE11
201 %if 0%{?suse_version} == 1110
202 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
205 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
206 -DDOC_INSTALL_DIR=%{_docdir} \
208 -DCMAKE_BUILD_TYPE=Release \
209 -DCMAKE_SKIP_RPATH=1 \
210 ${EXTRA_CMAKE_OPTIONS} \
212 make %{?_smp_mflags} VERBOSE=1
213 make -C doc/autodoc %{?_smp_mflags}
214 make -C po %{?_smp_mflags} translations
215 make -C tests %{?_smp_mflags}
218 rm -rf "$RPM_BUILD_ROOT"
220 make install DESTDIR=$RPM_BUILD_ROOT
221 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
222 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
223 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
225 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
227 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
229 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vars.d
230 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
231 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
232 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/credentials.d
233 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
234 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
235 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
236 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
237 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
238 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
239 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
240 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
241 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
242 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
244 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
245 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
246 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
249 make -C po install DESTDIR=$RPM_BUILD_ROOT
250 # Create filelist with translations
256 LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:${LD_LIBRARY_PATH} ctest .
261 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
263 # convert old lock file to new
264 # TODO make this a separate file?
265 # TODO run the sript only when updating form pre-11.0 libzypp versions
266 LOCKSFILE=%{_sysconfdir}/zypp/locks
267 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
270 # if no such file, exit with false (1 in bash)
271 test -f ${LOCKSFILE} || return 1
273 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
274 if [ -s ${TEMP_FILE} ]
314 if is_old ${LOCKSFILE}
316 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
317 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
319 append_new_lock $line
323 %postun -p /sbin/ldconfig
326 rm -rf "$RPM_BUILD_ROOT"
329 %defattr(-,root,root)
330 %dir %{_sysconfdir}/zypp
331 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
332 %{_sysconfdir}/zypp/repos.d
334 %dir %{_sysconfdir}/zypp/repos.d
336 %dir %{_sysconfdir}/zypp/services.d
337 %dir %{_sysconfdir}/zypp/systemCheck.d
338 %dir %{_sysconfdir}/zypp/vars.d
339 %dir %{_sysconfdir}/zypp/vendors.d
340 %dir %{_sysconfdir}/zypp/multiversion.d
341 %dir %{_sysconfdir}/zypp/credentials.d
342 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
343 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
344 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
345 %dir %{_var}/lib/zypp
346 %dir %{_var}/log/zypp
347 %dir %{_var}/cache/zypp
351 %{_libdir}/libzypp*so.*
352 %doc %{_mandir}/man1/*.1.*
353 %doc %{_mandir}/man5/*.5.*
356 %defattr(-,root,root)
357 %{_libdir}/libzypp.so
359 %{_datadir}/cmake/Modules/*
360 %{_libdir}/pkgconfig/libzypp.pc
363 %defattr(-,root,root)