2 # spec file for package libzypp
4 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
5 # This file and all modifications and additions to the pristine
6 # package are under the same license as the package itself.
8 # Please submit bugfixes or comments via http://bugs.opensuse.org/
15 Group: System/Packages
16 BuildRoot: %{_tmppath}/%{name}-%{version}-build
17 Summary: Package, Patch, Pattern, and Product Management
20 Source: %{name}-%{version}.tar.bz2
21 Source1: %{name}-rpmlintrc
22 Provides: yast2-packagemanager
23 Obsoletes: yast2-packagemanager
26 # lsof is used for 'zypper ps':
30 BuildRequires: openssl-devel
31 %if 0%{?suse_version} >= 1130
32 BuildRequires: libudev-devel
34 BuildRequires: hal-devel
36 BuildRequires: boost-devel
37 BuildRequires: dejagnu
38 BuildRequires: doxygen
39 BuildRequires: gcc-c++
40 BuildRequires: gettext-devel
41 BuildRequires: graphviz
42 BuildRequires: libxml2-devel
43 BuildRequires: libproxy-devel
45 BuildRequires: libsatsolver-devel >= 0.14.17
46 %if 0%{?suse_version} >= 1100
47 %requires_eq satsolver-tools
49 Requires: satsolver-tools
52 # required for testsuite, webrick
56 BuildRequires: libexpat-devel
58 BuildRequires: expat-devel
62 BuildRequires: rpm-devel
63 Requires: /usr/bin/uuidgen
64 %if 0%{?suse_version} > 1020
65 BuildRequires: hicolor-icon-theme
69 %if 0%{?fedora_version}
70 BuildRequires: glib2-devel
71 BuildRequires: popt-devel
72 BuildRequires: rpm-devel
75 %if 0%{?mandriva_version}
76 BuildRequires: glib2-devel
77 BuildRequires: librpm-devel
88 %define min_aria_version 1.1.2
89 # ---------------------------------------------------------------
90 %if 0%{?suse_version} >= 1110
91 # (almost) common codebase, but on SLES11-SP1 (according to Rudi
92 # suse_version == 1110) we have a patched libcurl-7.19.0-11.22,
93 # and no aria2. Furthermore SLE may use it's own set of .po files
94 # from po/sle-zypp-po.tar.bz2.
96 # this check should use 7.19.0 if SLE and 7.19.4 if not (backported
97 # CURLOPT_REDIR_PROTOCOLS)
98 %define min_curl_version 7.19.0-11.22
101 # ---------------------------------------------------------------
103 %if 0%{?suse_version}
104 %if 0%{?suse_version} >= 1100
106 BuildRequires: libcurl-devel >= %{min_curl_version}
107 Requires: libcurl4 >= %{min_curl_version}
110 BuildRequires: curl-devel
113 # Other distros (Fedora)
114 BuildRequires: libcurl-devel >= %{min_curl_version}
115 Requires: libcurl >= %{min_curl_version}
119 Package, Patch, Pattern, and Product Management
123 Michael Andres <ma@suse.de>
124 Jiri Srain <jsrain@suse.cz>
125 Stefan Schubert <schubi@suse.de>
126 Duncan Mac-Vicar <dmacvicar@suse.de>
127 Klaus Kaempf <kkaempf@suse.de>
128 Marius Tomaschewski <mt@suse.de>
129 Stanislav Visnovsky <visnov@suse.cz>
130 Ladislav Slezak <lslezak@suse.cz>
133 Requires: libzypp = %{version}
134 Requires: libxml2-devel
135 Requires: openssl-devel
137 Requires: glibc-devel
141 Requires: boost-devel
142 Requires: libstdc++-devel
143 %if 0%{?suse_version} >= 1130
144 Requires: libudev-devel
149 %if 0%{?suse_version}
150 %if 0%{?suse_version} >= 1100
152 Requires: libcurl-devel >= %{min_curl_version}
158 # Other distros (Fedora)
159 Requires: libcurl-devel >= %{min_curl_version}
161 %if 0%{?suse_version} >= 1100
162 %requires_ge libsatsolver-devel
164 Requires: libsatsolver-devel
166 Summary: Package, Patch, Pattern, and Product Management - developers files
167 Group: System/Packages
168 Provides: yast2-packagemanager-devel
169 Obsoletes: yast2-packagemanager-devel
171 %description -n libzypp-devel
172 Package, Patch, Pattern, and Product Management - developers files
176 Michael Andres <ma@suse.de>
177 Jiri Srain <jsrain@suse.cz>
178 Stefan Schubert <schubi@suse.de>
179 Duncan Mac-Vicar <dmacvicar@suse.de>
180 Klaus Kaempf <kkaempf@suse.de>
181 Marius Tomaschewski <mt@suse.de>
182 Stanislav Visnovsky <visnov@suse.cz>
183 Ladislav Slezak <lslezak@suse.cz>
191 export CFLAGS="$RPM_OPT_FLAGS"
192 export CXXFLAGS="$RPM_OPT_FLAGS"
193 unset TRANSLATION_SET
194 # SLE11-* might want its own translation set:
195 %if 0%{?suse_version} == 1110
196 if [ -f ../po/sle-zypp-po.tar.bz ]; then
197 export TRANSLATION_SET=sle-zypp
200 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
201 -DDOC_INSTALL_DIR=%{_docdir} \
203 -DCMAKE_BUILD_TYPE=Release \
204 -DCMAKE_SKIP_RPATH=1 \
205 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
207 make %{?_smp_mflags} VERBOSE=1
208 make -C doc/autodoc %{?_smp_mflags}
209 make -C po %{?_smp_mflags} translations
211 %if 0%{?run_testsuite}
212 make -C tests %{?_smp_mflags}
214 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
221 rm -rf "$RPM_BUILD_ROOT"
223 make install DESTDIR=$RPM_BUILD_ROOT
224 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
225 %if 0%{?fedora_version}
226 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
230 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
231 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
232 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
233 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
234 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
235 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
236 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
237 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
238 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
239 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
241 make -C po install DESTDIR=$RPM_BUILD_ROOT
242 # Create filelist with translations
249 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
251 # convert old lock file to new
252 # TODO make this a separate file?
253 # TODO run the sript only when updating form pre-11.0 libzypp versions
254 LOCKSFILE=%{_sysconfdir}/zypp/locks
255 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
258 # if no such file, exit with false (1 in bash)
259 test -f ${LOCKSFILE} || return 1
261 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
262 if [ -s ${TEMP_FILE} ]
302 if is_old ${LOCKSFILE}
304 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
305 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
307 append_new_lock $line
312 %postun -p /sbin/ldconfig
315 rm -rf "$RPM_BUILD_ROOT"
318 %defattr(-,root,root)
319 %dir %{_sysconfdir}/zypp
320 %if 0%{?fedora_version}
321 %{_sysconfdir}/zypp/repos.d
323 %dir %{_sysconfdir}/zypp/repos.d
325 %dir %{_sysconfdir}/zypp/services.d
326 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
327 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
328 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
329 %dir %{_var}/lib/zypp
330 %dir %{_var}/log/zypp
331 %dir %{_var}/cache/zypp
335 %{_libdir}/libzypp*so.*
336 %doc %{_mandir}/man5/locks.5.*
339 %defattr(-,root,root)
340 %{_libdir}/libzypp.so
343 %{_datadir}/cmake/Modules/*
344 %{_libdir}/pkgconfig/libzypp.pc