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
28 BuildRequires: openssl-devel
29 BuildRequires: libudev-devel
30 BuildRequires: boost-devel
31 BuildRequires: dejagnu
32 BuildRequires: doxygen
33 BuildRequires: gcc-c++
34 BuildRequires: gettext-devel
35 BuildRequires: graphviz
36 BuildRequires: libxml2-devel
37 BuildRequires: libproxy-devel
39 BuildRequires: libsatsolver-devel >= 0.14.17
40 %if 0%{?suse_version} >= 1100
41 %requires_eq satsolver-tools
43 Requires: satsolver-tools
46 # required for testsuite, webrick
50 BuildRequires: libexpat-devel
52 BuildRequires: expat-devel
56 BuildRequires: rpm-devel
57 Requires: /usr/bin/uuidgen
60 %if 0%{?fedora_version}
61 BuildRequires: glib2-devel
62 BuildRequires: popt-devel
63 BuildRequires: rpm-devel
66 %if 0%{?mandriva_version}
67 BuildRequires: glib2-devel
68 BuildRequires: librpm-devel
79 %define min_aria_version 1.1.2
80 # ---------------------------------------------------------------
81 %if 0%{?suse_version} >= 1110
82 # (almost) common codebase, but on SLES11-SP1 (according to Rudi
83 # suse_version == 1110) we have a patched libcurl-7.19.0-11.22,
84 # and no aria2. Furthermore SLE may use it's own set of .po files
85 # from po/sle-zypp-po.tar.bz2.
87 # this check should use 7.19.0 if SLE and 7.19.4 if not (backported
88 # CURLOPT_REDIR_PROTOCOLS)
89 %define min_curl_version 7.19.0-11.22
90 #%define min_curl_version 7.19.4
91 %define use_translation_set sle-zypp
92 # No requirement, but as we'd use it in case it is present,
93 # check for a sufficient version:
94 Conflicts: aria2 < %{min_aria_version}
96 # Code10 still has this define
98 %define use_translation_set sle-zypp
102 # ---------------------------------------------------------------
104 %if 0%{?suse_version}
105 %if 0%{?suse_version} != 1010
107 BuildRequires: libcurl-devel >= %{min_curl_version}
108 Requires: libcurl4 >= %{min_curl_version}
111 BuildRequires: curl-devel
114 # Other distros (Fedora)
115 BuildRequires: libcurl-devel >= %{min_curl_version}
116 Requires: libcurl >= %{min_curl_version}
120 Package, Patch, Pattern, and Product Management
124 Michael Andres <ma@suse.de>
125 Jiri Srain <jsrain@suse.cz>
126 Stefan Schubert <schubi@suse.de>
127 Duncan Mac-Vicar <dmacvicar@suse.de>
128 Klaus Kaempf <kkaempf@suse.de>
129 Marius Tomaschewski <mt@suse.de>
130 Stanislav Visnovsky <visnov@suse.cz>
131 Ladislav Slezak <lslezak@suse.cz>
134 Requires: libzypp = %{version}
135 Requires: libxml2-devel
136 Requires: openssl-devel
138 Requires: glibc-devel
142 Requires: boost-devel
143 Requires: libstdc++-devel
144 Requires: libudev-devel
146 Requires: libcurl-devel >= %{min_curl_version}
147 %if 0%{?suse_version} >= 1100
148 %requires_ge libsatsolver-devel
150 Requires: libsatsolver-devel
152 Summary: Package, Patch, Pattern, and Product Management - developers files
153 Group: System/Packages
154 Provides: yast2-packagemanager-devel
155 Obsoletes: yast2-packagemanager-devel
157 %description -n libzypp-devel
158 Package, Patch, Pattern, and Product Management - developers files
162 Michael Andres <ma@suse.de>
163 Jiri Srain <jsrain@suse.cz>
164 Stefan Schubert <schubi@suse.de>
165 Duncan Mac-Vicar <dmacvicar@suse.de>
166 Klaus Kaempf <kkaempf@suse.de>
167 Marius Tomaschewski <mt@suse.de>
168 Stanislav Visnovsky <visnov@suse.cz>
169 Ladislav Slezak <lslezak@suse.cz>
177 export CFLAGS="$RPM_OPT_FLAGS"
178 export CXXFLAGS="$RPM_OPT_FLAGS"
179 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
180 -DDOC_INSTALL_DIR=%{_docdir} \
182 -DCMAKE_BUILD_TYPE=Release \
183 -DCMAKE_SKIP_RPATH=1 \
184 %{?use_translation_set:-DUSE_TRANSLATION_SET=%use_translation_set} \
186 make %{?_smp_mflags} VERBOSE=1
187 make -C doc/autodoc %{?_smp_mflags}
188 make -C po %{?_smp_mflags} translations
190 %if 0%{?run_testsuite}
191 make -C tests %{?_smp_mflags}
193 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
200 rm -rf "$RPM_BUILD_ROOT"
202 make install DESTDIR=$RPM_BUILD_ROOT
203 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
204 %if 0%{?fedora_version}
205 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
207 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
209 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
210 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
211 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
212 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
213 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
214 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
215 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
216 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
217 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
218 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
220 make -C po install DESTDIR=$RPM_BUILD_ROOT
221 # Create filelist with translations
228 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
230 # convert old lock file to new
231 # TODO make this a separate file?
232 # TODO run the sript only when updating form pre-11.0 libzypp versions
233 LOCKSFILE=%{_sysconfdir}/zypp/locks
234 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
237 # if no such file, exit with false (1 in bash)
238 test -f ${LOCKSFILE} || return 1
240 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
241 if [ -s ${TEMP_FILE} ]
281 if is_old ${LOCKSFILE}
283 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
284 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
286 append_new_lock $line
291 %postun -p /sbin/ldconfig
294 rm -rf "$RPM_BUILD_ROOT"
297 %defattr(-,root,root)
298 %dir %{_sysconfdir}/zypp
299 %if 0%{?fedora_version}
300 %{_sysconfdir}/zypp/repos.d
302 %dir %{_sysconfdir}/zypp/repos.d
304 %dir %{_sysconfdir}/zypp/services.d
305 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
306 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
307 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
308 %dir %{_var}/lib/zypp
309 %dir %{_var}/log/zypp
310 %dir %{_var}/cache/zypp
314 %{_libdir}/libzypp*so.*
315 %doc %{_mandir}/man5/locks.5.*
318 %defattr(-,root,root)
319 %{_libdir}/libzypp.so
322 %{_datadir}/cmake/Modules/*
323 %{_libdir}/pkgconfig/libzypp.pc