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
97 %if 0%{?suse_version} > 1020
98 BuildRequires: hicolor-icon-theme
102 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
103 BuildRequires: glib2-devel
104 BuildRequires: popt-devel
105 BuildRequires: rpm-devel
108 %if 0%{?mandriva_version}
109 BuildRequires: glib2-devel
110 BuildRequires: librpm-devel
115 %if 0%{?suse_version}
121 %define min_curl_version 7.19.4
122 %if 0%{?suse_version}
123 %if 0%{?suse_version} >= 1100
125 BuildRequires: libcurl-devel >= %{min_curl_version}
126 Requires: libcurl4 >= %{min_curl_version}
129 BuildRequires: curl-devel
132 # Other distros (Fedora)
133 BuildRequires: libcurl-devel >= %{min_curl_version}
134 Requires: libcurl >= %{min_curl_version}
138 Package, Patch, Pattern, and Product Management
142 Michael Andres <ma@suse.de>
143 Jiri Srain <jsrain@suse.cz>
144 Stefan Schubert <schubi@suse.de>
145 Duncan Mac-Vicar <dmacvicar@suse.de>
146 Klaus Kaempf <kkaempf@suse.de>
147 Marius Tomaschewski <mt@suse.de>
148 Stanislav Visnovsky <visnov@suse.cz>
149 Ladislav Slezak <lslezak@suse.cz>
153 Requires: libzypp = %{version}
154 Requires: libxml2-devel
155 Requires: openssl-devel
157 Requires: glibc-devel
161 Requires: boost-devel
162 Requires: libstdc++-devel
163 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
164 Requires: libudev-devel
169 %if 0%{?suse_version}
170 %if 0%{?suse_version} >= 1100
172 Requires: libcurl-devel >= %{min_curl_version}
178 # Other distros (Fedora)
179 Requires: libcurl-devel >= %{min_curl_version}
181 %if 0%{?suse_version} >= 1100
182 %requires_ge libsolv-devel
184 Requires: libsolv-devel
186 Summary: Package, Patch, Pattern, and Product Management - developers files
187 Group: System/Packages
188 Provides: yast2-packagemanager-devel
189 Obsoletes: yast2-packagemanager-devel
191 %description -n libzypp-devel
192 Package, Patch, Pattern, and Product Management - developers files
196 Michael Andres <ma@suse.de>
197 Jiri Srain <jsrain@suse.cz>
198 Stefan Schubert <schubi@suse.de>
199 Duncan Mac-Vicar <dmacvicar@suse.de>
200 Klaus Kaempf <kkaempf@suse.de>
201 Marius Tomaschewski <mt@suse.de>
202 Stanislav Visnovsky <visnov@suse.cz>
203 Ladislav Slezak <lslezak@suse.cz>
211 %if 0%{?force_gcc_46}
215 export CFLAGS="$RPM_OPT_FLAGS"
216 export CXXFLAGS="$RPM_OPT_FLAGS"
217 unset TRANSLATION_SET
218 unset EXTRA_CMAKE_OPTIONS
219 # SLE11-* might want its own translation set:
220 %if 0%{?suse_version} == 1110
221 if [ -f ../po/sle-zypp-po.tar.bz ]; then
222 export TRANSLATION_SET=sle-zypp
223 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
226 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
227 -DDOC_INSTALL_DIR=%{_docdir} \
229 -DCMAKE_BUILD_TYPE=Release \
230 -DCMAKE_SKIP_RPATH=1 \
231 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
232 ${EXTRA_CMAKE_OPTIONS} \
234 make %{?_smp_mflags} VERBOSE=1
235 make -C doc/autodoc %{?_smp_mflags}
236 make -C po %{?_smp_mflags} translations
238 %if 0%{?run_testsuite}
239 make -C tests %{?_smp_mflags}
241 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
248 rm -rf "$RPM_BUILD_ROOT"
250 make install DESTDIR=$RPM_BUILD_ROOT
251 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
252 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
253 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
255 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
257 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
258 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
259 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
260 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
261 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
262 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
263 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
264 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
265 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
266 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
267 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
268 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
270 make -C po install DESTDIR=$RPM_BUILD_ROOT
271 # Create filelist with translations
277 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
279 # convert old lock file to new
280 # TODO make this a separate file?
281 # TODO run the sript only when updating form pre-11.0 libzypp versions
282 LOCKSFILE=%{_sysconfdir}/zypp/locks
283 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
286 # if no such file, exit with false (1 in bash)
287 test -f ${LOCKSFILE} || return 1
289 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
290 if [ -s ${TEMP_FILE} ]
330 if is_old ${LOCKSFILE}
332 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
333 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
335 append_new_lock $line
339 %postun -p /sbin/ldconfig
342 rm -rf "$RPM_BUILD_ROOT"
345 %defattr(-,root,root)
346 %dir %{_sysconfdir}/zypp
347 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
348 %{_sysconfdir}/zypp/repos.d
350 %dir %{_sysconfdir}/zypp/repos.d
352 %dir %{_sysconfdir}/zypp/services.d
353 %dir %{_sysconfdir}/zypp/vendors.d
354 %dir %{_sysconfdir}/zypp/multiversion.d
355 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
356 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
357 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
358 %dir %{_var}/lib/zypp
359 %dir %{_var}/log/zypp
360 %dir %{_var}/cache/zypp
364 %{_libdir}/libzypp*so.*
365 %doc %{_mandir}/man5/locks.5.*
368 %defattr(-,root,root)
369 %{_libdir}/libzypp.so
372 %{_datadir}/cmake/Modules/*
373 %{_libdir}/pkgconfig/libzypp.pc