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
10 %define snap 20060823.21
11 Summary: RPM packages management helper tool
12 Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
17 Group: Applications/System
18 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5: 71e595d47ccfd239180117ffc07c59c2
21 Source2: %{name}-multilib.conf
22 Source3: %{name}-aliases.conf
23 Patch1: %{name}-refcnt-overflow.patch
25 #PatchX: %{name}-etc_dir.patch
27 #PatchX: %{name}-retr_term.patch
28 Patch5: %{name}-vserver-packages.patch
29 Patch6: %{name}-config.patch
30 Patch7: %{name}-multilib.patch
31 URL: http://poldek.pld-linux.org/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: bzip2-devel
36 BuildRequires: db-devel >= %{ver_db}
37 BuildRequires: gettext-autopoint
38 BuildRequires: libtool
39 BuildRequires: libxml2-devel
40 BuildRequires: openssl-devel >= 0.9.7d
41 BuildRequires: pcre-devel
42 BuildRequires: perl-tools-pod
43 BuildRequires: popt-devel
44 %{?with_python:BuildRequires: python-devel}
45 BuildRequires: readline-devel >= 5.0
46 BuildRequires: rpm-devel >= %{ver_rpm}
48 BuildRequires: zlib-devel
50 BuildRequires: bzip2-static
51 BuildRequires: db-static >= %{ver_db}
52 BuildRequires: glibc-static
53 BuildRequires: libselinux-static
54 BuildRequires: libxml2-static
55 BuildRequires: ncurses-static
56 BuildRequires: openssl-static
57 BuildRequires: pcre-static
58 BuildRequires: popt-static
59 BuildRequires: readline-static
60 BuildRequires: rpm-static
61 BuildRequires: zlib-static
63 Requires(triggerpostun): awk
64 Requires(triggerpostun): sed >= 4.0
65 Requires: %{name}-libs = %{version}-%{release}
66 Requires: db >= %{ver_db}
67 Requires: rpm >= %{ver_rpm}
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 poldek is an RPM package management tool which allows you to easily
73 perform package verification, installation (including system
74 installation from scratch), upgrading, and removal.
76 Program can be used in batch (like apt-get from Debian's APT) or
77 interactive mode. The interactive mode puts you into a readline
78 interface with command line autocompletion and history, similar to the
79 shell mode of Perl's CPAN.
81 %{?with_static:This version is statically linked.}
83 %{!?with_imode:This version hasn't got interactive mode.}
87 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
88 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
91 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
92 interaktywnym. Tryb interaktywny posiada interfejs readline z
93 dope³nianiem komend i histori±, podobny do trybu shell perlowego
96 %{?with_static:Ta wersja jest konsolidowana statycznie.}
98 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
101 Summary: poldek libraries
102 Summary(pl): Biblioteki poldka
108 %description libs -l pl
112 Summary: Header files for poldek libraries
113 Summary(pl): Pliki nag³ówkowe bibliotek poldka
114 Group: Development/Libraries
115 Requires: %{name}-libs = %{version}-%{release}
118 Header files for poldek libraries.
120 %description devel -l pl
121 Pliki nag³ówkowe bibliotek poldka.
124 Summary: poldek static libraries
125 Summary(pl): Biblioteki statyczne poldka
126 Group: Development/Libraries
127 Requires: %{name}-devel = %{version}-%{release}
130 poldek static libraries.
132 %description static -l pl
133 Biblioteki statyczne poldka.
135 %package -n python-poldek
136 Summary: Python modules for poldek
137 Summary(pl): Modu³y jêzyka Python dla poldka
138 Group: Libraries/Python
139 Requires: %{name}-libs = %{version}-%{release}
140 %pyrequires_eq python-libs
142 %description -n python-poldek
143 Python modules for poldek.
145 %description -n python-poldek -l pl
146 Modu³y jêzyka Python dla poldka.
149 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
162 cp -f config.sub trurlib
165 %{?with_static:--enable-static --disable-shared} \
166 %{!?with_imode:--disable-imode} \
168 %{?with_python:--with-python}
172 rm -rf $RPM_BUILD_ROOT
173 install -d $RPM_BUILD_ROOT%{_sysconfdir}
176 DESTDIR=$RPM_BUILD_ROOT
179 %{__make} -C python install \
180 DESTDIR=$RPM_BUILD_ROOT \
184 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
186 %ifarch i486 i686 ppc sparc alpha athlon
187 %define _ftp_arch %{_target_cpu}
190 %define _ftp_arch x86_64
191 %define _ftp_alt_arch i686
194 %define _ftp_arch i486
196 %ifarch pentium2 pentium3 pentium4
197 %define _ftp_arch i686
199 %ifarch sparcv9 sparc64
200 %define _ftp_arch sparc
207 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
210 s|%%ARCH%%|%{_ftp_arch}|g
211 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
215 s|%%ARCH%%|%{_ftp_alt_arch}|g
216 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
219 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
221 # get rid of non-pld sources
222 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
223 # include them in %doc
226 rm -f configs/Makefile*
230 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
236 rm -rf $RPM_BUILD_ROOT
239 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
242 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
244 %post libs -p /sbin/ldconfig
245 %postun libs -p /sbin/ldconfig
247 %triggerpostun -- poldek <= 0.18.3-5
248 if [ -f /etc/poldek.conf ]; then
249 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
252 # otherwise don't touch
253 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
254 %triggerpostun -- poldek <= 0.18.7-1
255 if [ -f /etc/poldek.conf ]; then
256 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
260 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
261 if [ -f /etc/poldek.conf.rpmsave ]; then
270 if (sub(",noauto", "", name)) {
275 if (match(name, /,pri=[0-9]+/)) {
276 pri = substr(name, RSTART + 5, RLENGTH - 5);
277 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
280 # skip ac sources. already in new config.
281 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
284 print "name = " name;
285 print "type = " type;
286 print "path = " path;
287 print "auto = " auto;
288 print "autoup = " autoup;
294 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
295 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
298 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
300 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
304 %files -f %{name}.lang
305 %defattr(644,root,root,755)
306 %doc README* NEWS TODO configs/
307 %dir %{_sysconfdir}/%{name}
308 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
309 %attr(755,root,root) %{_bindir}/*
310 %dir %{_libdir}/%{name}
311 %attr(755,root,root) %{_libdir}/%{name}/*
312 %{_mandir}/man1/%{name}*
313 %lang(pl) %{_mandir}/pl/man1/%{name}*
314 %{_infodir}/poldek.info*
316 %if %{without static}
318 %defattr(644,root,root,755)
319 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
323 %defattr(644,root,root,755)
324 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
329 %defattr(644,root,root,755)
333 %files -n python-poldek
334 %defattr(644,root,root,755)
335 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
336 %{py_sitescriptdir}/poldek.py[co]
337 %{py_sitescriptdir}/poldekmod.py[co]