2 %bcond_with static # don't use shared libraries
3 %bcond_without imode # don't build interactive mode
4 %bcond_without python # don't build python bindings
6 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
7 %define ver_db 4.3.27-1
8 %define ver_rpm 4.4.9-1
9 %define snap 20080225.00
11 Summary: RPM packages management helper tool
12 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
15 Release: 0.%{snap}.%{rel}
17 Group: Applications/System
18 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5: 22b2cfb19cebd123e8d8148fb6ca27de
21 Source2: %{name}-multilib.conf
22 Source3: %{name}-aliases.conf
23 Source4: %{name}.desktop
25 Patch0: %{name}-dirdeps.patch
26 Patch1: %{name}-vserver-packages.patch
27 Patch2: %{name}-config.patch
28 Patch3: %{name}-nonoorder.patch
29 Patch4: %{name}-bug117hack.patch
30 Patch5: %{name}-missing-symbol.patch
31 Patch6: %{name}-abort-on-upgrade.patch
32 Patch7: %{name}-uninstall-greedy-fix.patch
33 Patch8: %{name}-pkguinf-kill-assert.patch
34 Patch9: %{name}-pkguinf-sourcerpm.patch
35 Patch10: %{name}-sigint_emit.patch
36 Patch11: %{name}-bug139.patch
37 URL: http://poldek.pld-linux.org/
38 BuildRequires: autoconf
39 BuildRequires: automake
40 BuildRequires: bzip2-devel
42 BuildRequires: db-devel >= %{ver_db}
43 BuildRequires: gettext-autopoint
44 BuildRequires: libtool
45 BuildRequires: libxml2-devel
46 BuildRequires: openssl-devel >= 0.9.7d
47 BuildRequires: pcre-devel
48 BuildRequires: perl-tools-pod
49 BuildRequires: pkgconfig
50 BuildRequires: popt-devel
51 %{?with_python:BuildRequires: python-devel}
52 BuildRequires: readline-devel >= 5.0
53 BuildRequires: rpm-devel >= %{ver_rpm}
54 %{?with_python:BuildRequires: rpm-pythonprov}
55 BuildRequires: sed >= 4.0
57 BuildRequires: zlib-devel
59 BuildRequires: bzip2-static
60 BuildRequires: db-static >= %{ver_db}
61 BuildRequires: glibc-static
62 BuildRequires: libselinux-static
63 BuildRequires: libxml2-static
64 BuildRequires: ncurses-static
65 BuildRequires: openssl-static
66 BuildRequires: pcre-static
67 BuildRequires: popt-static
68 BuildRequires: readline-static
69 BuildRequires: rpm-static
70 BuildRequires: zlib-static
72 Requires(triggerpostun): awk
73 Requires(triggerpostun): sed >= 4.0
74 Requires: %{name}-libs = %{version}-%{release}
75 Requires: db >= %{ver_db}
76 Requires: openssl >= 0.9.7d
77 Requires: rpm >= %{ver_rpm}
78 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
81 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
84 poldek is an RPM package management tool which allows you to easily
85 perform package verification, installation (including system
86 installation from scratch), upgrading, and removal.
88 Program can be used in batch (like apt-get from Debian's APT) or
89 interactive mode. The interactive mode puts you into a readline
90 interface with command line autocompletion and history, similar to the
91 shell mode of Perl's CPAN.
93 %{?with_static:This version is statically linked.}
95 %{!?with_imode:This version hasn't got interactive mode.}
98 %description -l pl.UTF-8
99 poldek jest narzędziem linii poleceń służącym do weryfikacji,
100 instalacji (włączając instalację systemu od zera), aktualizacji i
103 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
104 interaktywnym. Tryb interaktywny posiada interfejs readline z
105 dopełnianiem komend i historią, podobny do trybu shell perlowego
108 %{?with_static:Ta wersja jest konsolidowana statycznie.}
110 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
113 Summary: poldek libraries
114 Summary(pl.UTF-8): Biblioteki poldka
120 %description libs -l pl.UTF-8
124 Summary: Header files for poldek libraries
125 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
126 Group: Development/Libraries
127 Requires: %{name}-libs = %{version}-%{release}
130 Header files for poldek libraries.
132 %description devel -l pl.UTF-8
133 Pliki nagłówkowe bibliotek poldka.
136 Summary: poldek static libraries
137 Summary(pl.UTF-8): Biblioteki statyczne poldka
138 Group: Development/Libraries
139 Requires: %{name}-devel = %{version}-%{release}
142 poldek static libraries.
144 %description static -l pl.UTF-8
145 Biblioteki statyczne poldka.
147 %package -n python-poldek
148 Summary: Python modules for poldek
149 Summary(pl.UTF-8): Moduły języka Python dla poldka
150 Group: Libraries/Python
151 Requires: %{name}-libs = %{version}-%{release}
152 %pyrequires_eq python-libs
154 %description -n python-poldek
155 Python modules for poldek.
157 %description -n python-poldek -l pl.UTF-8
158 Moduły języka Python dla poldka.
161 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
175 # cleanup backups after patching
176 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
183 cp -f config.sub trurlib
185 CPPFLAGS="-std=gnu99"
187 %{?with_static:--enable-static --disable-shared} \
188 %{!?with_imode:--disable-imode} \
190 %{?with_python:--with-python}
194 rm -rf $RPM_BUILD_ROOT
195 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
198 DESTDIR=$RPM_BUILD_ROOT
201 %{__make} -C python install \
202 DESTDIR=$RPM_BUILD_ROOT \
206 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
208 %ifarch i386 i586 i686 ppc sparc alpha athlon
209 %define _ftp_arch %{_target_cpu}
212 %define _ftp_arch amd64
213 %define _ftp_alt_arch i686
216 %define _ftp_arch i386
218 %ifarch pentium2 pentium3 pentium4
219 %define _ftp_arch i686
221 %ifarch sparcv9 sparc64
222 %define _ftp_arch sparc
229 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
232 s|%%ARCH%%|%{_ftp_arch}|g
233 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
237 s|%%ARCH%%|%{_ftp_alt_arch}|g
238 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
241 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
244 # add desktop file and icon
245 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
246 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
247 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
250 # sources we don't package
251 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
252 # include them in %doc
255 rm -f configs/Makefile*
259 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
265 rm -rf $RPM_BUILD_ROOT
267 %post -p /sbin/postshell
268 -/usr/sbin/fix-info-dir -c %{_infodir}
270 %postun -p /sbin/postshell
271 -/usr/sbin/fix-info-dir -c %{_infodir}
273 %post libs -p /sbin/ldconfig
274 %postun libs -p /sbin/ldconfig
276 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
277 if [ -f /etc/poldek.conf.rpmsave ]; then
286 if (sub(",noauto", "", name)) {
291 if (match(name, /,pri=[0-9]+/)) {
292 pri = substr(name, RSTART + 5, RLENGTH - 5);
293 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
296 # skip ac sources. already in new config.
297 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
300 print "name = " name;
301 print "type = " type;
302 print "path = " path;
303 print "auto = " auto;
304 print "autoup = " autoup;
310 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
311 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
314 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
316 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
320 %triggerpostun -- poldek < 0.30-0.20080225.00.1
321 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
322 %{__sed} -i -e '/^%%include source.conf/{
324 a# /etc/poldek/repos.d/*.conf
325 a%%includedir repos.d
326 }' %{_sysconfdir}/%{name}/poldek.conf
329 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
330 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
332 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
333 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
334 mv -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
338 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
339 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
340 mv -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
344 %files -f %{name}.lang
345 %defattr(644,root,root,755)
346 %doc README* NEWS TODO configs
347 %dir %{_sysconfdir}/%{name}
348 %dir %{_sysconfdir}/%{name}/repos.d
349 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
350 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
351 %attr(755,root,root) %{_bindir}/*
352 %dir %{_libdir}/%{name}
353 %attr(755,root,root) %{_libdir}/%{name}/*
354 %{_mandir}/man1/%{name}*
355 %lang(pl) %{_mandir}/pl/man1/%{name}*
356 %{_infodir}/poldek.info*
358 %{_desktopdir}/%{name}.desktop
359 %{_pixmapsdir}/%{name}.png
362 %if %{without static}
364 %defattr(644,root,root,755)
365 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
366 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
367 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
368 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
369 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
370 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
371 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
372 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
373 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
374 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
378 %defattr(644,root,root,755)
379 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
384 %defattr(644,root,root,755)
388 %files -n python-poldek
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
391 %{py_sitescriptdir}/poldek.py[co]
392 %{py_sitescriptdir}/poldekmod.py[co]