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 %define snap 20050921.00
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://team.pld.org.pl/~mis/poldek/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
18 # Source0-md5: 50c7135af609a874103a9dacdaf76b2b
20 Source2: %{name}-multilib.conf
21 Source3: %{name}-aliases.conf
22 Patch0: %{name}-prereq.patch
23 Patch1: %{name}-configure.patch
24 Patch2: %{name}-nodebug.patch
25 URL: http://team.pld.org.pl/~mis/poldek/
26 BuildRequires: automake
27 BuildRequires: autoconf
28 BuildRequires: bzip2-devel
29 BuildRequires: db-devel >= %{ver_db}
31 BuildRequires: gettext-autopoint
32 BuildRequires: home-etc-devel
33 BuildRequires: libtool
34 BuildRequires: libxml2-devel
35 BuildRequires: openssl-devel >= 0.9.7d
36 BuildRequires: pcre-devel
37 BuildRequires: perl-tools-pod
38 BuildRequires: popt-devel
39 BuildRequires: readline-devel >= 5.0
40 BuildRequires: rpm-devel >= %{ver_rpm}
41 BuildRequires: zlib-devel
43 BuildRequires: bzip2-static
44 BuildRequires: db-static >= %{ver_db}
45 BuildRequires: glibc-static
46 BuildRequires: libselinux-static
47 BuildRequires: ncurses-static
48 BuildRequires: openssl-static
49 BuildRequires: pcre-static
50 BuildRequires: popt-static
51 BuildRequires: readline-static
52 BuildRequires: rpm-static
53 BuildRequires: zlib-static
55 Requires(triggerpostun): sed >= 4.0
56 Requires(triggerpostun): awk
57 Requires: %{name}-libs = %{version}-%{release}
58 Requires: db >= %{ver_db}
59 Requires: openssl >= 0.9.7d
60 Requires: rpm >= %{ver_rpm}
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 poldek is an RPM package management tool which allows you to easily
66 perform package verification, installation (including system
67 installation from scratch), upgrading, and removal.
69 Program can be used in batch (like apt-get from Debian's APT) or
70 interactive mode. The interactive mode puts you into a readline
71 interface with command line autocompletion and history, similar to the
72 shell mode of Perl's CPAN.
74 %{?with_static:This version is statically linked.}
76 %{!?with_imode:This version hasn't got interactive mode.}
81 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
82 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
85 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
86 interaktywnym. Tryb interaktywny posiada interfejs readline z
87 dope³nianiem komend i histori±, podobny do trybu shell perlowego
90 %{?with_static:Ta wersja jest konsolidowana statycznie.}
92 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
95 Summary: poldek libraries
96 Summary(pl): Biblioteki poldka
102 %description libs -l pl
106 Summary: Header files for poldek libraries
107 Summary(pl): Pliki nag³ówkowe bibliotek poldka
108 Group: Development/Libraries
109 Requires: %{name}-libs = %{version}-%{release}
112 Header files for poldek libraries.
114 %description devel -l pl
115 Pliki nag³ówkowe bibliotek poldka.
118 Summary: poldek static libraries
119 Summary(pl): Biblioteki statyczne poldka
120 Group: Development/Libraries
121 Requires: %{name}-devel = %{version}-%{release}
124 poldek static libraries.
126 %description static -l pl
127 Biblioteki statyczne poldka.
130 %setup -q -n %{name}-%{version}-cvs%{snap}
140 cp -f config.sub trurlib
141 # glibc 2.3.5 workaround (to be removed when new snap come)
142 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
145 %{?with_static:--enable-static} \
146 %{!?with_imode:--disable-imode} \
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT%{_sysconfdir}
155 DESTDIR=$RPM_BUILD_ROOT
157 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
160 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
162 %ifarch i386 i586 i686 ppc sparc alpha athlon
163 %define _ftp_arch %{_target_cpu}
166 %define _ftp_arch %{_target_cpu}
167 %define _ftp_alt_arch i686
170 %define _ftp_arch i386
172 %ifarch pentium2 pentium3 pentium4
173 %define _ftp_arch i686
175 %ifarch sparcv9 sparc64
176 %define _ftp_arch sparc
183 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
185 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
187 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
189 -e '/%%ALT_ARCH%%/d' \
191 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
194 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
197 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
199 # get rid of non-pld sources
200 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
201 # include them in %doc
204 rm -f configs/Makefile*
209 rm -rf $RPM_BUILD_ROOT
212 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
215 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
217 %post libs -p /sbin/ldconfig
218 %postun libs -p /sbin/ldconfig
220 %triggerpostun -- poldek <= 0.18.3-5
221 if [ -f /etc/poldek.conf ]; then
222 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
225 # otherwise don't touch
226 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
227 %triggerpostun -- poldek <= 0.18.7-1
228 if [ -f /etc/poldek.conf ]; then
229 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
233 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
234 if [ -f /etc/poldek.conf.rpmsave ]; then
242 if (sub(",noauto", "", name)) {
246 # skip ac sources. already in new config.
247 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
250 print "name = " name;
251 print "type = " type;
252 print "path = " path;
253 print "auto = " auto;
254 print "autoup = " autoup;
257 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
258 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
260 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
261 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
262 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
266 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
268 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
272 %files -f %{name}.lang
273 %defattr(644,root,root,755)
274 %doc README* NEWS TODO configs/
275 %dir %{_sysconfdir}/%{name}
276 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
277 %attr(755,root,root) %{_bindir}/*
278 %dir %{_libdir}/%{name}
279 %attr(755,root,root) %{_libdir}/%{name}/*
280 %{_mandir}/man1/%{name}*
281 %lang(pl) %{_mandir}/pl/man1/%{name}*
282 %{_infodir}/poldek.info*
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_libdir}/lib*.so
295 %defattr(644,root,root,755)