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:commit) = 1
36 Provides: libzypp(plugin:services) = 0
37 Provides: libzypp(plugin:system) = 0
38 Provides: libzypp(plugin:urlresolver) = 0
42 # lsof is used for 'zypper ps':
46 BuildRequires: openssl-devel
47 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
48 BuildRequires: libudev-devel
50 BuildRequires: hal-devel
52 BuildRequires: boost-devel
53 BuildRequires: dejagnu
54 BuildRequires: doxygen
57 BuildRequires: gcc46-c++
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 >= 0.3.0
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
97 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
98 BuildRequires: glib2-devel
99 BuildRequires: popt-devel
100 BuildRequires: rpm-devel
103 %if 0%{?mandriva_version}
104 BuildRequires: glib2-devel
105 BuildRequires: librpm-devel
108 %if 0%{?suse_version}
114 %define min_curl_version 7.19.4
115 %if 0%{?suse_version}
116 %if 0%{?suse_version} >= 1100
118 BuildRequires: libcurl-devel >= %{min_curl_version}
119 Requires: libcurl4 >= %{min_curl_version}
122 BuildRequires: curl-devel
125 # Other distros (Fedora)
126 BuildRequires: libcurl-devel >= %{min_curl_version}
127 Requires: libcurl >= %{min_curl_version}
131 Package, Patch, Pattern, and Product Management
135 Michael Andres <ma@suse.de>
136 Jiri Srain <jsrain@suse.cz>
137 Stefan Schubert <schubi@suse.de>
138 Duncan Mac-Vicar <dmacvicar@suse.de>
139 Klaus Kaempf <kkaempf@suse.de>
140 Marius Tomaschewski <mt@suse.de>
141 Stanislav Visnovsky <visnov@suse.cz>
142 Ladislav Slezak <lslezak@suse.cz>
145 Requires: boost-devel
147 Requires: glibc-devel
148 Requires: libstdc++-devel
149 Requires: libxml2-devel
150 Requires: libzypp = %{version}
151 Requires: openssl-devel
155 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
156 Requires: libudev-devel
161 %if 0%{?suse_version}
162 %if 0%{?suse_version} >= 1100
164 Requires: libcurl-devel >= %{min_curl_version}
170 # Other distros (Fedora)
171 Requires: libcurl-devel >= %{min_curl_version}
173 %if 0%{?suse_version} >= 1100
174 %requires_ge libsolv-devel
176 Requires: libsolv-devel
178 Summary: Package, Patch, Pattern, and Product Management - developers files
179 Group: System/Packages
180 Provides: yast2-packagemanager-devel
181 Obsoletes: yast2-packagemanager-devel
183 %description -n libzypp-devel
184 Package, Patch, Pattern, and Product Management - developers files
188 Michael Andres <ma@suse.de>
189 Jiri Srain <jsrain@suse.cz>
190 Stefan Schubert <schubi@suse.de>
191 Duncan Mac-Vicar <dmacvicar@suse.de>
192 Klaus Kaempf <kkaempf@suse.de>
193 Marius Tomaschewski <mt@suse.de>
194 Stanislav Visnovsky <visnov@suse.cz>
195 Ladislav Slezak <lslezak@suse.cz>
203 %if 0%{?force_gcc_46}
207 export CFLAGS="$RPM_OPT_FLAGS"
208 export CXXFLAGS="$RPM_OPT_FLAGS"
209 unset TRANSLATION_SET
210 unset EXTRA_CMAKE_OPTIONS
211 # SLE11-* might want its own translation set:
212 %if 0%{?suse_version} == 1110
213 if [ -f ../po/sle-zypp-po.tar.bz ]; then
214 export TRANSLATION_SET=sle-zypp
215 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
218 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
219 -DDOC_INSTALL_DIR=%{_docdir} \
221 -DCMAKE_BUILD_TYPE=Release \
222 -DCMAKE_SKIP_RPATH=1 \
223 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
224 ${EXTRA_CMAKE_OPTIONS} \
226 make %{?_smp_mflags} VERBOSE=1
227 make -C doc/autodoc %{?_smp_mflags}
228 make -C po %{?_smp_mflags} translations
230 %if 0%{?run_testsuite}
231 make -C tests %{?_smp_mflags}
233 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
240 rm -rf "$RPM_BUILD_ROOT"
242 make install DESTDIR=$RPM_BUILD_ROOT
243 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
244 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
245 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
247 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
249 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
250 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
251 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
252 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
253 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
254 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
255 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
256 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
257 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
258 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
259 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
260 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
262 make -C po install DESTDIR=$RPM_BUILD_ROOT
263 # Create filelist with translations
269 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
271 # convert old lock file to new
272 # TODO make this a separate file?
273 # TODO run the sript only when updating form pre-11.0 libzypp versions
274 LOCKSFILE=%{_sysconfdir}/zypp/locks
275 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
278 # if no such file, exit with false (1 in bash)
279 test -f ${LOCKSFILE} || return 1
281 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
282 if [ -s ${TEMP_FILE} ]
322 if is_old ${LOCKSFILE}
324 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
325 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
327 append_new_lock $line
331 %postun -p /sbin/ldconfig
334 rm -rf "$RPM_BUILD_ROOT"
337 %defattr(-,root,root)
338 %dir %{_sysconfdir}/zypp
339 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
340 %{_sysconfdir}/zypp/repos.d
342 %dir %{_sysconfdir}/zypp/repos.d
344 %dir %{_sysconfdir}/zypp/services.d
345 %dir %{_sysconfdir}/zypp/vendors.d
346 %dir %{_sysconfdir}/zypp/multiversion.d
347 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
348 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
349 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
350 %dir %{_var}/lib/zypp
351 %dir %{_var}/log/zypp
352 %dir %{_var}/cache/zypp
356 %{_libdir}/libzypp*so.*
357 %doc %{_mandir}/man5/locks.5.*
360 %defattr(-,root,root)
361 %{_libdir}/libzypp.so
364 %{_datadir}/cmake/Modules/*
365 %{_libdir}/pkgconfig/libzypp.pc