2 # spec file for package libzypp
4 # Copyright (c) 2005-2011 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 1
24 Group: System/Packages
25 BuildRoot: %{_tmppath}/%{name}-%{version}-build
26 Summary: Package, Patch, Pattern, and Product Management
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:commit) = 0
37 Provides: libzypp(plugin:services) = 0
38 Provides: libzypp(plugin:system) = 0
39 Provides: libzypp(plugin:urlresolver) = 0
43 # lsof is used for 'zypper ps':
47 BuildRequires: openssl-devel
48 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
49 BuildRequires: libudev-devel
51 BuildRequires: hal-devel
53 BuildRequires: boost-devel
54 BuildRequires: dejagnu
55 BuildRequires: doxygen
57 BuildRequires: gcc-c++ = 4.6
59 BuildRequires: gcc-c++ >= 4.6
61 BuildRequires: gettext-devel
62 BuildRequires: graphviz
63 BuildRequires: libxml2-devel
64 %if 0%{?suse_version} != 1110
66 BuildRequires: libproxy-devel
69 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
70 BuildRequires: pkgconfig
72 BuildRequires: pkg-config
75 BuildRequires: libsolv-devel
76 %if 0%{?suse_version} >= 1100
77 %requires_eq libsolv-tools
79 Requires: libsolv-tools
82 # required for testsuite, webrick
86 BuildRequires: libexpat-devel
88 BuildRequires: expat-devel
94 BuildRequires: rpm-devel
95 Requires: /usr/bin/uuidgen
96 %if 0%{?suse_version} > 1020
97 BuildRequires: hicolor-icon-theme
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
107 %if 0%{?mandriva_version}
108 BuildRequires: glib2-devel
109 BuildRequires: librpm-devel
114 %if 0%{?suse_version}
120 %define min_curl_version 7.19.4
121 %if 0%{?suse_version}
122 %if 0%{?suse_version} >= 1100
124 BuildRequires: libcurl-devel >= %{min_curl_version}
125 Requires: libcurl4 >= %{min_curl_version}
128 BuildRequires: curl-devel
131 # Other distros (Fedora)
132 BuildRequires: libcurl-devel >= %{min_curl_version}
133 Requires: libcurl >= %{min_curl_version}
137 Package, Patch, Pattern, and Product Management
141 Michael Andres <ma@suse.de>
142 Jiri Srain <jsrain@suse.cz>
143 Stefan Schubert <schubi@suse.de>
144 Duncan Mac-Vicar <dmacvicar@suse.de>
145 Klaus Kaempf <kkaempf@suse.de>
146 Marius Tomaschewski <mt@suse.de>
147 Stanislav Visnovsky <visnov@suse.cz>
148 Ladislav Slezak <lslezak@suse.cz>
152 Requires: libzypp = %{version}
153 Requires: libxml2-devel
154 Requires: openssl-devel
156 Requires: glibc-devel
160 Requires: boost-devel
161 Requires: libstdc++-devel
162 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
163 Requires: libudev-devel
168 %if 0%{?suse_version}
169 %if 0%{?suse_version} >= 1100
171 Requires: libcurl-devel >= %{min_curl_version}
177 # Other distros (Fedora)
178 Requires: libcurl-devel >= %{min_curl_version}
180 %if 0%{?suse_version} >= 1100
181 %requires_ge libsolv-devel
183 Requires: libsolv-devel
185 Summary: Package, Patch, Pattern, and Product Management - developers files
186 Group: System/Packages
187 Provides: yast2-packagemanager-devel
188 Obsoletes: yast2-packagemanager-devel
190 %description -n libzypp-devel
191 Package, Patch, Pattern, and Product Management - developers files
195 Michael Andres <ma@suse.de>
196 Jiri Srain <jsrain@suse.cz>
197 Stefan Schubert <schubi@suse.de>
198 Duncan Mac-Vicar <dmacvicar@suse.de>
199 Klaus Kaempf <kkaempf@suse.de>
200 Marius Tomaschewski <mt@suse.de>
201 Stanislav Visnovsky <visnov@suse.cz>
202 Ladislav Slezak <lslezak@suse.cz>
210 %if 0%{?force_gcc_46}
214 export CFLAGS="$RPM_OPT_FLAGS"
215 export CXXFLAGS="$RPM_OPT_FLAGS"
216 unset TRANSLATION_SET
217 unset EXTRA_CMAKE_OPTIONS
218 # SLE11-* might want its own translation set:
219 %if 0%{?suse_version} == 1110
220 if [ -f ../po/sle-zypp-po.tar.bz ]; then
221 export TRANSLATION_SET=sle-zypp
222 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
225 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
226 -DDOC_INSTALL_DIR=%{_docdir} \
228 -DCMAKE_BUILD_TYPE=Release \
229 -DCMAKE_SKIP_RPATH=1 \
230 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
231 ${EXTRA_CMAKE_OPTIONS} \
233 make %{?_smp_mflags} VERBOSE=1
234 make -C doc/autodoc %{?_smp_mflags}
235 make -C po %{?_smp_mflags} translations
237 %if 0%{?run_testsuite}
238 make -C tests %{?_smp_mflags}
240 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
247 rm -rf "$RPM_BUILD_ROOT"
249 make install DESTDIR=$RPM_BUILD_ROOT
250 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
251 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
252 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
254 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
256 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
257 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
258 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
259 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
260 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
261 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
262 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
263 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
264 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
265 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
266 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
267 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
269 make -C po install DESTDIR=$RPM_BUILD_ROOT
270 # Create filelist with translations
276 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
278 # convert old lock file to new
279 # TODO make this a separate file?
280 # TODO run the sript only when updating form pre-11.0 libzypp versions
281 LOCKSFILE=%{_sysconfdir}/zypp/locks
282 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
285 # if no such file, exit with false (1 in bash)
286 test -f ${LOCKSFILE} || return 1
288 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
289 if [ -s ${TEMP_FILE} ]
329 if is_old ${LOCKSFILE}
331 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
332 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
334 append_new_lock $line
338 %postun -p /sbin/ldconfig
341 rm -rf "$RPM_BUILD_ROOT"
344 %defattr(-,root,root)
345 %dir %{_sysconfdir}/zypp
346 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
347 %{_sysconfdir}/zypp/repos.d
349 %dir %{_sysconfdir}/zypp/repos.d
351 %dir %{_sysconfdir}/zypp/services.d
352 %dir %{_sysconfdir}/zypp/vendors.d
353 %dir %{_sysconfdir}/zypp/multiversion.d
354 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
355 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
356 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
357 %dir %{_var}/lib/zypp
358 %dir %{_var}/log/zypp
359 %dir %{_var}/cache/zypp
363 %{_libdir}/libzypp*so.*
364 %doc %{_mandir}/man5/locks.5.*
367 %defattr(-,root,root)
368 %{_libdir}/libzypp.so
371 %{_datadir}/cmake/Modules/*
372 %{_libdir}/pkgconfig/libzypp.pc