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 URL: http://poldek.pld-linux.org/
56 BuildRequires: autoconf
57 BuildRequires: automake
58 BuildRequires: bzip2-devel
60 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
61 BuildRequires: gettext-autopoint
62 BuildRequires: libtool
63 BuildRequires: libxml2-devel
64 BuildRequires: openssl-devel >= 0.9.7d
65 BuildRequires: pcre-devel
66 BuildRequires: perl-tools-pod
67 BuildRequires: pkgconfig
68 BuildRequires: popt-devel
69 %{?with_python:BuildRequires: python-devel}
70 BuildRequires: readline-devel >= 5.0
71 BuildRequires: rpm-devel >= %{ver_rpm}
72 %{?with_python:BuildRequires: rpm-pythonprov}
74 BuildRequires: zlib-devel
76 BuildRequires: bzip2-static
77 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
78 BuildRequires: glibc-static
79 BuildRequires: libselinux-static
80 BuildRequires: libxml2-static
81 BuildRequires: ncurses-static
82 BuildRequires: openssl-static
83 BuildRequires: pcre-static
84 BuildRequires: popt-static
85 BuildRequires: readline-static
86 BuildRequires: rpm-static
87 BuildRequires: zlib-static
89 Requires(triggerpostun): awk
90 Requires(triggerpostun): sed >= 4.0
91 Requires: %{name}-libs = %{version}-%{release}
92 Requires: db >= %{ver_db}-%{ver_db_rel}
93 Requires: rpm >= %{ver_rpm}
94 Requires: rpm-db-ver = %{ver_db}
95 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
101 poldek is an RPM package management tool which allows you to easily
102 perform package verification, installation (including system
103 installation from scratch), upgrading, and removal.
105 Program can be used in batch (like apt-get from Debian's APT) or
106 interactive mode. The interactive mode puts you into a readline
107 interface with command line autocompletion and history, similar to the
108 shell mode of Perl's CPAN.
110 %{?with_static:This version is statically linked.}
112 %{!?with_imode:This version hasn't got interactive mode.}
115 %description -l pl.UTF-8
116 poldek jest narzędziem linii poleceń służącym do weryfikacji,
117 instalacji (włączając instalację systemu od zera), aktualizacji i
120 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
121 interaktywnym. Tryb interaktywny posiada interfejs readline z
122 dopełnianiem komend i historią, podobny do trybu shell perlowego
125 %{?with_static:Ta wersja jest konsolidowana statycznie.}
127 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
130 Summary: poldek libraries
131 Summary(pl.UTF-8): Biblioteki poldka
137 %description libs -l pl.UTF-8
141 Summary: Header files for poldek libraries
142 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
143 Group: Development/Libraries
144 Requires: %{name}-libs = %{version}-%{release}
147 Header files for poldek libraries.
149 %description devel -l pl.UTF-8
150 Pliki nagłówkowe bibliotek poldka.
153 Summary: poldek static libraries
154 Summary(pl.UTF-8): Biblioteki statyczne poldka
155 Group: Development/Libraries
156 Requires: %{name}-devel = %{version}-%{release}
159 poldek static libraries.
161 %description static -l pl.UTF-8
162 Biblioteki statyczne poldka.
164 %package -n python-poldek
165 Summary: Python modules for poldek
166 Summary(pl.UTF-8): Moduły języka Python dla poldka
167 Group: Libraries/Python
168 Requires: %{name}-libs = %{version}-%{release}
169 %pyrequires_eq python-libs
171 %description -n python-poldek
172 Python modules for poldek.
174 %description -n python-poldek -l pl.UTF-8
175 Moduły języka Python dla poldka.
178 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
199 # cleanup backups after patching
200 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
207 cp -f config.sub trurlib
209 CPPFLAGS="-std=gnu99"
211 %{?with_static:--enable-static --disable-shared} \
212 %{!?with_imode:--disable-imode} \
214 %{?with_python:--with-python}
218 rm -rf $RPM_BUILD_ROOT
219 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
222 DESTDIR=$RPM_BUILD_ROOT
225 %{__make} -C python install \
226 DESTDIR=$RPM_BUILD_ROOT \
230 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
232 %ifarch i486 i686 ppc sparc alpha athlon
233 %define _ftp_arch %{_target_cpu}
236 %define _ftp_arch x86_64
237 %define _ftp_alt_arch i686
240 %if "%{pld_release}" == "ti"
241 %define _ftp_arch i586
243 %define _ftp_arch i486
246 %ifarch pentium2 pentium3 pentium4
247 %define _ftp_arch i686
249 %ifarch sparcv9 sparc64
250 %define _ftp_arch sparc
253 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
255 %if "%{pld_release}" == "ti"
257 s|%%ARCH%%|%{_ftp_arch}|g
258 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
262 s|%%ARCH%%|%{_ftp_alt_arch}|g
263 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
267 s|%%ARCH%%|%{_ftp_arch}|g
268 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
272 s|%%ARCH%%|%{_ftp_alt_arch}|g
273 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
277 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
280 # add desktop file and icon
281 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
282 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
283 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
286 # sources we don't package
287 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
288 # include them in %doc
291 rm -f configs/Makefile*
295 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
301 rm -rf $RPM_BUILD_ROOT
303 %post -p /sbin/postshell
304 -/usr/sbin/fix-info-dir -c %{_infodir}
306 %postun -p /sbin/postshell
307 -/usr/sbin/fix-info-dir -c %{_infodir}
309 %post libs -p /sbin/ldconfig
310 %postun libs -p /sbin/ldconfig
312 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
313 if [ -f /etc/poldek.conf.rpmsave ]; then
322 if (sub(",noauto", "", name)) {
327 if (match(name, /,pri=[0-9]+/)) {
328 pri = substr(name, RSTART + 5, RLENGTH - 5);
329 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
332 # skip ac sources. already in new config.
333 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
336 print "name = " name;
337 print "type = " type;
338 print "path = " path;
339 print "auto = " auto;
340 print "autoup = " autoup;
346 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
347 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
350 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
352 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
356 %triggerpostun -- poldek < 0.30-0.20080225.00.1
357 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
358 %{__sed} -i -e '/^%%include source.conf/{
360 a# /etc/poldek/repos.d/*.conf
361 a%%includedir repos.d
362 }' %{_sysconfdir}/%{name}/poldek.conf
365 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
366 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
368 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
369 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
370 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
374 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
375 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
376 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
380 %files -f %{name}.lang
381 %defattr(644,root,root,755)
382 %doc README* NEWS TODO configs
383 %dir %{_sysconfdir}/%{name}
384 %dir %{_sysconfdir}/%{name}/repos.d
385 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
386 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
387 %attr(755,root,root) %{_bindir}/*
388 %dir %{_libdir}/%{name}
389 %attr(755,root,root) %{_libdir}/%{name}/*
390 %{_mandir}/man1/%{name}*
391 %lang(pl) %{_mandir}/pl/man1/%{name}*
392 %{_infodir}/poldek.info*
394 %{_desktopdir}/%{name}.desktop
395 %{_pixmapsdir}/%{name}.png
398 %if %{without static}
400 %defattr(644,root,root,755)
401 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
402 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
403 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
404 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
405 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
406 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
407 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
408 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
409 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
410 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
414 %defattr(644,root,root,755)
415 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
420 %defattr(644,root,root,755)
424 %files -n python-poldek
425 %defattr(644,root,root,755)
426 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
427 %{py_sitescriptdir}/poldek.py[co]
428 %{py_sitescriptdir}/poldekmod.py[co]