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 0
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
58 BuildRequires: gcc46-c++
60 BuildRequires: gcc-c++ >= 4.6
62 BuildRequires: gettext-devel
63 BuildRequires: graphviz
64 BuildRequires: libxml2-devel
65 %if 0%{?suse_version} != 1110
67 BuildRequires: libproxy-devel
70 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
71 BuildRequires: pkgconfig
73 BuildRequires: pkg-config
76 BuildRequires: libsolv-devel
77 %if 0%{?suse_version} >= 1100
78 %requires_eq libsolv-tools
80 Requires: libsolv-tools
83 # required for testsuite, webrick
87 BuildRequires: libexpat-devel
89 BuildRequires: expat-devel
95 BuildRequires: rpm-devel
96 Requires: /usr/bin/uuidgen
99 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
100 BuildRequires: glib2-devel
101 BuildRequires: popt-devel
102 BuildRequires: rpm-devel
105 %if 0%{?mandriva_version}
106 BuildRequires: glib2-devel
107 BuildRequires: librpm-devel
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
139 Michael Andres <ma@suse.de>
140 Jiri Srain <jsrain@suse.cz>
141 Stefan Schubert <schubi@suse.de>
142 Duncan Mac-Vicar <dmacvicar@suse.de>
143 Klaus Kaempf <kkaempf@suse.de>
144 Marius Tomaschewski <mt@suse.de>
145 Stanislav Visnovsky <visnov@suse.cz>
146 Ladislav Slezak <lslezak@suse.cz>
150 Requires: libzypp = %{version}
151 Requires: libxml2-devel
152 Requires: openssl-devel
154 Requires: glibc-devel
158 Requires: boost-devel
159 Requires: libstdc++-devel
160 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
161 Requires: libudev-devel
166 %if 0%{?suse_version}
167 %if 0%{?suse_version} >= 1100
169 Requires: libcurl-devel >= %{min_curl_version}
175 # Other distros (Fedora)
176 Requires: libcurl-devel >= %{min_curl_version}
178 %if 0%{?suse_version} >= 1100
179 %requires_ge libsolv-devel
181 Requires: libsolv-devel
183 Summary: Package, Patch, Pattern, and Product Management - developers files
184 Group: System/Packages
185 Provides: yast2-packagemanager-devel
186 Obsoletes: yast2-packagemanager-devel
188 %description -n libzypp-devel
189 Package, Patch, Pattern, and Product Management - developers files
193 Michael Andres <ma@suse.de>
194 Jiri Srain <jsrain@suse.cz>
195 Stefan Schubert <schubi@suse.de>
196 Duncan Mac-Vicar <dmacvicar@suse.de>
197 Klaus Kaempf <kkaempf@suse.de>
198 Marius Tomaschewski <mt@suse.de>
199 Stanislav Visnovsky <visnov@suse.cz>
200 Ladislav Slezak <lslezak@suse.cz>
208 %if 0%{?force_gcc_46}
212 export CFLAGS="$RPM_OPT_FLAGS"
213 export CXXFLAGS="$RPM_OPT_FLAGS"
214 unset TRANSLATION_SET
215 unset EXTRA_CMAKE_OPTIONS
216 # SLE11-* might want its own translation set:
217 %if 0%{?suse_version} == 1110
218 if [ -f ../po/sle-zypp-po.tar.bz ]; then
219 export TRANSLATION_SET=sle-zypp
220 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
223 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
224 -DDOC_INSTALL_DIR=%{_docdir} \
226 -DCMAKE_BUILD_TYPE=Release \
227 -DCMAKE_SKIP_RPATH=1 \
228 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
229 ${EXTRA_CMAKE_OPTIONS} \
231 make %{?_smp_mflags} VERBOSE=1
232 make -C doc/autodoc %{?_smp_mflags}
233 make -C po %{?_smp_mflags} translations
235 %if 0%{?run_testsuite}
236 make -C tests %{?_smp_mflags}
238 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
245 rm -rf "$RPM_BUILD_ROOT"
247 make install DESTDIR=$RPM_BUILD_ROOT
248 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
249 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
250 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
252 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
254 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
255 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
256 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
257 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
258 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
259 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
260 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
261 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
262 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
263 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
264 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
265 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
267 make -C po install DESTDIR=$RPM_BUILD_ROOT
268 # Create filelist with translations
274 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
276 # convert old lock file to new
277 # TODO make this a separate file?
278 # TODO run the sript only when updating form pre-11.0 libzypp versions
279 LOCKSFILE=%{_sysconfdir}/zypp/locks
280 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
283 # if no such file, exit with false (1 in bash)
284 test -f ${LOCKSFILE} || return 1
286 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
287 if [ -s ${TEMP_FILE} ]
327 if is_old ${LOCKSFILE}
329 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
330 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
332 append_new_lock $line
336 %postun -p /sbin/ldconfig
339 rm -rf "$RPM_BUILD_ROOT"
342 %defattr(-,root,root)
343 %dir %{_sysconfdir}/zypp
344 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
345 %{_sysconfdir}/zypp/repos.d
347 %dir %{_sysconfdir}/zypp/repos.d
349 %dir %{_sysconfdir}/zypp/services.d
350 %dir %{_sysconfdir}/zypp/vendors.d
351 %dir %{_sysconfdir}/zypp/multiversion.d
352 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
353 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
354 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
355 %dir %{_var}/lib/zypp
356 %dir %{_var}/log/zypp
357 %dir %{_var}/cache/zypp
361 %{_libdir}/libzypp*so.*
362 %doc %{_mandir}/man5/locks.5.*
365 %defattr(-,root,root)
366 %{_libdir}/libzypp.so
369 %{_datadir}/cmake/Modules/*
370 %{_libdir}/pkgconfig/libzypp.pc