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 Source8: %{name}-debuginfo.conf
37 Patch0: %{name}-vserver-packages.patch
38 Patch1: %{name}-config.patch
39 Patch2: %{name}-abort-on-upgrade.patch
40 Patch3: %{name}-inline.patch
41 Patch4: %{name}-ls-llu.patch
42 Patch5: %{name}-op-ldalldesc.patch
43 Patch6: %{name}-nocolor-upgrade.patch
44 Patch7: %{name}-upgrade-dist.patch
45 Patch8: %{name}-keep-reinstalled-provides.patch
46 Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
47 Patch10: %{name}-crash-on-invalid-locale.patch
48 Patch11: %{name}-noutf8.patch
49 Patch12: %{name}-dont-suggests-required-packages.patch
50 Patch13: %{name}-tty-for-erasures.patch
51 Patch14: %{name}-both_langs.patch
52 Patch15: %{name}-317130.patch
53 Patch16: %{name}-321546.patch
54 Patch17: %{name}-size-type.patch
55 Patch18: %{name}-no-inlines.patch
56 Patch19: %{name}-export-missing-symbol.patch
57 Patch20: %{name}-skip-suggests-on-upgrade.patch
58 Patch21: %{name}-po.patch
59 Patch22: %{name}-refcnt.patch
60 Patch23: %{name}-assertion-failed.patch
61 URL: http://poldek.pld-linux.org/
62 BuildRequires: autoconf
63 BuildRequires: automake
64 BuildRequires: bzip2-devel
66 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
67 BuildRequires: gettext-autopoint
68 BuildRequires: libtool
69 BuildRequires: libxml2-devel
70 BuildRequires: openssl-devel >= 0.9.7d
71 BuildRequires: pcre-devel
72 BuildRequires: perl-tools-pod
73 BuildRequires: pkgconfig
74 BuildRequires: popt-devel
75 %{?with_python:BuildRequires: python-devel}
76 BuildRequires: readline-devel >= 5.0
77 BuildRequires: rpm-devel >= %{ver_rpm}
78 %{?with_python:BuildRequires: rpm-pythonprov}
80 BuildRequires: zlib-devel
82 BuildRequires: bzip2-static
83 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
84 BuildRequires: glibc-static
85 BuildRequires: libselinux-static
86 BuildRequires: libxml2-static
87 BuildRequires: ncurses-static
88 BuildRequires: openssl-static
89 BuildRequires: pcre-static
90 BuildRequires: popt-static
91 BuildRequires: readline-static
92 BuildRequires: rpm-static
93 BuildRequires: zlib-static
95 Requires(triggerpostun): awk
96 Requires(triggerpostun): sed >= 4.0
97 Requires: %{name}-libs = %{version}-%{release}
98 Requires: db >= %{ver_db}-%{ver_db_rel}
99 Requires: rpm >= %{ver_rpm}
100 Requires: rpm-db-ver = %{ver_db}
101 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
102 # vf* scripts use sed
104 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107 poldek is an RPM package management tool which allows you to easily
108 perform package verification, installation (including system
109 installation from scratch), upgrading, and removal.
111 Program can be used in batch (like apt-get from Debian's APT) or
112 interactive mode. The interactive mode puts you into a readline
113 interface with command line autocompletion and history, similar to the
114 shell mode of Perl's CPAN.
116 %{?with_static:This version is statically linked.}
118 %{!?with_imode:This version hasn't got interactive mode.}
121 %description -l pl.UTF-8
122 poldek jest narzędziem linii poleceń służącym do weryfikacji,
123 instalacji (włączając instalację systemu od zera), aktualizacji i
126 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
127 interaktywnym. Tryb interaktywny posiada interfejs readline z
128 dopełnianiem komend i historią, podobny do trybu shell perlowego
131 %{?with_static:Ta wersja jest konsolidowana statycznie.}
133 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
136 Summary: poldek libraries
137 Summary(pl.UTF-8): Biblioteki poldka
143 %description libs -l pl.UTF-8
147 Summary: Header files for poldek libraries
148 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
149 Group: Development/Libraries
150 Requires: %{name}-libs = %{version}-%{release}
151 Requires: rpm-devel >= %{ver_rpm}
154 Header files for poldek libraries.
156 %description devel -l pl.UTF-8
157 Pliki nagłówkowe bibliotek poldka.
160 Summary: poldek static libraries
161 Summary(pl.UTF-8): Biblioteki statyczne poldka
162 Group: Development/Libraries
163 Requires: %{name}-devel = %{version}-%{release}
166 poldek static libraries.
168 %description static -l pl.UTF-8
169 Biblioteki statyczne poldka.
171 %package -n python-poldek
172 Summary: Python modules for poldek
173 Summary(pl.UTF-8): Moduły języka Python dla poldka
174 Group: Libraries/Python
175 Requires: %{name}-libs = %{version}-%{release}
176 %pyrequires_eq python-libs
178 %description -n python-poldek
179 Python modules for poldek.
181 %description -n python-poldek -l pl.UTF-8
182 Moduły języka Python dla poldka.
185 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
211 # cleanup backups after patching
212 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
219 cp -f config.sub trurlib
221 CPPFLAGS="-std=gnu99"
223 %{?with_static:--enable-static --disable-shared} \
224 %{!?with_imode:--disable-imode} \
226 %{?with_python:--with-python}
230 rm -rf $RPM_BUILD_ROOT
231 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
234 DESTDIR=$RPM_BUILD_ROOT
237 %{__make} -C python install \
238 DESTDIR=$RPM_BUILD_ROOT \
242 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
244 %ifarch i486 i686 ppc sparc alpha athlon
245 %define _ftp_arch %{_target_cpu}
248 %define _ftp_arch x86_64
249 %define _ftp_alt_arch i686
252 %if "%{pld_release}" == "ti"
253 %define _ftp_arch i586
255 %define _ftp_arch i486
258 %ifarch pentium2 pentium3 pentium4
259 %define _ftp_arch i686
261 %ifarch sparcv9 sparc64
262 %define _ftp_arch sparc
265 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
267 %if "%{pld_release}" == "ti"
269 s|%%ARCH%%|%{_ftp_arch}|g
270 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
274 s|%%ARCH%%|%{_ftp_alt_arch}|g
275 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
280 s|%%ARCH%%|%{_ftp_arch}|g
281 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
283 s|%%ARCH%%|%{_ftp_arch}|g
284 ' < %{SOURCE8} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
288 s|%%ARCH%%|%{_ftp_alt_arch}|g
289 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
293 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
296 # add desktop file and icon
297 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
298 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
299 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
302 # sources we don't package
303 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
304 # include them in %doc
307 rm -f configs/Makefile*
311 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
317 rm -rf $RPM_BUILD_ROOT
319 %post -p /sbin/postshell
320 -/usr/sbin/fix-info-dir -c %{_infodir}
322 %postun -p /sbin/postshell
323 -/usr/sbin/fix-info-dir -c %{_infodir}
325 %post libs -p /sbin/ldconfig
326 %postun libs -p /sbin/ldconfig
328 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
329 if [ -f /etc/poldek.conf.rpmsave ]; then
338 if (sub(",noauto", "", name)) {
343 if (match(name, /,pri=[0-9]+/)) {
344 pri = substr(name, RSTART + 5, RLENGTH - 5);
345 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
348 # skip ac sources. already in new config.
349 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
352 print "name = " name;
353 print "type = " type;
354 print "path = " path;
355 print "auto = " auto;
356 print "autoup = " autoup;
362 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
363 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
366 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
368 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
372 %triggerpostun -- poldek < 0.30-0.20080225.00.1
373 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
374 %{__sed} -i -e '/^%%include source.conf/{
376 a# /etc/poldek/repos.d/*.conf
377 a%%includedir repos.d
378 }' %{_sysconfdir}/%{name}/poldek.conf
381 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
382 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
384 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
385 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
386 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
390 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
391 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
392 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
396 %files -f %{name}.lang
397 %defattr(644,root,root,755)
398 %doc README* NEWS TODO configs
399 %dir %{_sysconfdir}/%{name}
400 %dir %{_sysconfdir}/%{name}/repos.d
401 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
402 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
403 %attr(755,root,root) %{_bindir}/*
404 %dir %{_libdir}/%{name}
405 %attr(755,root,root) %{_libdir}/%{name}/*
406 %{_mandir}/man1/%{name}*
407 %lang(pl) %{_mandir}/pl/man1/%{name}*
408 %{_infodir}/poldek.info*
410 %{_desktopdir}/%{name}.desktop
411 %{_pixmapsdir}/%{name}.png
414 %if %{without static}
416 %defattr(644,root,root,755)
417 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
418 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
419 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
420 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
421 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
422 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
423 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
424 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
425 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
426 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
430 %defattr(644,root,root,755)
431 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
436 %defattr(644,root,root,755)
440 %files -n python-poldek
441 %defattr(644,root,root,755)
442 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
443 %{py_sitescriptdir}/poldek.py[co]
444 %{py_sitescriptdir}/poldekmod.py[co]