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}-langs_forward.patch
48 Patch12: %{name}-dont-suggests-required-packages.patch
49 Patch13: %{name}-tty-for-erasures.patch
50 Patch14: %{name}-both_langs.patch
51 URL: http://poldek.pld-linux.org/
52 BuildRequires: autoconf
53 BuildRequires: automake
54 BuildRequires: bzip2-devel
56 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
57 BuildRequires: gettext-autopoint
58 BuildRequires: libtool
59 BuildRequires: libxml2-devel
60 BuildRequires: openssl-devel >= 0.9.7d
61 BuildRequires: pcre-devel
62 BuildRequires: perl-tools-pod
63 BuildRequires: pkgconfig
64 BuildRequires: popt-devel
65 %{?with_python:BuildRequires: python-devel}
66 BuildRequires: readline-devel >= 5.0
67 BuildRequires: rpm-devel >= %{ver_rpm}
68 %{?with_python:BuildRequires: rpm-pythonprov}
70 BuildRequires: zlib-devel
72 BuildRequires: bzip2-static
73 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
74 BuildRequires: glibc-static
75 BuildRequires: libselinux-static
76 BuildRequires: libxml2-static
77 BuildRequires: ncurses-static
78 BuildRequires: openssl-static
79 BuildRequires: pcre-static
80 BuildRequires: popt-static
81 BuildRequires: readline-static
82 BuildRequires: rpm-static
83 BuildRequires: zlib-static
85 Requires(triggerpostun): awk
86 Requires(triggerpostun): sed >= 4.0
87 Requires: %{name}-libs = %{version}-%{release}
88 Requires: db >= %{ver_db}-%{ver_db_rel}
89 Requires: rpm >= %{ver_rpm}
90 Requires: rpm-db-ver = %{ver_db}
91 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 poldek is an RPM package management tool which allows you to easily
98 perform package verification, installation (including system
99 installation from scratch), upgrading, and removal.
101 Program can be used in batch (like apt-get from Debian's APT) or
102 interactive mode. The interactive mode puts you into a readline
103 interface with command line autocompletion and history, similar to the
104 shell mode of Perl's CPAN.
106 %{?with_static:This version is statically linked.}
108 %{!?with_imode:This version hasn't got interactive mode.}
111 %description -l pl.UTF-8
112 poldek jest narzędziem linii poleceń służącym do weryfikacji,
113 instalacji (włączając instalację systemu od zera), aktualizacji i
116 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
117 interaktywnym. Tryb interaktywny posiada interfejs readline z
118 dopełnianiem komend i historią, podobny do trybu shell perlowego
121 %{?with_static:Ta wersja jest konsolidowana statycznie.}
123 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
126 Summary: poldek libraries
127 Summary(pl.UTF-8): Biblioteki poldka
133 %description libs -l pl.UTF-8
137 Summary: Header files for poldek libraries
138 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
139 Group: Development/Libraries
140 Requires: %{name}-libs = %{version}-%{release}
143 Header files for poldek libraries.
145 %description devel -l pl.UTF-8
146 Pliki nagłówkowe bibliotek poldka.
149 Summary: poldek static libraries
150 Summary(pl.UTF-8): Biblioteki statyczne poldka
151 Group: Development/Libraries
152 Requires: %{name}-devel = %{version}-%{release}
155 poldek static libraries.
157 %description static -l pl.UTF-8
158 Biblioteki statyczne poldka.
160 %package -n python-poldek
161 Summary: Python modules for poldek
162 Summary(pl.UTF-8): Moduły języka Python dla poldka
163 Group: Libraries/Python
164 Requires: %{name}-libs = %{version}-%{release}
165 %pyrequires_eq python-libs
167 %description -n python-poldek
168 Python modules for poldek.
170 %description -n python-poldek -l pl.UTF-8
171 Moduły języka Python dla poldka.
174 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
191 # cleanup backups after patching
192 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
199 cp -f config.sub trurlib
201 CPPFLAGS="-std=gnu99"
203 %{?with_static:--enable-static --disable-shared} \
204 %{!?with_imode:--disable-imode} \
206 %{?with_python:--with-python}
210 rm -rf $RPM_BUILD_ROOT
211 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
214 DESTDIR=$RPM_BUILD_ROOT
217 %{__make} -C python install \
218 DESTDIR=$RPM_BUILD_ROOT \
222 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
224 %ifarch i486 i686 ppc sparc alpha athlon
225 %define _ftp_arch %{_target_cpu}
228 %define _ftp_arch x86_64
229 %define _ftp_alt_arch i686
232 %if "%{pld_release}" == "ti"
233 %define _ftp_arch i586
235 %define _ftp_arch i486
238 %ifarch pentium2 pentium3 pentium4
239 %define _ftp_arch i686
241 %ifarch sparcv9 sparc64
242 %define _ftp_arch sparc
245 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
247 %if "%{pld_release}" == "ti"
249 s|%%ARCH%%|%{_ftp_arch}|g
250 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
254 s|%%ARCH%%|%{_ftp_alt_arch}|g
255 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
259 s|%%ARCH%%|%{_ftp_arch}|g
260 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
264 s|%%ARCH%%|%{_ftp_alt_arch}|g
265 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
269 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
272 # add desktop file and icon
273 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
274 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
275 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
278 # sources we don't package
279 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
280 # include them in %doc
283 rm -f configs/Makefile*
287 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
293 rm -rf $RPM_BUILD_ROOT
295 %post -p /sbin/postshell
296 -/usr/sbin/fix-info-dir -c %{_infodir}
298 %postun -p /sbin/postshell
299 -/usr/sbin/fix-info-dir -c %{_infodir}
301 %post libs -p /sbin/ldconfig
302 %postun libs -p /sbin/ldconfig
304 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
305 if [ -f /etc/poldek.conf.rpmsave ]; then
314 if (sub(",noauto", "", name)) {
319 if (match(name, /,pri=[0-9]+/)) {
320 pri = substr(name, RSTART + 5, RLENGTH - 5);
321 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
324 # skip ac sources. already in new config.
325 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
328 print "name = " name;
329 print "type = " type;
330 print "path = " path;
331 print "auto = " auto;
332 print "autoup = " autoup;
338 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
339 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
342 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
344 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
348 %triggerpostun -- poldek < 0.30-0.20080225.00.1
349 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
350 %{__sed} -i -e '/^%%include source.conf/{
352 a# /etc/poldek/repos.d/*.conf
353 a%%includedir repos.d
354 }' %{_sysconfdir}/%{name}/poldek.conf
357 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
358 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
360 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
361 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
362 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
366 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
367 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
368 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
372 %files -f %{name}.lang
373 %defattr(644,root,root,755)
374 %doc README* NEWS TODO configs
375 %dir %{_sysconfdir}/%{name}
376 %dir %{_sysconfdir}/%{name}/repos.d
377 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
378 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
379 %attr(755,root,root) %{_bindir}/*
380 %dir %{_libdir}/%{name}
381 %attr(755,root,root) %{_libdir}/%{name}/*
382 %{_mandir}/man1/%{name}*
383 %lang(pl) %{_mandir}/pl/man1/%{name}*
384 %{_infodir}/poldek.info*
386 %{_desktopdir}/%{name}.desktop
387 %{_pixmapsdir}/%{name}.png
390 %if %{without static}
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
394 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
395 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
396 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
397 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
398 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
399 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
400 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
401 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
402 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
406 %defattr(644,root,root,755)
407 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
412 %defattr(644,root,root,755)
416 %files -n python-poldek
417 %defattr(644,root,root,755)
418 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
419 %{py_sitescriptdir}/poldek.py[co]
420 %{py_sitescriptdir}/poldekmod.py[co]