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/
19 %define force_gcc_46 0
25 Url: git://gitorious.org/opensuse/libzypp.git
26 Summary: Package, Patch, Pattern, and Product Management
27 Group: System/Packages
28 BuildRoot: %{_tmppath}/%{name}-%{version}-build
29 Source: %{name}-%{version}.tar.bz2
30 Source1: %{name}-rpmlintrc
31 Provides: yast2-packagemanager
32 Obsoletes: yast2-packagemanager
34 # Features we provide (update doc/autoinclude/FeatureTest.doc):
35 Provides: libzypp(plugin) = 0.1
36 Provides: libzypp(plugin:appdata) = 0
37 Provides: libzypp(plugin:commit) = 1
38 Provides: libzypp(plugin:services) = 1
39 Provides: libzypp(plugin:system) = 1
40 Provides: libzypp(plugin:urlresolver) = 0
41 Provides: libzypp(repovarexpand) = 1.1
45 # lsof is used for 'zypper ps':
49 BuildRequires: openssl-devel
50 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
51 BuildRequires: pkgconfig(libudev)
53 BuildRequires: hal-devel
55 %if 0%{?suse_version} >= 1330
56 BuildRequires: libboost_headers-devel
57 BuildRequires: libboost_program_options-devel
58 BuildRequires: libboost_test-devel
60 BuildRequires: boost-devel
62 BuildRequires: dejagnu
63 BuildRequires: doxygen
66 BuildRequires: gcc46-c++
68 BuildRequires: gcc-c++ >= 4.6
70 BuildRequires: gettext-devel
71 BuildRequires: graphviz
72 BuildRequires: libxml2-devel
73 %if 0%{?suse_version} != 1110
75 BuildRequires: libproxy-devel
78 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
79 BuildRequires: pkgconfig
81 BuildRequires: pkg-config
84 BuildRequires: libsolv-devel >= 0.6.23
85 %if 0%{?suse_version} >= 1100
86 BuildRequires: libsolv-tools
87 %requires_eq libsolv-tools
89 Requires: libsolv-tools
92 # required for testsuite, webrick
96 BuildRequires: libexpat-devel
98 BuildRequires: expat-devel
103 %if 0%{?suse_version}
104 BuildRequires: rpm-devel > 4.4
107 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
108 BuildRequires: glib2-devel
109 BuildRequires: popt-devel
110 BuildRequires: rpm-devel > 4.4
113 %if 0%{?mandriva_version}
114 BuildRequires: glib2-devel
115 BuildRequires: librpm-devel > 4.4
118 %if 0%{?suse_version}
124 %define min_curl_version 7.19.4
125 %if 0%{?suse_version}
126 %if 0%{?suse_version} >= 1100
128 BuildRequires: libcurl-devel >= %{min_curl_version}
129 Requires: libcurl4 >= %{min_curl_version}
132 BuildRequires: curl-devel
135 # Other distros (Fedora)
136 BuildRequires: libcurl-devel >= %{min_curl_version}
137 Requires: libcurl >= %{min_curl_version}
141 Package, Patch, Pattern, and Product Management
144 Summary: Package, Patch, Pattern, and Product Management - developers files
145 Group: Development/Libraries/C and C++
146 Provides: yast2-packagemanager-devel
147 Obsoletes: yast2-packagemanager-devel
148 %if 0%{?suse_version} >= 1330
149 Requires: libboost_headers-devel
150 Requires: libboost_program_options-devel
151 Requires: libboost_test-devel
153 Requires: boost-devel
156 Requires: glibc-devel
157 Requires: libstdc++-devel
158 Requires: libxml2-devel
159 Requires: libzypp = %{version}
160 Requires: openssl-devel
162 Requires: rpm-devel > 4.4
164 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
165 Requires: libudev-devel
170 %if 0%{?suse_version}
171 %if 0%{?suse_version} >= 1100
173 Requires: libcurl-devel >= %{min_curl_version}
179 # Other distros (Fedora)
180 Requires: libcurl-devel >= %{min_curl_version}
182 %if 0%{?suse_version} >= 1100
183 %requires_ge libsolv-devel
185 Requires: libsolv-devel
189 Package, Patch, Pattern, and Product Management - developers files
192 Summary: Package, Patch, Pattern, and Product Management - developers files
193 Group: Documentation/HTML
195 %description devel-doc
196 Package, Patch, Pattern, and Product Management - developers files
204 %if 0%{?force_gcc_46}
208 export CFLAGS="$RPM_OPT_FLAGS"
209 export CXXFLAGS="$RPM_OPT_FLAGS"
210 unset EXTRA_CMAKE_OPTIONS
211 # No libproxy on SLE11
212 %if 0%{?suse_version} == 1110
213 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
216 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
217 -DDOC_INSTALL_DIR=%{_docdir} \
219 -DCMAKE_BUILD_TYPE=Release \
220 -DCMAKE_SKIP_RPATH=1 \
221 ${EXTRA_CMAKE_OPTIONS} \
223 make %{?_smp_mflags} VERBOSE=1
224 make -C doc/autodoc %{?_smp_mflags}
225 make -C po %{?_smp_mflags} translations
227 %if 0%{?run_testsuite}
228 make -C tests %{?_smp_mflags}
230 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
237 rm -rf "$RPM_BUILD_ROOT"
239 make install DESTDIR=$RPM_BUILD_ROOT
240 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
241 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
242 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
244 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
246 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
247 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
248 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vars.d
249 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
250 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
251 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/credentials.d
252 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
253 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
254 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
255 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
256 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
257 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
258 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
259 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
260 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
261 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
263 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
264 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
265 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
268 make -C po install DESTDIR=$RPM_BUILD_ROOT
269 # Create filelist with translations
275 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
277 # convert old lock file to new
278 # TODO make this a separate file?
279 # TODO run the sript only when updating form pre-11.0 libzypp versions
280 LOCKSFILE=%{_sysconfdir}/zypp/locks
281 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
284 # if no such file, exit with false (1 in bash)
285 test -f ${LOCKSFILE} || return 1
287 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
288 if [ -s ${TEMP_FILE} ]
328 if is_old ${LOCKSFILE}
330 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
331 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
333 append_new_lock $line
337 %postun -p /sbin/ldconfig
340 rm -rf "$RPM_BUILD_ROOT"
343 %defattr(-,root,root)
344 %dir %{_sysconfdir}/zypp
345 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
346 %{_sysconfdir}/zypp/repos.d
348 %dir %{_sysconfdir}/zypp/repos.d
350 %dir %{_sysconfdir}/zypp/services.d
351 %dir %{_sysconfdir}/zypp/systemCheck.d
352 %dir %{_sysconfdir}/zypp/vars.d
353 %dir %{_sysconfdir}/zypp/vendors.d
354 %dir %{_sysconfdir}/zypp/multiversion.d
355 %dir %{_sysconfdir}/zypp/credentials.d
356 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
357 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
358 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
359 %dir %{_var}/lib/zypp
360 %dir %{_var}/log/zypp
361 %dir %{_var}/cache/zypp
365 %{_libdir}/libzypp*so.*
366 %doc %{_mandir}/man1/*.1.*
367 %doc %{_mandir}/man5/*.5.*
370 %defattr(-,root,root)
371 %{_libdir}/libzypp.so
373 %{_datadir}/cmake/Modules/*
374 %{_libdir}/pkgconfig/libzypp.pc
377 %defattr(-,root,root)