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
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
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 BuildRequires: boost-devel
56 BuildRequires: dejagnu
57 BuildRequires: doxygen
60 BuildRequires: gcc46-c++
62 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.23
79 %if 0%{?suse_version} >= 1100
80 BuildRequires: libsolv-tools
81 %requires_eq libsolv-tools
83 Requires: libsolv-tools
86 # required for testsuite, webrick
90 BuildRequires: libexpat-devel
92 BuildRequires: expat-devel
98 BuildRequires: rpm-devel > 4.4
101 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
102 BuildRequires: glib2-devel
103 BuildRequires: popt-devel
104 BuildRequires: rpm-devel > 4.4
107 %if 0%{?mandriva_version}
108 BuildRequires: glib2-devel
109 BuildRequires: librpm-devel > 4.4
112 %if 0%{?suse_version}
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}
135 Package, Patch, Pattern, and Product Management
138 Summary: Package, Patch, Pattern, and Product Management - developers files
139 Group: Development/Libraries/C and C++
140 Provides: yast2-packagemanager-devel
141 Obsoletes: yast2-packagemanager-devel
142 Requires: boost-devel
144 Requires: glibc-devel
145 Requires: libstdc++-devel
146 Requires: libxml2-devel
147 Requires: libzypp = %{version}
148 Requires: openssl-devel
150 Requires: rpm-devel > 4.4
152 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
153 Requires: libudev-devel
158 %if 0%{?suse_version}
159 %if 0%{?suse_version} >= 1100
161 Requires: libcurl-devel >= %{min_curl_version}
167 # Other distros (Fedora)
168 Requires: libcurl-devel >= %{min_curl_version}
170 %if 0%{?suse_version} >= 1100
171 %requires_ge libsolv-devel
173 Requires: libsolv-devel
177 Package, Patch, Pattern, and Product Management - developers files
180 Summary: Package, Patch, Pattern, and Product Management - developers files
181 Group: Documentation/HTML
183 %description devel-doc
184 Package, Patch, Pattern, and Product Management - developers files
192 %if 0%{?force_gcc_46}
196 export CFLAGS="$RPM_OPT_FLAGS"
197 export CXXFLAGS="$RPM_OPT_FLAGS"
198 unset EXTRA_CMAKE_OPTIONS
199 # No libproxy on SLE11
200 %if 0%{?suse_version} == 1110
201 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
204 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
205 -DDOC_INSTALL_DIR=%{_docdir} \
207 -DCMAKE_BUILD_TYPE=Release \
208 -DCMAKE_SKIP_RPATH=1 \
209 ${EXTRA_CMAKE_OPTIONS} \
211 make %{?_smp_mflags} VERBOSE=1
212 make -C doc/autodoc %{?_smp_mflags}
213 make -C po %{?_smp_mflags} translations
215 %if 0%{?run_testsuite}
216 make -C tests %{?_smp_mflags}
218 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
225 rm -rf "$RPM_BUILD_ROOT"
227 make install DESTDIR=$RPM_BUILD_ROOT
228 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
229 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
230 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
232 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
234 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
235 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
236 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vars.d
237 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
238 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
239 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/credentials.d
240 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
241 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
242 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
243 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
244 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
245 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
246 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
247 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
248 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
249 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
251 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
252 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
253 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
256 make -C po install DESTDIR=$RPM_BUILD_ROOT
257 # Create filelist with translations
263 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
265 # convert old lock file to new
266 # TODO make this a separate file?
267 # TODO run the sript only when updating form pre-11.0 libzypp versions
268 LOCKSFILE=%{_sysconfdir}/zypp/locks
269 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
272 # if no such file, exit with false (1 in bash)
273 test -f ${LOCKSFILE} || return 1
275 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
276 if [ -s ${TEMP_FILE} ]
316 if is_old ${LOCKSFILE}
318 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
319 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
321 append_new_lock $line
325 %postun -p /sbin/ldconfig
328 rm -rf "$RPM_BUILD_ROOT"
331 %defattr(-,root,root)
332 %dir %{_sysconfdir}/zypp
333 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
334 %{_sysconfdir}/zypp/repos.d
336 %dir %{_sysconfdir}/zypp/repos.d
338 %dir %{_sysconfdir}/zypp/services.d
339 %dir %{_sysconfdir}/zypp/systemCheck.d
340 %dir %{_sysconfdir}/zypp/vars.d
341 %dir %{_sysconfdir}/zypp/vendors.d
342 %dir %{_sysconfdir}/zypp/multiversion.d
343 %dir %{_sysconfdir}/zypp/credentials.d
344 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
345 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
346 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
347 %dir %{_var}/lib/zypp
348 %dir %{_var}/log/zypp
349 %dir %{_var}/cache/zypp
353 %{_libdir}/libzypp*so.*
354 %doc %{_mandir}/man1/*.1.*
355 %doc %{_mandir}/man5/*.5.*
358 %defattr(-,root,root)
359 %{_libdir}/libzypp.so
361 %{_datadir}/cmake/Modules/*
362 %{_libdir}/pkgconfig/libzypp.pc
365 %defattr(-,root,root)