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
58 BuildRequires: boost-devel
60 BuildRequires: dejagnu
61 BuildRequires: doxygen
62 BuildRequires: gcc-c++ >= 4.6
63 BuildRequires: gettext-devel
64 BuildRequires: graphviz
65 BuildRequires: libxml2-devel
66 %if 0%{?suse_version} != 1110
68 BuildRequires: libproxy-devel
71 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
72 BuildRequires: pkgconfig
74 BuildRequires: pkg-config
77 BuildRequires: libsolv-devel >= 0.6.23
78 %if 0%{?suse_version} >= 1100
79 BuildRequires: libsolv-tools
80 %requires_eq libsolv-tools
82 Requires: libsolv-tools
85 # required for testsuite, webrick
91 BuildRequires: rpm-devel > 4.4
94 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
95 BuildRequires: glib2-devel
96 BuildRequires: popt-devel
97 BuildRequires: rpm-devel > 4.4
100 %if 0%{?mandriva_version}
101 BuildRequires: glib2-devel
102 BuildRequires: librpm-devel > 4.4
105 %if 0%{?suse_version}
109 BuildRequires: gnupg2
113 %define min_curl_version 7.19.4
114 %if 0%{?suse_version}
115 %if 0%{?suse_version} >= 1100
117 BuildRequires: libcurl-devel >= %{min_curl_version}
118 Requires: libcurl4 >= %{min_curl_version}
121 BuildRequires: curl-devel
124 # Other distros (Fedora)
125 BuildRequires: libcurl-devel >= %{min_curl_version}
126 Requires: libcurl >= %{min_curl_version}
130 Package, Patch, Pattern, and Product Management
133 Summary: Package, Patch, Pattern, and Product Management - developers files
134 Group: Development/Libraries/C and C++
135 Provides: yast2-packagemanager-devel
136 Obsoletes: yast2-packagemanager-devel
137 %if 0%{?suse_version} >= 1330
138 Requires: libboost_headers-devel
139 Requires: libboost_program_options-devel
140 Requires: libboost_test-devel
142 Requires: boost-devel
145 Requires: glibc-devel
146 Requires: libstdc++-devel
147 Requires: libxml2-devel
148 Requires: libzypp = %{version}
149 Requires: openssl-devel
151 Requires: rpm-devel > 4.4
153 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
154 Requires: libudev-devel
159 %if 0%{?suse_version}
160 %if 0%{?suse_version} >= 1100
162 Requires: libcurl-devel >= %{min_curl_version}
168 # Other distros (Fedora)
169 Requires: libcurl-devel >= %{min_curl_version}
171 %if 0%{?suse_version} >= 1100
172 %requires_ge libsolv-devel
174 Requires: libsolv-devel
178 Package, Patch, Pattern, and Product Management - developers files
181 Summary: Package, Patch, Pattern, and Product Management - developers files
182 Group: Documentation/HTML
184 %description devel-doc
185 Package, Patch, Pattern, and Product Management - developers files
193 export CFLAGS="$RPM_OPT_FLAGS"
194 export CXXFLAGS="$RPM_OPT_FLAGS"
195 unset EXTRA_CMAKE_OPTIONS
196 # No libproxy on SLE11
197 %if 0%{?suse_version} == 1110
198 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
201 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
202 -DDOC_INSTALL_DIR=%{_docdir} \
204 -DCMAKE_BUILD_TYPE=Release \
205 -DCMAKE_SKIP_RPATH=1 \
206 ${EXTRA_CMAKE_OPTIONS} \
208 make %{?_smp_mflags} VERBOSE=1
209 make -C doc/autodoc %{?_smp_mflags}
210 make -C po %{?_smp_mflags} translations
211 make -C tests %{?_smp_mflags}
214 rm -rf "$RPM_BUILD_ROOT"
216 make install DESTDIR=$RPM_BUILD_ROOT
217 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
218 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
219 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
221 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
223 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
224 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
225 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vars.d
226 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
227 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/credentials.d
229 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
230 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
231 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
232 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
233 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
234 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
235 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
236 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
237 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
238 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
240 # Default to 'solver.dupAllowVendorChange = false' on TW and post SLE12
241 %if 0%{?suse_version} >= 1330 || "%{distribution}" == "openSUSE Tumbleweed"
242 sed -i "s|# solver.dupAllowVendorChange = true|solver.dupAllowVendorChange = false|g" %{buildroot}%{_sysconfdir}/zypp/zypp.conf
245 make -C po install DESTDIR=$RPM_BUILD_ROOT
246 # Create filelist with translations
252 LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:${LD_LIBRARY_PATH} ctest .
257 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
259 # convert old lock file to new
260 # TODO make this a separate file?
261 # TODO run the sript only when updating form pre-11.0 libzypp versions
262 LOCKSFILE=%{_sysconfdir}/zypp/locks
263 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
266 # if no such file, exit with false (1 in bash)
267 test -f ${LOCKSFILE} || return 1
269 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
270 if [ -s ${TEMP_FILE} ]
310 if is_old ${LOCKSFILE}
312 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
313 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
315 append_new_lock $line
319 %postun -p /sbin/ldconfig
322 rm -rf "$RPM_BUILD_ROOT"
325 %defattr(-,root,root)
326 %dir %{_sysconfdir}/zypp
327 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
328 %{_sysconfdir}/zypp/repos.d
330 %dir %{_sysconfdir}/zypp/repos.d
332 %dir %{_sysconfdir}/zypp/services.d
333 %dir %{_sysconfdir}/zypp/systemCheck.d
334 %dir %{_sysconfdir}/zypp/vars.d
335 %dir %{_sysconfdir}/zypp/vendors.d
336 %dir %{_sysconfdir}/zypp/multiversion.d
337 %dir %{_sysconfdir}/zypp/credentials.d
338 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
339 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
340 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
341 %dir %{_var}/lib/zypp
342 %dir %{_var}/log/zypp
343 %dir %{_var}/cache/zypp
347 %{_libdir}/libzypp*so.*
348 %doc %{_mandir}/man1/*.1.*
349 %doc %{_mandir}/man5/*.5.*
352 %defattr(-,root,root)
353 %{_libdir}/libzypp.so
355 %{_datadir}/cmake/Modules/*
356 %{_libdir}/pkgconfig/libzypp.pc
359 %defattr(-,root,root)