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
22 BuildRoot: %{_tmppath}/%{name}-%{version}-build
23 Summary: Package, Patch, Pattern, and Product Management
25 Group: System/Packages
28 Source: %{name}-%{version}.tar.bz2
29 Source1: %{name}-rpmlintrc
30 Provides: yast2-packagemanager
31 Obsoletes: yast2-packagemanager
33 # Features we provide (update doc/autoinclude/FeatureTest.doc):
34 Provides: libzypp(plugin) = 0
35 Provides: libzypp(plugin:appdata) = 0
36 Provides: libzypp(plugin:commit) = 1
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: graphviz-gnome
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.5
78 %if 0%{?suse_version} >= 1100
79 BuildRequires: libsolv-tools
80 %requires_eq libsolv-tools
82 Requires: libsolv-tools
85 # required for testsuite, webrick
89 BuildRequires: libexpat-devel
91 BuildRequires: expat-devel
97 BuildRequires: rpm-devel
100 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
101 BuildRequires: glib2-devel
102 BuildRequires: popt-devel
103 BuildRequires: rpm-devel
106 %if 0%{?mandriva_version}
107 BuildRequires: glib2-devel
108 BuildRequires: librpm-devel
111 %if 0%{?suse_version}
117 %define min_curl_version 7.19.4
118 %if 0%{?suse_version}
119 %if 0%{?suse_version} >= 1100
121 BuildRequires: libcurl-devel >= %{min_curl_version}
122 Requires: libcurl4 >= %{min_curl_version}
125 BuildRequires: curl-devel
128 # Other distros (Fedora)
129 BuildRequires: libcurl-devel >= %{min_curl_version}
130 Requires: libcurl >= %{min_curl_version}
134 Package, Patch, Pattern, and Product Management
138 Michael Andres <ma@suse.de>
139 Jiri Srain <jsrain@suse.cz>
140 Stefan Schubert <schubi@suse.de>
141 Duncan Mac-Vicar <dmacvicar@suse.de>
142 Klaus Kaempf <kkaempf@suse.de>
143 Marius Tomaschewski <mt@suse.de>
144 Stanislav Visnovsky <visnov@suse.cz>
145 Ladislav Slezak <lslezak@suse.cz>
148 Requires: boost-devel
150 Requires: glibc-devel
151 Requires: libstdc++-devel
152 Requires: libxml2-devel
153 Requires: libzypp = %{version}
154 Requires: openssl-devel
158 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
159 Requires: libudev-devel
164 %if 0%{?suse_version}
165 %if 0%{?suse_version} >= 1100
167 Requires: libcurl-devel >= %{min_curl_version}
173 # Other distros (Fedora)
174 Requires: libcurl-devel >= %{min_curl_version}
176 %if 0%{?suse_version} >= 1100
177 %requires_ge libsolv-devel
179 Requires: libsolv-devel
181 Summary: Package, Patch, Pattern, and Product Management - developers files
182 Group: System/Packages
183 Provides: yast2-packagemanager-devel
184 Obsoletes: yast2-packagemanager-devel
186 %description -n libzypp-devel
187 Package, Patch, Pattern, and Product Management - developers files
191 Michael Andres <ma@suse.de>
192 Jiri Srain <jsrain@suse.cz>
193 Stefan Schubert <schubi@suse.de>
194 Duncan Mac-Vicar <dmacvicar@suse.de>
195 Klaus Kaempf <kkaempf@suse.de>
196 Marius Tomaschewski <mt@suse.de>
197 Stanislav Visnovsky <visnov@suse.cz>
198 Ladislav Slezak <lslezak@suse.cz>
206 %if 0%{?force_gcc_46}
210 export CFLAGS="$RPM_OPT_FLAGS"
211 export CXXFLAGS="$RPM_OPT_FLAGS"
212 unset TRANSLATION_SET
213 unset EXTRA_CMAKE_OPTIONS
214 # Same codebase, but SLES may use it's own translation set.
218 %if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315
219 if [ -f ../po/sle-zypp-po.tar.bz ]; then
220 export TRANSLATION_SET=sle-zypp
223 # No libproxy on SLE11
224 %if 0%{?suse_version} == 1110
225 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
228 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
229 -DDOC_INSTALL_DIR=%{_docdir} \
231 -DCMAKE_BUILD_TYPE=Release \
232 -DCMAKE_SKIP_RPATH=1 \
233 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
234 ${EXTRA_CMAKE_OPTIONS} \
236 make %{?_smp_mflags} VERBOSE=1
237 make -C doc/autodoc %{?_smp_mflags}
238 make -C po %{?_smp_mflags} translations
240 %if 0%{?run_testsuite}
241 make -C tests %{?_smp_mflags}
243 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
250 rm -rf "$RPM_BUILD_ROOT"
252 make install DESTDIR=$RPM_BUILD_ROOT
253 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
254 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
255 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
257 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
259 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
260 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
261 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
262 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
263 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
264 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
265 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
266 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
267 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
268 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
269 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
270 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
271 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
273 make -C po install DESTDIR=$RPM_BUILD_ROOT
274 # Create filelist with translations
280 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
282 # convert old lock file to new
283 # TODO make this a separate file?
284 # TODO run the sript only when updating form pre-11.0 libzypp versions
285 LOCKSFILE=%{_sysconfdir}/zypp/locks
286 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
289 # if no such file, exit with false (1 in bash)
290 test -f ${LOCKSFILE} || return 1
292 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
293 if [ -s ${TEMP_FILE} ]
333 if is_old ${LOCKSFILE}
335 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
336 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
338 append_new_lock $line
342 %postun -p /sbin/ldconfig
345 rm -rf "$RPM_BUILD_ROOT"
348 %defattr(-,root,root)
349 %dir %{_sysconfdir}/zypp
350 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
351 %{_sysconfdir}/zypp/repos.d
353 %dir %{_sysconfdir}/zypp/repos.d
355 %dir %{_sysconfdir}/zypp/services.d
356 %dir %{_sysconfdir}/zypp/vendors.d
357 %dir %{_sysconfdir}/zypp/multiversion.d
358 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
359 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
360 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
361 %dir %{_var}/lib/zypp
362 %dir %{_var}/log/zypp
363 %dir %{_var}/cache/zypp
367 %{_libdir}/libzypp*so.*
368 %doc %{_mandir}/man1/*.1.*
369 %doc %{_mandir}/man5/*.5.*
372 %defattr(-,root,root)
373 %{_libdir}/libzypp.so
376 %{_datadir}/cmake/Modules/*
377 %{_libdir}/pkgconfig/libzypp.pc