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 %if 0%{?suse_version} >= 1130
30 BuildRequires: libudev-devel
32 BuildRequires: hal-devel
34 BuildRequires: boost-devel
35 BuildRequires: dejagnu
36 BuildRequires: doxygen
37 BuildRequires: gcc-c++
38 BuildRequires: gettext-devel
39 BuildRequires: graphviz
40 BuildRequires: libxml2-devel
41 BuildRequires: libproxy-devel
43 BuildRequires: libsatsolver-devel >= 0.14.17
44 %if 0%{?suse_version} >= 1100
45 %requires_eq satsolver-tools
47 Requires: satsolver-tools
50 # required for testsuite, webrick
54 BuildRequires: libexpat-devel
56 BuildRequires: expat-devel
60 BuildRequires: rpm-devel
61 Requires: /usr/bin/uuidgen
62 %if 0%{?suse_version} > 1020
63 BuildRequires: hicolor-icon-theme
67 %if 0%{?fedora_version}
68 BuildRequires: glib2-devel
69 BuildRequires: popt-devel
70 BuildRequires: rpm-devel
73 %if 0%{?mandriva_version}
74 BuildRequires: glib2-devel
75 BuildRequires: librpm-devel
86 %define min_aria_version 1.1.2
87 # ---------------------------------------------------------------
88 %if 0%{?suse_version} >= 1110
89 # (almost) common codebase, but on SLES11-SP1 (according to Rudi
90 # suse_version == 1110) we have a patched libcurl-7.19.0-11.22,
91 # and no aria2. Furthermore SLE may use it's own set of .po files
92 # from po/sle-zypp-po.tar.bz2.
94 # this check should use 7.19.0 if SLE and 7.19.4 if not (backported
95 # CURLOPT_REDIR_PROTOCOLS)
96 %define min_curl_version 7.19.0-11.22
99 # ---------------------------------------------------------------
101 %if 0%{?suse_version}
102 %if 0%{?suse_version} >= 1100
104 BuildRequires: libcurl-devel >= %{min_curl_version}
105 Requires: libcurl4 >= %{min_curl_version}
108 BuildRequires: curl-devel
111 # Other distros (Fedora)
112 BuildRequires: libcurl-devel >= %{min_curl_version}
113 Requires: libcurl >= %{min_curl_version}
117 Package, Patch, Pattern, and Product Management
121 Michael Andres <ma@suse.de>
122 Jiri Srain <jsrain@suse.cz>
123 Stefan Schubert <schubi@suse.de>
124 Duncan Mac-Vicar <dmacvicar@suse.de>
125 Klaus Kaempf <kkaempf@suse.de>
126 Marius Tomaschewski <mt@suse.de>
127 Stanislav Visnovsky <visnov@suse.cz>
128 Ladislav Slezak <lslezak@suse.cz>
131 Requires: libzypp = %{version}
132 Requires: libxml2-devel
133 Requires: openssl-devel
135 Requires: glibc-devel
139 Requires: boost-devel
140 Requires: libstdc++-devel
141 %if 0%{?suse_version} >= 1130
142 Requires: libudev-devel
147 %if 0%{?suse_version}
148 %if 0%{?suse_version} >= 1100
150 Requires: libcurl-devel >= %{min_curl_version}
156 # Other distros (Fedora)
157 Requires: libcurl-devel >= %{min_curl_version}
159 %if 0%{?suse_version} >= 1100
160 %requires_ge libsatsolver-devel
162 Requires: libsatsolver-devel
164 Summary: Package, Patch, Pattern, and Product Management - developers files
165 Group: System/Packages
166 Provides: yast2-packagemanager-devel
167 Obsoletes: yast2-packagemanager-devel
169 %description -n libzypp-devel
170 Package, Patch, Pattern, and Product Management - developers files
174 Michael Andres <ma@suse.de>
175 Jiri Srain <jsrain@suse.cz>
176 Stefan Schubert <schubi@suse.de>
177 Duncan Mac-Vicar <dmacvicar@suse.de>
178 Klaus Kaempf <kkaempf@suse.de>
179 Marius Tomaschewski <mt@suse.de>
180 Stanislav Visnovsky <visnov@suse.cz>
181 Ladislav Slezak <lslezak@suse.cz>
189 export CFLAGS="$RPM_OPT_FLAGS"
190 export CXXFLAGS="$RPM_OPT_FLAGS"
191 unset TRANSLATION_SET
192 # SLE11-* might want its own translation set:
193 %if 0%{?suse_version} == 1110
194 if [ -f ../po/sle-zypp-po.tar.bz ]; then
195 export TRANSLATION_SET=sle-zypp
198 cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} \
199 -DDOC_INSTALL_DIR=%{_docdir} \
201 -DCMAKE_BUILD_TYPE=Release \
202 -DCMAKE_SKIP_RPATH=1 \
203 -DUSE_TRANSLATION_SET=${TRANSLATION_SET:-zypp} \
205 make %{?_smp_mflags} VERBOSE=1
206 make -C doc/autodoc %{?_smp_mflags}
207 make -C po %{?_smp_mflags} translations
209 %if 0%{?run_testsuite}
210 make -C tests %{?_smp_mflags}
212 LD_LIBRARY_PATH=$PWD/../zypp:$LD_LIBRARY_PATH ctest .
219 rm -rf "$RPM_BUILD_ROOT"
221 make install DESTDIR=$RPM_BUILD_ROOT
222 make -C doc/autodoc install DESTDIR=$RPM_BUILD_ROOT
223 %if 0%{?fedora_version}
224 ln -s %{_sysconfdir}/yum.repos.d $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
226 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/repos.d
228 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/zypp/services.d
229 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp
230 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins
231 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/commit
232 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/services
233 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/system
234 mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/zypp/plugins/urlresolver
235 mkdir -p $RPM_BUILD_ROOT%{_var}/lib/zypp
236 mkdir -p $RPM_BUILD_ROOT%{_var}/log/zypp
237 mkdir -p $RPM_BUILD_ROOT%{_var}/cache/zypp
239 make -C po install DESTDIR=$RPM_BUILD_ROOT
240 # Create filelist with translations
247 if [ -f /var/cache/zypp/zypp.db ]; then rm /var/cache/zypp/zypp.db; fi
249 # convert old lock file to new
250 # TODO make this a separate file?
251 # TODO run the sript only when updating form pre-11.0 libzypp versions
252 LOCKSFILE=%{_sysconfdir}/zypp/locks
253 OLDLOCKSFILE=%{_sysconfdir}/zypp/locks.old
256 # if no such file, exit with false (1 in bash)
257 test -f ${LOCKSFILE} || return 1
259 cat ${LOCKSFILE} | sed '/^\#.*/ d;/.*:.*/d;/^[^[a-zA-Z\*?.0-9]*$/d' > ${TEMP_FILE}
260 if [ -s ${TEMP_FILE} ]
300 if is_old ${LOCKSFILE}
302 mv -f ${LOCKSFILE} ${OLDLOCKSFILE} || die "cannot backup old locks"
303 cat ${OLDLOCKSFILE}| sed "/^\#.*/d"| while read line
305 append_new_lock $line
310 %postun -p /sbin/ldconfig
313 rm -rf "$RPM_BUILD_ROOT"
316 %defattr(-,root,root)
317 %dir %{_sysconfdir}/zypp
318 %if 0%{?fedora_version}
319 %{_sysconfdir}/zypp/repos.d
321 %dir %{_sysconfdir}/zypp/repos.d
323 %dir %{_sysconfdir}/zypp/services.d
324 %config(noreplace) %{_sysconfdir}/zypp/zypp.conf
325 %config(noreplace) %{_sysconfdir}/zypp/systemCheck
326 %config(noreplace) %{_sysconfdir}/logrotate.d/zypp-history.lr
327 %dir %{_var}/lib/zypp
328 %dir %{_var}/log/zypp
329 %dir %{_var}/cache/zypp
333 %{_libdir}/libzypp*so.*
334 %doc %{_mandir}/man5/locks.5.*
337 %defattr(-,root,root)
338 %{_libdir}/libzypp.so
341 %{_datadir}/cmake/Modules/*
342 %{_libdir}/pkgconfig/libzypp.pc