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 URL: http://poldek.pld-linux.org/
54 BuildRequires: autoconf
55 BuildRequires: automake
56 BuildRequires: bzip2-devel
58 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
59 BuildRequires: gettext-autopoint
60 BuildRequires: libtool
61 BuildRequires: libxml2-devel
62 BuildRequires: openssl-devel >= 0.9.7d
63 BuildRequires: pcre-devel
64 BuildRequires: perl-tools-pod
65 BuildRequires: pkgconfig
66 BuildRequires: popt-devel
67 %{?with_python:BuildRequires: python-devel}
68 BuildRequires: readline-devel >= 5.0
69 BuildRequires: rpm-devel >= %{ver_rpm}
70 %{?with_python:BuildRequires: rpm-pythonprov}
72 BuildRequires: zlib-devel
74 BuildRequires: bzip2-static
75 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
76 BuildRequires: glibc-static
77 BuildRequires: libselinux-static
78 BuildRequires: libxml2-static
79 BuildRequires: ncurses-static
80 BuildRequires: openssl-static
81 BuildRequires: pcre-static
82 BuildRequires: popt-static
83 BuildRequires: readline-static
84 BuildRequires: rpm-static
85 BuildRequires: zlib-static
87 Requires(triggerpostun): awk
88 Requires(triggerpostun): sed >= 4.0
89 Requires: %{name}-libs = %{version}-%{release}
90 Requires: db >= %{ver_db}-%{ver_db_rel}
91 Requires: rpm >= %{ver_rpm}
92 Requires: rpm-db-ver = %{ver_db}
93 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
96 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99 poldek is an RPM package management tool which allows you to easily
100 perform package verification, installation (including system
101 installation from scratch), upgrading, and removal.
103 Program can be used in batch (like apt-get from Debian's APT) or
104 interactive mode. The interactive mode puts you into a readline
105 interface with command line autocompletion and history, similar to the
106 shell mode of Perl's CPAN.
108 %{?with_static:This version is statically linked.}
110 %{!?with_imode:This version hasn't got interactive mode.}
113 %description -l pl.UTF-8
114 poldek jest narzędziem linii poleceń służącym do weryfikacji,
115 instalacji (włączając instalację systemu od zera), aktualizacji i
118 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
119 interaktywnym. Tryb interaktywny posiada interfejs readline z
120 dopełnianiem komend i historią, podobny do trybu shell perlowego
123 %{?with_static:Ta wersja jest konsolidowana statycznie.}
125 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
128 Summary: poldek libraries
129 Summary(pl.UTF-8): Biblioteki poldka
135 %description libs -l pl.UTF-8
139 Summary: Header files for poldek libraries
140 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
141 Group: Development/Libraries
142 Requires: %{name}-libs = %{version}-%{release}
145 Header files for poldek libraries.
147 %description devel -l pl.UTF-8
148 Pliki nagłówkowe bibliotek poldka.
151 Summary: poldek static libraries
152 Summary(pl.UTF-8): Biblioteki statyczne poldka
153 Group: Development/Libraries
154 Requires: %{name}-devel = %{version}-%{release}
157 poldek static libraries.
159 %description static -l pl.UTF-8
160 Biblioteki statyczne poldka.
162 %package -n python-poldek
163 Summary: Python modules for poldek
164 Summary(pl.UTF-8): Moduły języka Python dla poldka
165 Group: Libraries/Python
166 Requires: %{name}-libs = %{version}-%{release}
167 %pyrequires_eq python-libs
169 %description -n python-poldek
170 Python modules for poldek.
172 %description -n python-poldek -l pl.UTF-8
173 Moduły języka Python dla poldka.
176 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
195 # cleanup backups after patching
196 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
203 cp -f config.sub trurlib
205 CPPFLAGS="-std=gnu99"
207 %{?with_static:--enable-static --disable-shared} \
208 %{!?with_imode:--disable-imode} \
210 %{?with_python:--with-python}
214 rm -rf $RPM_BUILD_ROOT
215 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
218 DESTDIR=$RPM_BUILD_ROOT
221 %{__make} -C python install \
222 DESTDIR=$RPM_BUILD_ROOT \
226 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
228 %ifarch i486 i686 ppc sparc alpha athlon
229 %define _ftp_arch %{_target_cpu}
232 %define _ftp_arch x86_64
233 %define _ftp_alt_arch i686
236 %if "%{pld_release}" == "ti"
237 %define _ftp_arch i586
239 %define _ftp_arch i486
242 %ifarch pentium2 pentium3 pentium4
243 %define _ftp_arch i686
245 %ifarch sparcv9 sparc64
246 %define _ftp_arch sparc
249 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
251 %if "%{pld_release}" == "ti"
253 s|%%ARCH%%|%{_ftp_arch}|g
254 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
258 s|%%ARCH%%|%{_ftp_alt_arch}|g
259 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
263 s|%%ARCH%%|%{_ftp_arch}|g
264 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
268 s|%%ARCH%%|%{_ftp_alt_arch}|g
269 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
273 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
276 # add desktop file and icon
277 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
278 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
279 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
282 # sources we don't package
283 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
284 # include them in %doc
287 rm -f configs/Makefile*
291 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
297 rm -rf $RPM_BUILD_ROOT
299 %post -p /sbin/postshell
300 -/usr/sbin/fix-info-dir -c %{_infodir}
302 %postun -p /sbin/postshell
303 -/usr/sbin/fix-info-dir -c %{_infodir}
305 %post libs -p /sbin/ldconfig
306 %postun libs -p /sbin/ldconfig
308 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
309 if [ -f /etc/poldek.conf.rpmsave ]; then
318 if (sub(",noauto", "", name)) {
323 if (match(name, /,pri=[0-9]+/)) {
324 pri = substr(name, RSTART + 5, RLENGTH - 5);
325 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
328 # skip ac sources. already in new config.
329 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
332 print "name = " name;
333 print "type = " type;
334 print "path = " path;
335 print "auto = " auto;
336 print "autoup = " autoup;
342 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
343 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
346 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
348 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
352 %triggerpostun -- poldek < 0.30-0.20080225.00.1
353 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
354 %{__sed} -i -e '/^%%include source.conf/{
356 a# /etc/poldek/repos.d/*.conf
357 a%%includedir repos.d
358 }' %{_sysconfdir}/%{name}/poldek.conf
361 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
362 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
364 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
365 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
366 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
370 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
371 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
372 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
376 %files -f %{name}.lang
377 %defattr(644,root,root,755)
378 %doc README* NEWS TODO configs
379 %dir %{_sysconfdir}/%{name}
380 %dir %{_sysconfdir}/%{name}/repos.d
381 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
382 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
383 %attr(755,root,root) %{_bindir}/*
384 %dir %{_libdir}/%{name}
385 %attr(755,root,root) %{_libdir}/%{name}/*
386 %{_mandir}/man1/%{name}*
387 %lang(pl) %{_mandir}/pl/man1/%{name}*
388 %{_infodir}/poldek.info*
390 %{_desktopdir}/%{name}.desktop
391 %{_pixmapsdir}/%{name}.png
394 %if %{without static}
396 %defattr(644,root,root,755)
397 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
398 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
399 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
400 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
401 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
402 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
403 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
404 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
405 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
406 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
410 %defattr(644,root,root,755)
411 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
416 %defattr(644,root,root,755)
420 %files -n python-poldek
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
423 %{py_sitescriptdir}/poldek.py[co]
424 %{py_sitescriptdir}/poldekmod.py[co]