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 Summary: RPM packages management helper tool
11 Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
16 Group: Applications/System
17 Source0: http://poldek.pld-linux.org/download/%{name}-%{version}.tar.bz2
18 # Source0-md5: 61c0c03ee4a9de36339fc943b6901266
20 Source2: %{name}-multilib.conf
21 Source3: %{name}-aliases.conf
23 #PatchX: %{name}-etc_dir.patch
25 #PatchX: %{name}-retr_term.patch
27 #Patch2: %{name}-simplestatic.patch
28 Patch0: %{name}-20060726cvs.patch
29 Patch2: %{name}-obsoletes.patch
30 Patch5: %{name}-vserver-packages.patch
31 Patch6: %{name}-config.patch
32 Patch7: %{name}-multilib.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: popt-devel
46 %{?with_python:BuildRequires: python-devel}
47 BuildRequires: readline-devel >= 5.0
48 BuildRequires: rpm-devel >= %{ver_rpm}
50 BuildRequires: zlib-devel
52 BuildRequires: bzip2-static
53 BuildRequires: db-static >= %{ver_db}
54 BuildRequires: glibc-static
55 BuildRequires: libselinux-static
56 BuildRequires: libxml2-static
57 BuildRequires: ncurses-static
58 BuildRequires: openssl-static
59 BuildRequires: pcre-static
60 BuildRequires: popt-static
61 BuildRequires: readline-static
62 BuildRequires: rpm-static
63 BuildRequires: zlib-static
65 Requires(triggerpostun): awk
66 Requires(triggerpostun): sed >= 4.0
67 Requires: %{name}-libs = %{version}-%{release}
68 Requires: db >= %{ver_db}
69 Requires: rpm >= %{ver_rpm}
71 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 poldek is an RPM package management tool which allows you to easily
75 perform package verification, installation (including system
76 installation from scratch), upgrading, and removal.
78 Program can be used in batch (like apt-get from Debian's APT) or
79 interactive mode. The interactive mode puts you into a readline
80 interface with command line autocompletion and history, similar to the
81 shell mode of Perl's CPAN.
83 %{?with_static:This version is statically linked.}
85 %{!?with_imode:This version hasn't got interactive mode.}
89 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
90 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
93 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
94 interaktywnym. Tryb interaktywny posiada interfejs readline z
95 dope³nianiem komend i histori±, podobny do trybu shell perlowego
98 %{?with_static:Ta wersja jest konsolidowana statycznie.}
100 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
103 Summary: poldek libraries
104 Summary(pl): Biblioteki poldka
110 %description libs -l pl
114 Summary: Header files for poldek libraries
115 Summary(pl): Pliki nag³ówkowe bibliotek poldka
116 Group: Development/Libraries
117 Requires: %{name}-libs = %{version}-%{release}
120 Header files for poldek libraries.
122 %description devel -l pl
123 Pliki nag³ówkowe bibliotek poldka.
126 Summary: poldek static libraries
127 Summary(pl): Biblioteki statyczne poldka
128 Group: Development/Libraries
129 Requires: %{name}-devel = %{version}-%{release}
132 poldek static libraries.
134 %description static -l pl
135 Biblioteki statyczne poldka.
137 %package -n python-poldek
138 Summary: Python modules for poldek
139 Summary(pl): Modu³y jêzyka Python dla poldka
140 Group: Libraries/Python
141 Requires: %{name}-libs = %{version}-%{release}
142 %pyrequires_eq python-libs
144 %description -n python-poldek
145 Python modules for poldek.
147 %description -n python-poldek -l pl
148 Modu³y jêzyka Python dla poldka.
165 cp -f config.sub trurlib
168 %{?with_static:--enable-static --disable-shared} \
169 %{!?with_imode:--disable-imode} \
171 %{?with_python:--with-python}
175 rm -rf $RPM_BUILD_ROOT
176 install -d $RPM_BUILD_ROOT%{_sysconfdir}
179 DESTDIR=$RPM_BUILD_ROOT
182 %{__make} -C python install \
183 DESTDIR=$RPM_BUILD_ROOT \
187 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
189 %ifarch i486 i686 ppc sparc alpha athlon
190 %define _ftp_arch %{_target_cpu}
193 %define _ftp_arch x86_64
194 %define _ftp_alt_arch i686
197 %define _ftp_arch i486
199 %ifarch pentium2 pentium3 pentium4
200 %define _ftp_arch i686
202 %ifarch sparcv9 sparc64
203 %define _ftp_arch sparc
210 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
213 s|%%ARCH%%|%{_ftp_arch}|g
214 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
218 s|%%ARCH%%|%{_ftp_alt_arch}|g
219 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
222 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
224 # get rid of non-pld sources
225 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
226 # include them in %doc
229 rm -f configs/Makefile*
233 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
239 rm -rf $RPM_BUILD_ROOT
242 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
245 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
247 %post libs -p /sbin/ldconfig
248 %postun libs -p /sbin/ldconfig
250 %triggerpostun -- poldek <= 0.18.3-5
251 if [ -f /etc/poldek.conf ]; then
252 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
255 # otherwise don't touch
256 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
257 %triggerpostun -- poldek <= 0.18.7-1
258 if [ -f /etc/poldek.conf ]; then
259 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
263 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
264 if [ -f /etc/poldek.conf.rpmsave ]; then
273 if (sub(",noauto", "", name)) {
278 if (match(name, /,pri=[0-9]+/)) {
279 pri = substr(name, RSTART + 5, RLENGTH - 5);
280 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
283 # skip ac sources. already in new config.
284 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
287 print "name = " name;
288 print "type = " type;
289 print "path = " path;
290 print "auto = " auto;
291 print "autoup = " autoup;
297 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
298 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
301 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
303 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
307 %files -f %{name}.lang
308 %defattr(644,root,root,755)
309 %doc README* NEWS TODO configs/
310 %dir %{_sysconfdir}/%{name}
311 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
312 %attr(755,root,root) %{_bindir}/*
313 %dir %{_libdir}/%{name}
314 %attr(755,root,root) %{_libdir}/%{name}/*
315 %{_mandir}/man1/%{name}*
316 %lang(pl) %{_mandir}/pl/man1/%{name}*
317 %{_infodir}/poldek.info*
319 %if %{without static}
321 %defattr(644,root,root,755)
322 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
326 %defattr(644,root,root,755)
327 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
332 %defattr(644,root,root,755)
336 %files -n python-poldek
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
339 %{py_sitescriptdir}/poldek.py[co]
340 %{py_sitescriptdir}/poldekmod.py[co]