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/
23 Group: System/Packages
24 BuildRoot: %{_tmppath}/%{name}-%{version}-build
25 Summary: Package, Patch, Pattern, and Product Management
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) = 0
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
48 BuildRequires: libudev-devel
50 BuildRequires: hal-devel
52 BuildRequires: boost-devel
53 BuildRequires: dejagnu
54 BuildRequires: doxygen
55 BuildRequires: gcc-c++ >= 4.5
56 BuildRequires: gettext-devel
57 BuildRequires: graphviz
58 BuildRequires: libxml2-devel
59 BuildRequires: libproxy-devel
61 BuildRequires: libsolv-devel
62 %if 0%{?suse_version} >= 1100
63 %requires_eq libsolv-tools
65 Requires: libsolv-tools
68 # required for testsuite, webrick
72 BuildRequires: libexpat-devel
74 BuildRequires: expat-devel
80 BuildRequires: rpm-devel
81 Requires: /usr/bin/uuidgen
82 %if 0%{?suse_version} > 1020
83 BuildRequires: hicolor-icon-theme
87 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
88 BuildRequires: glib2-devel
89 BuildRequires: popt-devel
90 BuildRequires: rpm-devel
93 %if 0%{?mandriva_version}
94 BuildRequires: glib2-devel
95 BuildRequires: librpm-devel
100 %if 0%{?suse_version}
106 # ---------------------------------------------------------------
107 %if 0%{?suse_version} >= 1110
108 # (almost) common codebase, but on SLES11-SP1 (according to Rudi
109 # suse_version == 1110) we have a patched libcurl-7.19.0-11.22,
110 # and no aria2. Furthermore SLE may use it's own set of .po files
111 # from po/sle-zypp-po.tar.bz2.
113 # this check should use 7.19.0 if SLE and 7.19.4 if not (backported
114 # CURLOPT_REDIR_PROTOCOLS)
115 %define min_curl_version 7.19.0-11.22
118 # ---------------------------------------------------------------
120 %if 0%{?suse_version}
121 %if 0%{?suse_version} >= 1100
123 BuildRequires: libcurl-devel >= %{min_curl_version}
124 Requires: libcurl4 >= %{min_curl_version}
127 BuildRequires: curl-devel
130 # Other distros (Fedora)
131 BuildRequires: libcurl-devel >= %{min_curl_version}
132 Requires: libcurl >= %{min_curl_version}
136 Package, Patch, Pattern, and Product Management
140 Michael Andres <ma@suse.de>
141 Jiri Srain <jsrain@suse.cz>
142 Stefan Schubert <schubi@suse.de>
143 Duncan Mac-Vicar <dmacvicar@suse.de>
144 Klaus Kaempf <kkaempf@suse.de>
145 Marius Tomaschewski <mt@suse.de>
146 Stanislav Visnovsky <visnov@suse.cz>
147 Ladislav Slezak <lslezak@suse.cz>
151 Requires: libzypp = %{version}
152 Requires: libxml2-devel
153 Requires: openssl-devel
155 Requires: glibc-devel
159 Requires: boost-devel
160 Requires: libstdc++-devel
161 %if 0%{?suse_version} >= 1130
162 Requires: libudev-devel
167 %if 0%{?suse_version}
168 %if 0%{?suse_version} >= 1100
170 Requires: libcurl-devel >= %{min_curl_version}
176 # Other distros (Fedora)
177 Requires: libcurl-devel >= %{min_curl_version}
179 %if 0%{?suse_version} >= 1100
180 %requires_ge libsolv-devel
182 Requires: libsolv-devel
184 Summary: Package, Patch, Pattern, and Product Management - developers files
185 Group: System/Packages
186 Provides: yast2-packagemanager-devel
187 Obsoletes: yast2-packagemanager-devel
189 %description -n libzypp-devel
190 Package, Patch, Pattern, and Product Management - developers files
194 Michael Andres <ma@suse.de>
195 Jiri Srain <jsrain@suse.cz>
196 Stefan Schubert <schubi@suse.de>
197 Duncan Mac-Vicar <dmacvicar@suse.de>
198 Klaus Kaempf <kkaempf@suse.de>
199 Marius Tomaschewski <mt@suse.de>
200 Stanislav Visnovsky <visnov@suse.cz>
201 Ladislav Slezak <lslezak@suse.cz>
209 export CFLAGS="$RPM_OPT_FLAGS"
210 export CXXFLAGS="$RPM_OPT_FLAGS"
211 unset TRANSLATION_SET
212 # SLE11-* might want its own translation set:
213 %if 0%{?suse_version} == 1110
214 if [ -f ../po/sle-zypp-po.tar.bz ]; then
215 export TRANSLATION_SET=sle-zypp
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} \
225 make %{?_smp_mflags} VERBOSE=1
226 make -C doc/autodoc %{?_smp_mflags}
227 make -C po %{?_smp_mflags} translations
229 %if 0%{?run_testsuite}
230 make -C tests %{?_smp_mflags}
232 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
239 rm -rf "$RPM_BUILD_ROOT"
241 make install DESTDIR=$RPM_BUILD_ROOT
242 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
243 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
244 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
246 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
248 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
249 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
250 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
251 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
252 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
253 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
254 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
255 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
256 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
257 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
259 make -C po install DESTDIR=$RPM_BUILD_ROOT
260 # Create filelist with translations
266 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
268 # convert old lock file to new
269 # TODO make this a separate file?
270 # TODO run the sript only when updating form pre-11.0 libzypp versions
271 LOCKSFILE=%{_sysconfdir}/zypp/locks
272 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
275 # if no such file, exit with false (1 in bash)
276 test -f ${LOCKSFILE} || return 1
278 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
279 if [ -s ${TEMP_FILE} ]
319 if is_old ${LOCKSFILE}
321 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
322 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
324 append_new_lock $line
328 %postun -p /sbin/ldconfig
331 rm -rf "$RPM_BUILD_ROOT"
334 %defattr(-,root,root)
335 %dir %{_sysconfdir}/zypp
336 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
337 %{_sysconfdir}/zypp/repos.d
339 %dir %{_sysconfdir}/zypp/repos.d
341 %dir %{_sysconfdir}/zypp/services.d
342 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
343 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
344 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
345 %dir %{_var}/lib/zypp
346 %dir %{_var}/log/zypp
347 %dir %{_var}/cache/zypp
351 %{_libdir}/libzypp*so.*
352 %doc %{_mandir}/man5/locks.5.*
355 %defattr(-,root,root)
356 %{_libdir}/libzypp.so
359 %{_datadir}/cmake/Modules/*
360 %{_libdir}/pkgconfig/libzypp.pc