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
25 Url: git://gitorious.org/opensuse/libzypp.git
26 Summary: Package, Patch, Pattern, and Product Management
27 Group: System/Packages
28 BuildRoot: %{_tmppath}/%{name}-%{version}-build
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:appdata) = 0
37 Provides: libzypp(plugin:commit) = 1
38 Provides: libzypp(plugin:services) = 0
39 Provides: libzypp(plugin:system) = 0
40 Provides: libzypp(plugin:urlresolver) = 0
41 Provides: libzypp(repovarexpand) = 0
45 # lsof is used for 'zypper ps':
49 BuildRequires: openssl-devel
50 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
51 BuildRequires: libudev-devel
53 BuildRequires: hal-devel
55 BuildRequires: boost-devel
56 BuildRequires: dejagnu
57 BuildRequires: doxygen
60 BuildRequires: gcc46-c++
62 BuildRequires: gcc-c++ >= 4.6
64 BuildRequires: gettext-devel
65 BuildRequires: graphviz
66 BuildRequires: graphviz-gnome
67 BuildRequires: libxml2-devel
68 %if 0%{?suse_version} != 1110
70 BuildRequires: libproxy-devel
73 %if 0%{?fedora_version} || 0%{?rhel_version} || 0%{?centos_version}
74 BuildRequires: pkgconfig
76 BuildRequires: pkg-config
79 BuildRequires: libsolv-devel >= 0.6.7
80 %if 0%{?suse_version} >= 1100
81 BuildRequires: libsolv-tools
82 %requires_eq libsolv-tools
84 Requires: libsolv-tools
87 # required for testsuite, webrick
91 BuildRequires: libexpat-devel
93 BuildRequires: expat-devel
99 BuildRequires: rpm-devel
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
113 %if 0%{?suse_version}
119 %define min_curl_version 7.19.4
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
139 Summary: Package, Patch, Pattern, and Product Management - developers files
140 Group: Development/Libraries/C and C++
141 Provides: yast2-packagemanager-devel
142 Obsoletes: yast2-packagemanager-devel
143 Requires: boost-devel
145 Requires: glibc-devel
146 Requires: libstdc++-devel
147 Requires: libxml2-devel
148 Requires: libzypp = %{version}
149 Requires: openssl-devel
153 %if 0%{?suse_version} >= 1130 || 0%{?fedora_version} >= 16
154 Requires: libudev-devel
159 %if 0%{?suse_version}
160 %if 0%{?suse_version} >= 1100
162 Requires: libcurl-devel >= %{min_curl_version}
168 # Other distros (Fedora)
169 Requires: libcurl-devel >= %{min_curl_version}
171 %if 0%{?suse_version} >= 1100
172 %requires_ge libsolv-devel
174 Requires: libsolv-devel
178 Package, Patch, Pattern, and Product Management - developers files
181 Summary: Package, Patch, Pattern, and Product Management - developers files
182 Group: Documentation/HTML
184 %description devel-doc
185 Package, Patch, Pattern, and Product Management - developers files
193 %if 0%{?force_gcc_46}
197 export CFLAGS="$RPM_OPT_FLAGS"
198 export CXXFLAGS="$RPM_OPT_FLAGS"
199 unset TRANSLATION_SET
200 unset EXTRA_CMAKE_OPTIONS
201 # Same codebase, but SLES may use it's own translation set.
205 %if 0%{?suse_version} == 1110 || 0%{?suse_version} == 1315
206 if [ -f ../po/sle-zypp-po.tar.bz2 ]; then
207 export TRANSLATION_SET=sle-zypp
210 # No libproxy on SLE11
211 %if 0%{?suse_version} == 1110
212 export EXTRA_CMAKE_OPTIONS="-DDISABLE_LIBPROXY=ON"
215 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
216 -DDOC_INSTALL_DIR=%{_docdir} \
218 -DCMAKE_BUILD_TYPE=Release \
219 -DCMAKE_SKIP_RPATH=1 \
220 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
221 ${EXTRA_CMAKE_OPTIONS} \
223 make %{?_smp_mflags} VERBOSE=1
224 make -C doc/autodoc %{?_smp_mflags}
225 make -C po %{?_smp_mflags} translations
227 %if 0%{?run_testsuite}
228 make -C tests %{?_smp_mflags}
230 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
237 rm -rf "$RPM_BUILD_ROOT"
239 make install DESTDIR=$RPM_BUILD_ROOT
240 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
241 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
242 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
244 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
246 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
247 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/systemCheck.d
248 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/vendors.d
249 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/multiversion.d
250 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
251 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
252 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/appdata
253 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
254 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
255 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
256 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
257 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
258 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
259 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
261 make -C po install DESTDIR=$RPM_BUILD_ROOT
262 # Create filelist with translations
268 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
270 # convert old lock file to new
271 # TODO make this a separate file?
272 # TODO run the sript only when updating form pre-11.0 libzypp versions
273 LOCKSFILE=%{_sysconfdir}/zypp/locks
274 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
277 # if no such file, exit with false (1 in bash)
278 test -f ${LOCKSFILE} || return 1
280 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
281 if [ -s ${TEMP_FILE} ]
321 if is_old ${LOCKSFILE}
323 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
324 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
326 append_new_lock $line
330 %postun -p /sbin/ldconfig
333 rm -rf "$RPM_BUILD_ROOT"
336 %defattr(-,root,root)
337 %dir %{_sysconfdir}/zypp
338 %if 0%{?fedora_version} || 0%{?rhel_version} >= 600 || 0%{?centos_version} >= 600
339 %{_sysconfdir}/zypp/repos.d
341 %dir %{_sysconfdir}/zypp/repos.d
343 %dir %{_sysconfdir}/zypp/services.d
344 %dir %{_sysconfdir}/zypp/systemCheck.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}/man1/*.1.*
358 %doc %{_mandir}/man5/*.5.*
361 %defattr(-,root,root)
362 %{_libdir}/libzypp.so
364 %{_datadir}/cmake/Modules/*
365 %{_libdir}/pkgconfig/libzypp.pc
368 %defattr(-,root,root)