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 20070703.00
12 Summary: RPM packages management helper tool
13 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
18 Group: Applications/System
19 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
20 # Source0-md5: dae23dec560fad954abf157fd250e4c3
22 Source2: %{name}-multilib.conf
23 Source3: %{name}-aliases.conf
24 Patch1: %{name}-vserver-packages.patch
25 Patch2: %{name}-config.patch
26 Patch3: %{name}-multilib.patch
27 URL: http://poldek.pld-linux.org/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: bzip2-devel
32 BuildRequires: db-devel >= %{ver_db}
33 BuildRequires: gettext-autopoint
34 BuildRequires: libtool
35 BuildRequires: libxml2-devel
36 BuildRequires: openssl-devel >= 0.9.7d
37 BuildRequires: pcre-devel
38 BuildRequires: perl-tools-pod
39 BuildRequires: pkgconfig
40 BuildRequires: popt-devel
41 %{?with_python:BuildRequires: python-devel}
42 BuildRequires: readline-devel >= 5.0
43 BuildRequires: rpm-devel >= %{ver_rpm}
44 %{?with_python:BuildRequires: rpm-pythonprov}
46 BuildRequires: zlib-devel
48 BuildRequires: bzip2-static
49 BuildRequires: db-static >= %{ver_db}
50 BuildRequires: glibc-static
51 BuildRequires: libselinux-static
52 BuildRequires: libxml2-static
53 BuildRequires: ncurses-static
54 BuildRequires: openssl-static
55 BuildRequires: pcre-static
56 BuildRequires: popt-static
57 BuildRequires: readline-static
58 BuildRequires: rpm-static
59 BuildRequires: zlib-static
61 Requires(triggerpostun): awk
62 Requires(triggerpostun): sed >= 4.0
63 Requires: %{name}-libs = %{version}-%{release}
64 Requires: db >= %{ver_db}
65 Requires: rpm >= %{ver_rpm}
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 poldek is an RPM package management tool which allows you to easily
72 perform package verification, installation (including system
73 installation from scratch), upgrading, and removal.
75 Program can be used in batch (like apt-get from Debian's APT) or
76 interactive mode. The interactive mode puts you into a readline
77 interface with command line autocompletion and history, similar to the
78 shell mode of Perl's CPAN.
80 %{?with_static:This version is statically linked.}
82 %{!?with_imode:This version hasn't got interactive mode.}
85 %description -l pl.UTF-8
86 poldek jest narzędziem linii poleceń służącym do weryfikacji,
87 instalacji (włączając instalację systemu od zera), aktualizacji i
90 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
91 interaktywnym. Tryb interaktywny posiada interfejs readline z
92 dopełnianiem komend i historią, podobny do trybu shell perlowego
95 %{?with_static:Ta wersja jest konsolidowana statycznie.}
97 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
100 Summary: poldek libraries
101 Summary(pl.UTF-8): Biblioteki poldka
107 %description libs -l pl.UTF-8
111 Summary: Header files for poldek libraries
112 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
113 Group: Development/Libraries
114 Requires: %{name}-libs = %{version}-%{release}
117 Header files for poldek libraries.
119 %description devel -l pl.UTF-8
120 Pliki nagłówkowe bibliotek poldka.
123 Summary: poldek static libraries
124 Summary(pl.UTF-8): Biblioteki statyczne poldka
125 Group: Development/Libraries
126 Requires: %{name}-devel = %{version}-%{release}
129 poldek static libraries.
131 %description static -l pl.UTF-8
132 Biblioteki statyczne poldka.
134 %package -n python-poldek
135 Summary: Python modules for poldek
136 Summary(pl.UTF-8): Moduły języka Python dla poldka
137 Group: Libraries/Python
138 Requires: %{name}-libs = %{version}-%{release}
139 %pyrequires_eq python-libs
141 %description -n python-poldek
142 Python modules for poldek.
144 %description -n python-poldek -l pl.UTF-8
145 Moduły języka Python dla poldka.
148 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
155 # cleanup backups after patching
156 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
163 cp -f config.sub trurlib
166 %{?with_static:--enable-static --disable-shared} \
167 %{!?with_imode:--disable-imode} \
169 %{?with_python:--with-python}
173 rm -rf $RPM_BUILD_ROOT
174 install -d $RPM_BUILD_ROOT%{_sysconfdir}
177 DESTDIR=$RPM_BUILD_ROOT
180 %{__make} -C python install \
181 DESTDIR=$RPM_BUILD_ROOT \
185 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
187 %ifarch i486 i686 ppc sparc alpha athlon
188 %define _ftp_arch %{_target_cpu}
191 %define _ftp_arch x86_64
192 %define _ftp_alt_arch i686
195 %define _ftp_arch i486
197 %ifarch pentium2 pentium3 pentium4
198 %define _ftp_arch i686
200 %ifarch sparcv9 sparc64
201 %define _ftp_arch sparc
208 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
211 s|%%ARCH%%|%{_ftp_arch}|g
212 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
216 s|%%ARCH%%|%{_ftp_alt_arch}|g
217 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
220 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
222 # get rid of non-pld sources
223 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
224 # include them in %doc
227 rm -f configs/Makefile*
231 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
237 rm -rf $RPM_BUILD_ROOT
240 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
243 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
245 %post libs -p /sbin/ldconfig
246 %postun libs -p /sbin/ldconfig
248 %triggerpostun -- poldek <= 0.18.3-5
249 if [ -f /etc/poldek.conf ]; then
250 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
253 # otherwise don't touch
254 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
255 %triggerpostun -- poldek <= 0.18.7-1
256 if [ -f /etc/poldek.conf ]; then
257 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
261 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
262 if [ -f /etc/poldek.conf.rpmsave ]; then
271 if (sub(",noauto", "", name)) {
276 if (match(name, /,pri=[0-9]+/)) {
277 pri = substr(name, RSTART + 5, RLENGTH - 5);
278 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
281 # skip ac sources. already in new config.
282 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
285 print "name = " name;
286 print "type = " type;
287 print "path = " path;
288 print "auto = " auto;
289 print "autoup = " autoup;
295 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
296 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
299 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
301 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
305 %files -f %{name}.lang
306 %defattr(644,root,root,755)
307 %doc README* NEWS TODO configs/
308 %dir %{_sysconfdir}/%{name}
309 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
310 %attr(755,root,root) %{_bindir}/*
311 %dir %{_libdir}/%{name}
312 %attr(755,root,root) %{_libdir}/%{name}/*
313 %{_mandir}/man1/%{name}*
314 %lang(pl) %{_mandir}/pl/man1/%{name}*
315 %{_infodir}/poldek.info*
319 %defattr(644,root,root,755)
320 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
324 %defattr(644,root,root,755)
325 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
330 %defattr(644,root,root,755)
334 %files -n python-poldek
335 %defattr(644,root,root,755)
336 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
337 %{py_sitescriptdir}/poldek.py[co]
338 %{py_sitescriptdir}/poldekmod.py[co]