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.3.27-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
22 #PatchX: %{name}-etc_dir.patch
24 #PatchX: %{name}-retr_term.patch
26 #Patch2: %{name}-simplestatic.patch
27 URL: http://team.pld.org.pl/~mis/poldek/
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: 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: rpm >= %{ver_rpm}
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 poldek is an RPM package management tool which allows you to easily
67 perform package verification, installation (including system
68 installation from scratch), upgrading, and removal.
70 Program can be used in batch (like apt-get from Debian's APT) or
71 interactive mode. The interactive mode puts you into a readline
72 interface with command line autocompletion and history, similar to the
73 shell mode of Perl's CPAN.
75 %{?with_static:This version is statically linked.}
77 %{!?with_imode:This version hasn't got interactive mode.}
82 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
83 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
86 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
87 interaktywnym. Tryb interaktywny posiada interfejs readline z
88 dope³nianiem komend i histori±, podobny do trybu shell perlowego
91 %{?with_static:Ta wersja jest konsolidowana statycznie.}
93 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
96 Summary: poldek libraries
97 Summary(pl): Biblioteki poldka
103 %description libs -l pl
107 Summary: Header files for poldek libraries
108 Summary(pl): Pliki nag³ówkowe bibliotek poldka
109 Group: Development/Libraries
110 Requires: %{name}-libs = %{version}-%{release}
113 Header files for poldek libraries.
115 %description devel -l pl
116 Pliki nag³ówkowe bibliotek poldka.
119 Summary: poldek static libraries
120 Summary(pl): Biblioteki statyczne poldka
121 Group: Development/Libraries
122 Requires: %{name}-devel = %{version}-%{release}
125 poldek static libraries.
127 %description static -l pl
128 Biblioteki statyczne poldka.
138 cp -f config.sub trurlib
141 %{?with_static:--enable-static --disable-shared} \
142 %{!?with_imode:--disable-imode} \
147 rm -rf $RPM_BUILD_ROOT
148 install -d $RPM_BUILD_ROOT%{_sysconfdir}
151 DESTDIR=$RPM_BUILD_ROOT
153 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
156 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
158 %ifarch i386 i586 i686 ppc sparc alpha athlon
159 %define _ftp_arch %{_target_cpu}
162 %define _ftp_arch %{_target_cpu}
163 %define _ftp_alt_arch i686
166 %define _ftp_arch i386
168 %ifarch pentium2 pentium3 pentium4
169 %define _ftp_arch i686
171 %ifarch sparcv9 sparc64
172 %define _ftp_arch sparc
179 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
181 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
183 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
185 -e '/%%ALT_ARCH%%/d' \
187 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
190 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
193 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
195 # get rid of non-pld sources
196 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
197 # include them in %doc
200 rm -f configs/Makefile*
205 rm -rf $RPM_BUILD_ROOT
208 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
211 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
213 %post libs -p /sbin/ldconfig
214 %postun libs -p /sbin/ldconfig
216 %triggerpostun -- poldek <= 0.18.3-5
217 if [ -f /etc/poldek.conf ]; then
218 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
221 # otherwise don't touch
222 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
223 %triggerpostun -- poldek <= 0.18.7-1
224 if [ -f /etc/poldek.conf ]; then
225 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
229 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
230 if [ -f /etc/poldek.conf.rpmsave ]; then
238 if (sub(",noauto", "", name)) {
242 # skip ac sources. already in new config.
243 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
246 print "name = " name;
247 print "type = " type;
248 print "path = " path;
249 print "auto = " auto;
250 print "autoup = " autoup;
253 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
254 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
256 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
257 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
258 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
262 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
264 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
268 %files -f %{name}.lang
269 %defattr(644,root,root,755)
270 %doc README* NEWS TODO configs/
271 %dir %{_sysconfdir}/%{name}
272 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
273 %attr(755,root,root) %{_bindir}/*
274 %dir %{_libdir}/%{name}
275 %attr(755,root,root) %{_libdir}/%{name}/*
276 %{_mandir}/man1/%{name}*
277 %lang(pl) %{_mandir}/pl/man1/%{name}*
278 %{_infodir}/poldek.info*
280 %if %{without static}
282 %defattr(644,root,root,755)
283 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
287 %defattr(644,root,root,755)
288 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
293 %defattr(644,root,root,755)