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}-up_mini18n.patch
48 Patch12: %{name}-dont-suggests-required-packages.patch
49 Patch13: %{name}-tty-for-erasures.patch
50 URL: http://poldek.pld-linux.org/
51 BuildRequires: autoconf
52 BuildRequires: automake
53 BuildRequires: bzip2-devel
55 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
56 BuildRequires: gettext-autopoint
57 BuildRequires: libtool
58 BuildRequires: libxml2-devel
59 BuildRequires: openssl-devel >= 0.9.7d
60 BuildRequires: pcre-devel
61 BuildRequires: perl-tools-pod
62 BuildRequires: pkgconfig
63 BuildRequires: popt-devel
64 %{?with_python:BuildRequires: python-devel}
65 BuildRequires: readline-devel >= 5.0
66 BuildRequires: rpm-devel >= %{ver_rpm}
67 %{?with_python:BuildRequires: rpm-pythonprov}
69 BuildRequires: zlib-devel
71 BuildRequires: bzip2-static
72 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
73 BuildRequires: glibc-static
74 BuildRequires: libselinux-static
75 BuildRequires: libxml2-static
76 BuildRequires: ncurses-static
77 BuildRequires: openssl-static
78 BuildRequires: pcre-static
79 BuildRequires: popt-static
80 BuildRequires: readline-static
81 BuildRequires: rpm-static
82 BuildRequires: zlib-static
84 Requires(triggerpostun): awk
85 Requires(triggerpostun): sed >= 4.0
86 Requires: %{name}-libs = %{version}-%{release}
87 Requires: db >= %{ver_db}-%{ver_db_rel}
88 Requires: rpm >= %{ver_rpm}
89 Requires: rpm-db-ver = %{ver_db}
90 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
93 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
96 poldek is an RPM package management tool which allows you to easily
97 perform package verification, installation (including system
98 installation from scratch), upgrading, and removal.
100 Program can be used in batch (like apt-get from Debian's APT) or
101 interactive mode. The interactive mode puts you into a readline
102 interface with command line autocompletion and history, similar to the
103 shell mode of Perl's CPAN.
105 %{?with_static:This version is statically linked.}
107 %{!?with_imode:This version hasn't got interactive mode.}
110 %description -l pl.UTF-8
111 poldek jest narzędziem linii poleceń służącym do weryfikacji,
112 instalacji (włączając instalację systemu od zera), aktualizacji i
115 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
116 interaktywnym. Tryb interaktywny posiada interfejs readline z
117 dopełnianiem komend i historią, podobny do trybu shell perlowego
120 %{?with_static:Ta wersja jest konsolidowana statycznie.}
122 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
125 Summary: poldek libraries
126 Summary(pl.UTF-8): Biblioteki poldka
132 %description libs -l pl.UTF-8
136 Summary: Header files for poldek libraries
137 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
138 Group: Development/Libraries
139 Requires: %{name}-libs = %{version}-%{release}
142 Header files for poldek libraries.
144 %description devel -l pl.UTF-8
145 Pliki nagłówkowe bibliotek poldka.
148 Summary: poldek static libraries
149 Summary(pl.UTF-8): Biblioteki statyczne poldka
150 Group: Development/Libraries
151 Requires: %{name}-devel = %{version}-%{release}
154 poldek static libraries.
156 %description static -l pl.UTF-8
157 Biblioteki statyczne poldka.
159 %package -n python-poldek
160 Summary: Python modules for poldek
161 Summary(pl.UTF-8): Moduły języka Python dla poldka
162 Group: Libraries/Python
163 Requires: %{name}-libs = %{version}-%{release}
164 %pyrequires_eq python-libs
166 %description -n python-poldek
167 Python modules for poldek.
169 %description -n python-poldek -l pl.UTF-8
170 Moduły języka Python dla poldka.
173 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
189 # cleanup backups after patching
190 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
197 cp -f config.sub trurlib
199 CPPFLAGS="-std=gnu99"
201 %{?with_static:--enable-static --disable-shared} \
202 %{!?with_imode:--disable-imode} \
204 %{?with_python:--with-python}
208 rm -rf $RPM_BUILD_ROOT
209 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
212 DESTDIR=$RPM_BUILD_ROOT
215 %{__make} -C python install \
216 DESTDIR=$RPM_BUILD_ROOT \
220 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
222 %ifarch i486 i686 ppc sparc alpha athlon
223 %define _ftp_arch %{_target_cpu}
226 %define _ftp_arch x86_64
227 %define _ftp_alt_arch i686
230 %if "%{pld_release}" == "ti"
231 %define _ftp_arch i586
233 %define _ftp_arch i486
236 %ifarch pentium2 pentium3 pentium4
237 %define _ftp_arch i686
239 %ifarch sparcv9 sparc64
240 %define _ftp_arch sparc
243 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
245 %if "%{pld_release}" == "ti"
247 s|%%ARCH%%|%{_ftp_arch}|g
248 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
252 s|%%ARCH%%|%{_ftp_alt_arch}|g
253 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
257 s|%%ARCH%%|%{_ftp_arch}|g
258 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
262 s|%%ARCH%%|%{_ftp_alt_arch}|g
263 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
267 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
270 # add desktop file and icon
271 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
272 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
273 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
276 # sources we don't package
277 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
278 # include them in %doc
281 rm -f configs/Makefile*
285 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
291 rm -rf $RPM_BUILD_ROOT
293 %post -p /sbin/postshell
294 -/usr/sbin/fix-info-dir -c %{_infodir}
296 %postun -p /sbin/postshell
297 -/usr/sbin/fix-info-dir -c %{_infodir}
299 %post libs -p /sbin/ldconfig
300 %postun libs -p /sbin/ldconfig
302 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
303 if [ -f /etc/poldek.conf.rpmsave ]; then
312 if (sub(",noauto", "", name)) {
317 if (match(name, /,pri=[0-9]+/)) {
318 pri = substr(name, RSTART + 5, RLENGTH - 5);
319 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
322 # skip ac sources. already in new config.
323 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
326 print "name = " name;
327 print "type = " type;
328 print "path = " path;
329 print "auto = " auto;
330 print "autoup = " autoup;
336 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
337 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
340 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
342 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
346 %triggerpostun -- poldek < 0.30-0.20080225.00.1
347 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
348 %{__sed} -i -e '/^%%include source.conf/{
350 a# /etc/poldek/repos.d/*.conf
351 a%%includedir repos.d
352 }' %{_sysconfdir}/%{name}/poldek.conf
355 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
356 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
358 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
359 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
360 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
364 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
365 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
366 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
370 %files -f %{name}.lang
371 %defattr(644,root,root,755)
372 %doc README* NEWS TODO configs
373 %dir %{_sysconfdir}/%{name}
374 %dir %{_sysconfdir}/%{name}/repos.d
375 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
376 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
377 %attr(755,root,root) %{_bindir}/*
378 %dir %{_libdir}/%{name}
379 %attr(755,root,root) %{_libdir}/%{name}/*
380 %{_mandir}/man1/%{name}*
381 %lang(pl) %{_mandir}/pl/man1/%{name}*
382 %{_infodir}/poldek.info*
384 %{_desktopdir}/%{name}.desktop
385 %{_pixmapsdir}/%{name}.png
388 %if %{without static}
390 %defattr(644,root,root,755)
391 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
392 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
393 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
394 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
395 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
396 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
397 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
398 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
399 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
400 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
404 %defattr(644,root,root,755)
405 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
410 %defattr(644,root,root,755)
414 %files -n python-poldek
415 %defattr(644,root,root,755)
416 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
417 %{py_sitescriptdir}/poldek.py[co]
418 %{py_sitescriptdir}/poldekmod.py[co]