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 URL: http://poldek.pld-linux.org/
53 BuildRequires: autoconf
54 BuildRequires: automake
55 BuildRequires: bzip2-devel
57 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
58 BuildRequires: gettext-autopoint
59 BuildRequires: libtool
60 BuildRequires: libxml2-devel
61 BuildRequires: openssl-devel >= 0.9.7d
62 BuildRequires: pcre-devel
63 BuildRequires: perl-tools-pod
64 BuildRequires: pkgconfig
65 BuildRequires: popt-devel
66 %{?with_python:BuildRequires: python-devel}
67 BuildRequires: readline-devel >= 5.0
68 BuildRequires: rpm-devel >= %{ver_rpm}
69 %{?with_python:BuildRequires: rpm-pythonprov}
71 BuildRequires: zlib-devel
73 BuildRequires: bzip2-static
74 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
75 BuildRequires: glibc-static
76 BuildRequires: libselinux-static
77 BuildRequires: libxml2-static
78 BuildRequires: ncurses-static
79 BuildRequires: openssl-static
80 BuildRequires: pcre-static
81 BuildRequires: popt-static
82 BuildRequires: readline-static
83 BuildRequires: rpm-static
84 BuildRequires: zlib-static
86 Requires(triggerpostun): awk
87 Requires(triggerpostun): sed >= 4.0
88 Requires: %{name}-libs = %{version}-%{release}
89 Requires: db >= %{ver_db}-%{ver_db_rel}
90 Requires: rpm >= %{ver_rpm}
91 Requires: rpm-db-ver = %{ver_db}
92 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
95 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
98 poldek is an RPM package management tool which allows you to easily
99 perform package verification, installation (including system
100 installation from scratch), upgrading, and removal.
102 Program can be used in batch (like apt-get from Debian's APT) or
103 interactive mode. The interactive mode puts you into a readline
104 interface with command line autocompletion and history, similar to the
105 shell mode of Perl's CPAN.
107 %{?with_static:This version is statically linked.}
109 %{!?with_imode:This version hasn't got interactive mode.}
112 %description -l pl.UTF-8
113 poldek jest narzędziem linii poleceń służącym do weryfikacji,
114 instalacji (włączając instalację systemu od zera), aktualizacji i
117 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
118 interaktywnym. Tryb interaktywny posiada interfejs readline z
119 dopełnianiem komend i historią, podobny do trybu shell perlowego
122 %{?with_static:Ta wersja jest konsolidowana statycznie.}
124 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
127 Summary: poldek libraries
128 Summary(pl.UTF-8): Biblioteki poldka
134 %description libs -l pl.UTF-8
138 Summary: Header files for poldek libraries
139 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
140 Group: Development/Libraries
141 Requires: %{name}-libs = %{version}-%{release}
144 Header files for poldek libraries.
146 %description devel -l pl.UTF-8
147 Pliki nagłówkowe bibliotek poldka.
150 Summary: poldek static libraries
151 Summary(pl.UTF-8): Biblioteki statyczne poldka
152 Group: Development/Libraries
153 Requires: %{name}-devel = %{version}-%{release}
156 poldek static libraries.
158 %description static -l pl.UTF-8
159 Biblioteki statyczne poldka.
161 %package -n python-poldek
162 Summary: Python modules for poldek
163 Summary(pl.UTF-8): Moduły języka Python dla poldka
164 Group: Libraries/Python
165 Requires: %{name}-libs = %{version}-%{release}
166 %pyrequires_eq python-libs
168 %description -n python-poldek
169 Python modules for poldek.
171 %description -n python-poldek -l pl.UTF-8
172 Moduły języka Python dla poldka.
175 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
193 # cleanup backups after patching
194 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
201 cp -f config.sub trurlib
203 CPPFLAGS="-std=gnu99"
205 %{?with_static:--enable-static --disable-shared} \
206 %{!?with_imode:--disable-imode} \
208 %{?with_python:--with-python}
212 rm -rf $RPM_BUILD_ROOT
213 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
216 DESTDIR=$RPM_BUILD_ROOT
219 %{__make} -C python install \
220 DESTDIR=$RPM_BUILD_ROOT \
224 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
226 %ifarch i486 i686 ppc sparc alpha athlon
227 %define _ftp_arch %{_target_cpu}
230 %define _ftp_arch x86_64
231 %define _ftp_alt_arch i686
234 %if "%{pld_release}" == "ti"
235 %define _ftp_arch i586
237 %define _ftp_arch i486
240 %ifarch pentium2 pentium3 pentium4
241 %define _ftp_arch i686
243 %ifarch sparcv9 sparc64
244 %define _ftp_arch sparc
247 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
249 %if "%{pld_release}" == "ti"
251 s|%%ARCH%%|%{_ftp_arch}|g
252 ' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
256 s|%%ARCH%%|%{_ftp_alt_arch}|g
257 ' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
261 s|%%ARCH%%|%{_ftp_arch}|g
262 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
266 s|%%ARCH%%|%{_ftp_alt_arch}|g
267 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
271 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
274 # add desktop file and icon
275 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
276 install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
277 install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
280 # sources we don't package
281 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
282 # include them in %doc
285 rm -f configs/Makefile*
289 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
295 rm -rf $RPM_BUILD_ROOT
297 %post -p /sbin/postshell
298 -/usr/sbin/fix-info-dir -c %{_infodir}
300 %postun -p /sbin/postshell
301 -/usr/sbin/fix-info-dir -c %{_infodir}
303 %post libs -p /sbin/ldconfig
304 %postun libs -p /sbin/ldconfig
306 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
307 if [ -f /etc/poldek.conf.rpmsave ]; then
316 if (sub(",noauto", "", name)) {
321 if (match(name, /,pri=[0-9]+/)) {
322 pri = substr(name, RSTART + 5, RLENGTH - 5);
323 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
326 # skip ac sources. already in new config.
327 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
330 print "name = " name;
331 print "type = " type;
332 print "path = " path;
333 print "auto = " auto;
334 print "autoup = " autoup;
340 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
341 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
344 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
346 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
350 %triggerpostun -- poldek < 0.30-0.20080225.00.1
351 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
352 %{__sed} -i -e '/^%%include source.conf/{
354 a# /etc/poldek/repos.d/*.conf
355 a%%includedir repos.d
356 }' %{_sysconfdir}/%{name}/poldek.conf
359 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
360 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
362 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
363 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
364 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
368 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
369 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
370 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
374 %files -f %{name}.lang
375 %defattr(644,root,root,755)
376 %doc README* NEWS TODO configs
377 %dir %{_sysconfdir}/%{name}
378 %dir %{_sysconfdir}/%{name}/repos.d
379 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
380 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
381 %attr(755,root,root) %{_bindir}/*
382 %dir %{_libdir}/%{name}
383 %attr(755,root,root) %{_libdir}/%{name}/*
384 %{_mandir}/man1/%{name}*
385 %lang(pl) %{_mandir}/pl/man1/%{name}*
386 %{_infodir}/poldek.info*
388 %{_desktopdir}/%{name}.desktop
389 %{_pixmapsdir}/%{name}.png
392 %if %{without static}
394 %defattr(644,root,root,755)
395 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
396 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
397 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
398 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
399 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
400 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
401 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
402 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
403 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
404 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
408 %defattr(644,root,root,755)
409 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
414 %defattr(644,root,root,755)
418 %files -n python-poldek
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
421 %{py_sitescriptdir}/poldek.py[co]
422 %{py_sitescriptdir}/poldekmod.py[co]