3 %bcond_with static # don't use shared libraries
4 %bcond_without imode # don't build interactive mode
5 %bcond_without python # don't build python bindings
7 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8 %if "%{pld_release}" == "ti"
17 %define snap 20080820.23
19 Summary: RPM packages management helper tool
20 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
23 Release: 0.%{snap}.%{rel}
25 Group: Applications/System
26 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
27 Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
28 # Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
30 Source2: %{name}-multilib.conf
31 Source3: %{name}-ti.conf
32 Source4: %{name}-multilib-ti.conf
33 Source5: %{name}-aliases.conf
34 Source6: %{name}.desktop
36 Patch0: %{name}-vserver-packages.patch
37 Patch1: %{name}-config.patch
38 Patch2: %{name}-abort-on-upgrade.patch
39 Patch3: %{name}-inline.patch
40 Patch4: %{name}-ls-llu.patch
41 Patch5: %{name}-op-ldalldesc.patch
42 Patch6: %{name}-nocolor-upgrade.patch
43 Patch7: %{name}-upgrade-dist.patch
44 Patch8: %{name}-keep-reinstalled-provides.patch
45 Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
46 Patch10: %{name}-crash-on-invalid-locale.patch
47 Patch11: %{name}-noutf8.patch
48 Patch12: %{name}-dont-suggests-required-packages.patch
49 Patch13: %{name}-tty-for-erasures.patch
50 Patch14: %{name}-both_langs.patch
51 Patch15: %{name}-317130.patch
52 Patch16: %{name}-321546.patch
53 Patch17: %{name}-size-type.patch
54 Patch18: %{name}-no-inlines.patch
55 Patch19: %{name}-export-missing-symbol.patch
56 Patch20: %{name}-skip-suggests-on-upgrade.patch
57 Patch21: %{name}-po.patch
58 Patch22: %{name}-refcnt.patch
59 Patch23: %{name}-assertion-failed.patch
60 URL: http://poldek.pld-linux.org/
61 BuildRequires: autoconf
62 BuildRequires: automake
63 BuildRequires: bzip2-devel
65 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
66 BuildRequires: gettext-autopoint
67 BuildRequires: libtool
68 BuildRequires: libxml2-devel
69 BuildRequires: openssl-devel >= 0.9.7d
70 BuildRequires: pcre-devel
71 BuildRequires: perl-tools-pod
72 BuildRequires: pkgconfig
73 BuildRequires: popt-devel
74 %{?with_python:BuildRequires: python-devel}
75 BuildRequires: readline-devel >= 5.0
76 BuildRequires: rpm-devel >= %{ver_rpm}
77 %{?with_python:BuildRequires: rpm-pythonprov}
79 BuildRequires: zlib-devel
81 BuildRequires: bzip2-static
82 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
83 BuildRequires: glibc-static
84 BuildRequires: libselinux-static
85 BuildRequires: libxml2-static
86 BuildRequires: ncurses-static
87 BuildRequires: openssl-static
88 BuildRequires: pcre-static
89 BuildRequires: popt-static
90 BuildRequires: readline-static
91 BuildRequires: rpm-static
92 BuildRequires: zlib-static
94 Requires(triggerpostun): awk
95 Requires(triggerpostun): sed >= 4.0
96 Requires: %{name}-libs = %{version}-%{release}
97 Requires: db >= %{ver_db}-%{ver_db_rel}
98 Requires: rpm >= %{ver_rpm}
99 Requires: rpm-db-ver = %{ver_db}
100 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
101 # vf* scripts use sed
103 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
106 poldek is an RPM package management tool which allows you to easily
107 perform package verification, installation (including system
108 installation from scratch), upgrading, and removal.
110 Program can be used in batch (like apt-get from Debian's APT) or
111 interactive mode. The interactive mode puts you into a readline
112 interface with command line autocompletion and history, similar to the
113 shell mode of Perl's CPAN.
115 %{?with_static:This version is statically linked.}
117 %{!?with_imode:This version hasn't got interactive mode.}
120 %description -l pl.UTF-8
121 poldek jest narzędziem linii poleceń służącym do weryfikacji,
122 instalacji (włączając instalację systemu od zera), aktualizacji i
125 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
126 interaktywnym. Tryb interaktywny posiada interfejs readline z
127 dopełnianiem komend i historią, podobny do trybu shell perlowego
130 %{?with_static:Ta wersja jest konsolidowana statycznie.}
132 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
135 Summary: poldek libraries
136 Summary(pl.UTF-8): Biblioteki poldka
142 %description libs -l pl.UTF-8
146 Summary: Header files for poldek libraries
147 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
148 Group: Development/Libraries
149 Requires: %{name}-libs = %{version}-%{release}
152 Header files for poldek libraries.
154 %description devel -l pl.UTF-8
155 Pliki nagłówkowe bibliotek poldka.
158 Summary: poldek static libraries
159 Summary(pl.UTF-8): Biblioteki statyczne poldka
160 Group: Development/Libraries
161 Requires: %{name}-devel = %{version}-%{release}
164 poldek static libraries.
166 %description static -l pl.UTF-8
167 Biblioteki statyczne poldka.
169 %package -n python-poldek
170 Summary: Python modules for poldek
171 Summary(pl.UTF-8): Moduły języka Python dla poldka
172 Group: Libraries/Python
173 Requires: %{name}-libs = %{version}-%{release}
174 %pyrequires_eq python-libs
176 %description -n python-poldek
177 Python modules for poldek.
179 %description -n python-poldek -l pl.UTF-8
180 Moduły języka Python dla poldka.
183 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
209 # cleanup backups after patching
210 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
217 cp -f config.sub trurlib
219 CPPFLAGS="-std=gnu99"
221 %{?with_static:--enable-static --disable-shared} \
222 %{!?with_imode:--disable-imode} \
224 %{?with_python:--with-python}
228 rm -rf $RPM_BUILD_ROOT
229 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
232 DESTDIR=$RPM_BUILD_ROOT
235 %{__make} -C python install \
236 DESTDIR=$RPM_BUILD_ROOT \
240 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
242 %ifarch i486 i686 ppc sparc alpha athlon
243 %define _ftp_arch %{_target_cpu}
246 %define _ftp_arch x86_64
247 %define _ftp_alt_arch i686
250 %if "%{pld_release}" == "ti"
251 %define _ftp_arch i586
253 %define _ftp_arch i486
256 %ifarch pentium2 pentium3 pentium4
257 %define _ftp_arch i686
259 %ifarch sparcv9 sparc64
260 %define _ftp_arch sparc
263 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
265 %if "%{pld_release}" == "ti"
267 s|%%ARCH%%|%{_ftp_arch}|g
268 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
272 s|%%ARCH%%|%{_ftp_alt_arch}|g
273 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
277 s|%%ARCH%%|%{_ftp_arch}|g
278 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
282 s|%%ARCH%%|%{_ftp_alt_arch}|g
283 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
287 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
290 # add desktop file and icon
291 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
292 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
293 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
296 # sources we don't package
297 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
298 # include them in %doc
301 rm -f configs/Makefile*
305 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
311 rm -rf $RPM_BUILD_ROOT
313 %post -p /sbin/postshell
314 -/usr/sbin/fix-info-dir -c %{_infodir}
316 %postun -p /sbin/postshell
317 -/usr/sbin/fix-info-dir -c %{_infodir}
319 %post libs -p /sbin/ldconfig
320 %postun libs -p /sbin/ldconfig
322 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
323 if [ -f /etc/poldek.conf.rpmsave ]; then
332 if (sub(",noauto", "", name)) {
337 if (match(name, /,pri=[0-9]+/)) {
338 pri = substr(name, RSTART + 5, RLENGTH - 5);
339 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
342 # skip ac sources. already in new config.
343 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
346 print "name = " name;
347 print "type = " type;
348 print "path = " path;
349 print "auto = " auto;
350 print "autoup = " autoup;
356 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
357 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
360 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
362 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
366 %triggerpostun -- poldek < 0.30-0.20080225.00.1
367 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
368 %{__sed} -i -e '/^%%include source.conf/{
370 a# /etc/poldek/repos.d/*.conf
371 a%%includedir repos.d
372 }' %{_sysconfdir}/%{name}/poldek.conf
375 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
376 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
378 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
379 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
380 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
384 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
385 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
386 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
390 %files -f %{name}.lang
391 %defattr(644,root,root,755)
392 %doc README* NEWS TODO configs
393 %dir %{_sysconfdir}/%{name}
394 %dir %{_sysconfdir}/%{name}/repos.d
395 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
397 %attr(755,root,root) %{_bindir}/*
398 %dir %{_libdir}/%{name}
399 %attr(755,root,root) %{_libdir}/%{name}/*
400 %{_mandir}/man1/%{name}*
401 %lang(pl) %{_mandir}/pl/man1/%{name}*
402 %{_infodir}/poldek.info*
404 %{_desktopdir}/%{name}.desktop
405 %{_pixmapsdir}/%{name}.png
408 %if %{without static}
410 %defattr(644,root,root,755)
411 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
412 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
413 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
414 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
416 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
417 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
418 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
419 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
420 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
424 %defattr(644,root,root,755)
425 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
430 %defattr(644,root,root,755)
434 %files -n python-poldek
435 %defattr(644,root,root,755)
436 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
437 %{py_sitescriptdir}/poldek.py[co]
438 %{py_sitescriptdir}/poldekmod.py[co]