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 %define ver_db 4.3.27-1
9 %define ver_rpm 4.4.9-1
11 %define snap 20080225.00
13 Summary: RPM packages management helper tool
14 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
17 Release: 0.%{snap}.%{rel}
19 Group: Applications/System
20 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
21 # Source0-md5: 22b2cfb19cebd123e8d8148fb6ca27de
23 Source2: %{name}-multilib.conf
24 Source3: %{name}-aliases.conf
25 Source4: %{name}.desktop
27 Patch1: %{name}-vserver-packages.patch
28 Patch2: %{name}-config.patch
29 Patch3: %{name}-multilib.patch
30 Patch4: %{name}-bug117hack.patch
31 Patch5: %{name}-missing-symbol.patch
32 Patch6: %{name}-abort-on-upgrade.patch
33 URL: http://poldek.pld-linux.org/
34 BuildRequires: autoconf
35 BuildRequires: automake
36 BuildRequires: bzip2-devel
38 BuildRequires: db-devel >= %{ver_db}
39 BuildRequires: gettext-autopoint
40 BuildRequires: libtool
41 BuildRequires: libxml2-devel
42 BuildRequires: openssl-devel >= 0.9.7d
43 BuildRequires: pcre-devel
44 BuildRequires: perl-tools-pod
45 BuildRequires: pkgconfig
46 BuildRequires: popt-devel
47 %{?with_python:BuildRequires: python-devel}
48 BuildRequires: readline-devel >= 5.0
49 BuildRequires: rpm-devel >= %{ver_rpm}
50 %{?with_python:BuildRequires: rpm-pythonprov}
52 BuildRequires: zlib-devel
54 BuildRequires: bzip2-static
55 BuildRequires: db-static >= %{ver_db}
56 BuildRequires: glibc-static
57 BuildRequires: libselinux-static
58 BuildRequires: libxml2-static
59 BuildRequires: ncurses-static
60 BuildRequires: openssl-static
61 BuildRequires: pcre-static
62 BuildRequires: popt-static
63 BuildRequires: readline-static
64 BuildRequires: rpm-static
65 BuildRequires: zlib-static
67 Requires(triggerpostun): awk
68 Requires(triggerpostun): sed >= 4.0
69 Requires: %{name}-libs = %{version}-%{release}
70 Requires: db >= %{ver_db}
71 Requires: rpm >= %{ver_rpm}
72 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 poldek is an RPM package management tool which allows you to easily
79 perform package verification, installation (including system
80 installation from scratch), upgrading, and removal.
82 Program can be used in batch (like apt-get from Debian's APT) or
83 interactive mode. The interactive mode puts you into a readline
84 interface with command line autocompletion and history, similar to the
85 shell mode of Perl's CPAN.
87 %{?with_static:This version is statically linked.}
89 %{!?with_imode:This version hasn't got interactive mode.}
92 %description -l pl.UTF-8
93 poldek jest narzędziem linii poleceń służącym do weryfikacji,
94 instalacji (włączając instalację systemu od zera), aktualizacji i
97 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
98 interaktywnym. Tryb interaktywny posiada interfejs readline z
99 dopełnianiem komend i historią, podobny do trybu shell perlowego
102 %{?with_static:Ta wersja jest konsolidowana statycznie.}
104 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
107 Summary: poldek libraries
108 Summary(pl.UTF-8): Biblioteki poldka
114 %description libs -l pl.UTF-8
118 Summary: Header files for poldek libraries
119 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
120 Group: Development/Libraries
121 Requires: %{name}-libs = %{version}-%{release}
124 Header files for poldek libraries.
126 %description devel -l pl.UTF-8
127 Pliki nagłówkowe bibliotek poldka.
130 Summary: poldek static libraries
131 Summary(pl.UTF-8): Biblioteki statyczne poldka
132 Group: Development/Libraries
133 Requires: %{name}-devel = %{version}-%{release}
136 poldek static libraries.
138 %description static -l pl.UTF-8
139 Biblioteki statyczne poldka.
141 %package -n python-poldek
142 Summary: Python modules for poldek
143 Summary(pl.UTF-8): Moduły języka Python dla poldka
144 Group: Libraries/Python
145 Requires: %{name}-libs = %{version}-%{release}
146 %pyrequires_eq python-libs
148 %description -n python-poldek
149 Python modules for poldek.
151 %description -n python-poldek -l pl.UTF-8
152 Moduły języka Python dla poldka.
155 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
165 # cleanup backups after patching
166 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
173 cp -f config.sub trurlib
175 CPPFLAGS="-std=gnu99"
177 %{?with_static:--enable-static --disable-shared} \
178 %{!?with_imode:--disable-imode} \
180 %{?with_python:--with-python}
184 rm -rf $RPM_BUILD_ROOT
185 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
188 DESTDIR=$RPM_BUILD_ROOT
191 %{__make} -C python install \
192 DESTDIR=$RPM_BUILD_ROOT \
196 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
198 %ifarch i486 i686 ppc sparc alpha athlon
199 %define _ftp_arch %{_target_cpu}
202 %define _ftp_arch x86_64
203 %define _ftp_alt_arch i686
206 %define _ftp_arch i486
208 %ifarch pentium2 pentium3 pentium4
209 %define _ftp_arch i686
211 %ifarch sparcv9 sparc64
212 %define _ftp_arch sparc
219 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
222 s|%%ARCH%%|%{_ftp_arch}|g
223 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
227 s|%%ARCH%%|%{_ftp_alt_arch}|g
228 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
231 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
234 # add desktop file and icon
235 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
236 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
237 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
240 # get rid of non-pld sources
241 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
242 # include them in %doc
245 rm -f configs/Makefile*
249 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
255 rm -rf $RPM_BUILD_ROOT
257 %post -p /sbin/postshell
258 -/usr/sbin/fix-info-dir -c %{_infodir}
260 %postun -p /sbin/postshell
261 -/usr/sbin/fix-info-dir -c %{_infodir}
263 %post libs -p /sbin/ldconfig
264 %postun libs -p /sbin/ldconfig
266 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
267 if [ -f /etc/poldek.conf.rpmsave ]; then
276 if (sub(",noauto", "", name)) {
281 if (match(name, /,pri=[0-9]+/)) {
282 pri = substr(name, RSTART + 5, RLENGTH - 5);
283 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
286 # skip ac sources. already in new config.
287 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
290 print "name = " name;
291 print "type = " type;
292 print "path = " path;
293 print "auto = " auto;
294 print "autoup = " autoup;
300 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
301 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
304 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
306 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
310 %files -f %{name}.lang
311 %defattr(644,root,root,755)
312 %doc README* NEWS TODO configs/
313 %dir %{_sysconfdir}/%{name}
314 %dir %{_sysconfdir}/%{name}/repos.d
315 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
316 %attr(755,root,root) %{_bindir}/*
317 %dir %{_libdir}/%{name}
318 %attr(755,root,root) %{_libdir}/%{name}/*
319 %{_mandir}/man1/%{name}*
320 %lang(pl) %{_mandir}/pl/man1/%{name}*
321 %{_infodir}/poldek.info*
323 %{_desktopdir}/%{name}.desktop
324 %{_pixmapsdir}/%{name}.png
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
331 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
332 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
333 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
334 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
335 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
336 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
337 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
338 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
339 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
343 %defattr(644,root,root,755)
344 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
349 %defattr(644,root,root,755)
353 %files -n python-poldek
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
356 %{py_sitescriptdir}/poldek.py[co]
357 %{py_sitescriptdir}/poldekmod.py[co]