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 >= 0.2.1
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
98 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
99 BuildRequires: glib2-devel
100 BuildRequires: popt-devel
101 BuildRequires: rpm-devel
104 %if 0%{?mandriva_version}
105 BuildRequires: glib2-devel
106 BuildRequires: librpm-devel
109 %if 0%{?suse_version}
115 %define min_curl_version 7.19.4
116 %if 0%{?suse_version}
117 %if 0%{?suse_version} >= 1100
119 BuildRequires: libcurl-devel >= %{min_curl_version}
120 Requires: libcurl4 >= %{min_curl_version}
123 BuildRequires: curl-devel
126 # Other distros (Fedora)
127 BuildRequires: libcurl-devel >= %{min_curl_version}
128 Requires: libcurl >= %{min_curl_version}
132 Package, Patch, Pattern, and Product Management
136 Michael Andres <ma@suse.de>
137 Jiri Srain <jsrain@suse.cz>
138 Stefan Schubert <schubi@suse.de>
139 Duncan Mac-Vicar <dmacvicar@suse.de>
140 Klaus Kaempf <kkaempf@suse.de>
141 Marius Tomaschewski <mt@suse.de>
142 Stanislav Visnovsky <visnov@suse.cz>
143 Ladislav Slezak <lslezak@suse.cz>
147 Requires: libzypp = %{version}
148 Requires: libxml2-devel
149 Requires: openssl-devel
151 Requires: glibc-devel
155 Requires: boost-devel
156 Requires: libstdc++-devel
157 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
158 Requires: libudev-devel
163 %if 0%{?suse_version}
164 %if 0%{?suse_version} >= 1100
166 Requires: libcurl-devel >= %{min_curl_version}
172 # Other distros (Fedora)
173 Requires: libcurl-devel >= %{min_curl_version}
175 %if 0%{?suse_version} >= 1100
176 %requires_ge libsolv-devel
178 Requires: libsolv-devel
180 Summary: Package, Patch, Pattern, and Product Management - developers files
181 Group: System/Packages
182 Provides: yast2-packagemanager-devel
183 Obsoletes: yast2-packagemanager-devel
185 %description -n libzypp-devel
186 Package, Patch, Pattern, and Product Management - developers files
190 Michael Andres <ma@suse.de>
191 Jiri Srain <jsrain@suse.cz>
192 Stefan Schubert <schubi@suse.de>
193 Duncan Mac-Vicar <dmacvicar@suse.de>
194 Klaus Kaempf <kkaempf@suse.de>
195 Marius Tomaschewski <mt@suse.de>
196 Stanislav Visnovsky <visnov@suse.cz>
197 Ladislav Slezak <lslezak@suse.cz>
205 %if 0%{?force_gcc_46}
209 export CFLAGS="$RPM_OPT_FLAGS"
210 export CXXFLAGS="$RPM_OPT_FLAGS"
211 unset TRANSLATION_SET
212 unset EXTRA_CMAKE_OPTIONS
213 # SLE11-* might want its own translation set:
214 %if 0%{?suse_version} == 1110
215 if [ -f ../po/sle-zypp-po.tar.bz ]; then
216 export TRANSLATION_SET=sle-zypp
217 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
220 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
221 -DDOC_INSTALL_DIR=%{_docdir} \
223 -DCMAKE_BUILD_TYPE=Release \
224 -DCMAKE_SKIP_RPATH=1 \
225 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
226 ${EXTRA_CMAKE_OPTIONS} \
228 make %{?_smp_mflags} VERBOSE=1
229 make -C doc/autodoc %{?_smp_mflags}
230 make -C po %{?_smp_mflags} translations
232 %if 0%{?run_testsuite}
233 make -C tests %{?_smp_mflags}
235 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
242 rm -rf "$RPM_BUILD_ROOT"
244 make install DESTDIR=$RPM_BUILD_ROOT
245 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
246 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
247 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
249 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
251 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
252 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
253 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
254 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
255 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
256 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
257 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
258 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
259 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
260 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
261 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
262 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
264 make -C po install DESTDIR=$RPM_BUILD_ROOT
265 # Create filelist with translations
271 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
273 # convert old lock file to new
274 # TODO make this a separate file?
275 # TODO run the sript only when updating form pre-11.0 libzypp versions
276 LOCKSFILE=%{_sysconfdir}/zypp/locks
277 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
280 # if no such file, exit with false (1 in bash)
281 test -f ${LOCKSFILE} || return 1
283 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
284 if [ -s ${TEMP_FILE} ]
324 if is_old ${LOCKSFILE}
326 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
327 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
329 append_new_lock $line
333 %postun -p /sbin/ldconfig
336 rm -rf "$RPM_BUILD_ROOT"
339 %defattr(-,root,root)
340 %dir %{_sysconfdir}/zypp
341 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
342 %{_sysconfdir}/zypp/repos.d
344 %dir %{_sysconfdir}/zypp/repos.d
346 %dir %{_sysconfdir}/zypp/services.d
347 %dir %{_sysconfdir}/zypp/vendors.d
348 %dir %{_sysconfdir}/zypp/multiversion.d
349 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
350 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
351 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
352 %dir %{_var}/lib/zypp
353 %dir %{_var}/log/zypp
354 %dir %{_var}/cache/zypp
358 %{_libdir}/libzypp*so.*
359 %doc %{_mandir}/man5/locks.5.*
362 %defattr(-,root,root)
363 %{_libdir}/libzypp.so
366 %{_datadir}/cmake/Modules/*
367 %{_libdir}/pkgconfig/libzypp.pc