3 %bcond_with static # don't use shared libraries
4 %bcond_without imode # don't build interactive mode
6 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
7 %define ver_db 4.2.50-1
9 Summary: RPM packages management helper tool
10 Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
15 Group: Applications/System
16 Source0: http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2
17 # Source0-md5: 61c0c03ee4a9de36339fc943b6901266
19 Source2: %{name}-multilib.conf
20 Source3: %{name}-aliases.conf
21 Patch0: http://cvs.pld.org.pl/installer/poldek/pkgset-install.c?r1=1.147&r2=1.148
22 Patch1: http://cvs.pld.org.pl/installer/poldek/vfile/misc.c?r1=1.11&r2=1.12
23 Patch2: http://cvs.pld.org.pl/installer/poldek/vfile/extcompr.c?r1=1.7&r2=1.8
24 Patch3: %{name}-ask-abort.patch
25 Patch4: http://cvs.pld.org.pl/installer/poldek/vfcompr?r1=1.4&r2=1.6
26 URL: http://team.pld.org.pl/~mis/poldek/
27 BuildRequires: automake
28 BuildRequires: autoconf
29 BuildRequires: bzip2-devel
31 BuildRequires: db-devel >= %{ver_db}
32 BuildRequires: gettext-autopoint
33 BuildRequires: home-etc-devel
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: popt-devel
40 BuildRequires: readline-devel >= 5.0
41 BuildRequires: rpm-devel >= %{ver_rpm}
42 BuildRequires: zlib-devel
44 BuildRequires: bzip2-static
45 BuildRequires: db-static >= %{ver_db}
46 BuildRequires: glibc-static
47 BuildRequires: libselinux-static
48 BuildRequires: libxml2-static
49 BuildRequires: ncurses-static
50 BuildRequires: openssl-static
51 BuildRequires: pcre-static
52 BuildRequires: popt-static
53 BuildRequires: readline-static
54 BuildRequires: rpm-static
55 BuildRequires: zlib-static
57 Requires(triggerpostun): sed >= 4.0
58 Requires(triggerpostun): awk
59 Requires: %{name}-libs = %{version}-%{release}
60 Requires: db >= %{ver_db}
61 Requires: openssl >= 0.9.7d
62 Requires: rpm >= %{ver_rpm}
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 poldek is an RPM package management tool which allows you to easily
68 perform package verification, installation (including system
69 installation from scratch), upgrading, and removal.
71 Program can be used in batch (like apt-get from Debian's APT) or
72 interactive mode. The interactive mode puts you into a readline
73 interface with command line autocompletion and history, similar to the
74 shell mode of Perl's CPAN.
76 %{?with_static:This version is statically linked.}
78 %{!?with_imode:This version hasn't got interactive mode.}
83 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
84 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
87 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
88 interaktywnym. Tryb interaktywny posiada interfejs readline z
89 dope³nianiem komend i histori±, podobny do trybu shell perlowego
92 %{?with_static:Ta wersja jest konsolidowana statycznie.}
94 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
97 Summary: poldek libraries
98 Summary(pl): Biblioteki poldka
104 %description libs -l pl
108 Summary: Header files for poldek libraries
109 Summary(pl): Pliki nag³ówkowe bibliotek poldka
110 Group: Development/Libraries
111 Requires: %{name}-libs = %{version}-%{release}
114 Header files for poldek libraries.
116 %description devel -l pl
117 Pliki nag³ówkowe bibliotek poldka.
120 Summary: poldek static libraries
121 Summary(pl): Biblioteki statyczne poldka
122 Group: Development/Libraries
123 Requires: %{name}-devel = %{version}-%{release}
126 poldek static libraries.
128 %description static -l pl
129 Biblioteki statyczne poldka.
144 cp -f config.sub trurlib
145 # glibc 2.3.5 workaround (to be removed when new snap come)
146 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
149 %{?with_static:--enable-static --disable-shared} \
150 %{!?with_imode:--disable-imode} \
155 rm -rf $RPM_BUILD_ROOT
156 install -d $RPM_BUILD_ROOT%{_sysconfdir}
159 DESTDIR=$RPM_BUILD_ROOT
161 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
164 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
166 %ifarch i386 i586 i686 ppc sparc alpha athlon
167 %define _ftp_arch %{_target_cpu}
170 %define _ftp_arch %{_target_cpu}
171 %define _ftp_alt_arch i686
174 %define _ftp_arch i386
176 %ifarch pentium2 pentium3 pentium4
177 %define _ftp_arch i686
179 %ifarch sparcv9 sparc64
180 %define _ftp_arch sparc
187 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
189 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
191 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
193 -e '/%%ALT_ARCH%%/d' \
195 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
198 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
201 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
203 # get rid of non-pld sources
204 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
205 # include them in %doc
208 rm -f configs/Makefile*
213 rm -rf $RPM_BUILD_ROOT
216 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
219 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
221 %post libs -p /sbin/ldconfig
222 %postun libs -p /sbin/ldconfig
224 %triggerpostun -- poldek <= 0.18.3-5
225 if [ -f /etc/poldek.conf ]; then
226 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
229 # otherwise don't touch
230 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
231 %triggerpostun -- poldek <= 0.18.7-1
232 if [ -f /etc/poldek.conf ]; then
233 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
237 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
238 if [ -f /etc/poldek.conf.rpmsave ]; then
246 if (sub(",noauto", "", name)) {
250 # skip ac sources. already in new config.
251 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
254 print "name = " name;
255 print "type = " type;
256 print "path = " path;
257 print "auto = " auto;
258 print "autoup = " autoup;
261 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
262 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
264 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
265 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
266 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
270 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
272 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
276 %files -f %{name}.lang
277 %defattr(644,root,root,755)
278 %doc README* NEWS TODO configs/
279 %dir %{_sysconfdir}/%{name}
280 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
281 %attr(755,root,root) %{_bindir}/*
282 %dir %{_libdir}/%{name}
283 %attr(755,root,root) %{_libdir}/%{name}/*
284 %{_mandir}/man1/%{name}*
285 %lang(pl) %{_mandir}/pl/man1/%{name}*
286 %{_infodir}/poldek.info*
288 %if %{without static}
290 %defattr(644,root,root,755)
291 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
295 %defattr(644,root,root,755)
296 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
301 %defattr(644,root,root,755)