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 URL: http://team.pld.org.pl/~mis/poldek/
25 BuildRequires: automake
26 BuildRequires: autoconf
27 BuildRequires: bzip2-devel
28 BuildRequires: db-devel >= %{ver_db}
30 BuildRequires: gettext-autopoint
31 BuildRequires: home-etc-devel
32 BuildRequires: libtool
33 BuildRequires: libxml2-devel
34 BuildRequires: openssl-devel >= 0.9.7d
35 BuildRequires: pcre-devel
36 BuildRequires: perl-tools-pod
37 BuildRequires: popt-devel
38 BuildRequires: readline-devel >= 5.0
39 BuildRequires: rpm-devel >= %{ver_rpm}
40 BuildRequires: zlib-devel
42 BuildRequires: bzip2-static
43 BuildRequires: db-static >= %{ver_db}
44 BuildRequires: glibc-static
45 BuildRequires: libselinux-static
46 BuildRequires: ncurses-static
47 BuildRequires: openssl-static
48 BuildRequires: pcre-static
49 BuildRequires: popt-static
50 BuildRequires: readline-static
51 BuildRequires: rpm-static
52 BuildRequires: zlib-static
54 Requires(triggerpostun): sed >= 4.0
55 Requires(triggerpostun): awk
56 Requires: %{name}-libs = %{version}-%{release}
57 Requires: db >= %{ver_db}
58 Requires: openssl >= 0.9.7d
59 Requires: rpm >= %{ver_rpm}
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 poldek is an RPM package management tool which allows you to easily
65 perform package verification, installation (including system
66 installation from scratch), upgrading, and removal.
68 Program can be used in batch (like apt-get from Debian's APT) or
69 interactive mode. The interactive mode puts you into a readline
70 interface with command line autocompletion and history, similar to the
71 shell mode of Perl's CPAN.
73 %{?with_static:This version is statically linked.}
75 %{!?with_imode:This version hasn't got interactive mode.}
80 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
81 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
84 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
85 interaktywnym. Tryb interaktywny posiada interfejs readline z
86 dope³nianiem komend i histori±, podobny do trybu shell perlowego
89 %{?with_static:Ta wersja jest konsolidowana statycznie.}
91 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
94 Summary: poldek libraries
95 Summary(pl): Biblioteki poldka
101 %description libs -l pl
105 Summary: Header files for poldek libraries
106 Summary(pl): Pliki nag³ówkowe bibliotek poldka
107 Group: Development/Libraries
108 Requires: %{name}-libs = %{version}-%{release}
111 Header files for poldek libraries.
113 %description devel -l pl
114 Pliki nag³ówkowe bibliotek poldka.
117 Summary: poldek static libraries
118 Summary(pl): Biblioteki statyczne poldka
119 Group: Development/Libraries
120 Requires: %{name}-devel = %{version}-%{release}
123 poldek static libraries.
125 %description static -l pl
126 Biblioteki statyczne poldka.
129 %setup -q -n %{name}-%{version}-cvs%{snap}
138 cp -f config.sub trurlib
139 # glibc 2.3.5 workaround (to be removed when new snap come)
140 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
143 %{?with_static:--enable-static} \
144 %{!?with_imode:--disable-imode} \
149 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT%{_sysconfdir}
153 DESTDIR=$RPM_BUILD_ROOT
155 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
158 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
160 %ifarch i386 i586 i686 ppc sparc alpha athlon
161 %define _ftp_arch %{_target_cpu}
164 %define _ftp_arch %{_target_cpu}
165 %define _ftp_alt_arch i686
168 %define _ftp_arch i386
170 %ifarch pentium2 pentium3 pentium4
171 %define _ftp_arch i686
173 %ifarch sparcv9 sparc64
174 %define _ftp_arch sparc
181 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
183 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
185 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
187 -e '/%%ALT_ARCH%%/d' \
189 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
192 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
195 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
197 # get rid of non-pld sources
198 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
199 # include them in %doc
202 rm -f configs/Makefile*
207 rm -rf $RPM_BUILD_ROOT
210 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
213 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
215 %post libs -p /sbin/ldconfig
216 %postun libs -p /sbin/ldconfig
218 %triggerpostun -- poldek <= 0.18.3-5
219 if [ -f /etc/poldek.conf ]; then
220 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
223 # otherwise don't touch
224 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
225 %triggerpostun -- poldek <= 0.18.7-1
226 if [ -f /etc/poldek.conf ]; then
227 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
231 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
232 if [ -f /etc/poldek.conf.rpmsave ]; then
240 if (sub(",noauto", "", name)) {
244 # skip ac sources. already in new config.
245 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
248 print "name = " name;
249 print "type = " type;
250 print "path = " path;
251 print "auto = " auto;
252 print "autoup = " autoup;
255 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
256 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
258 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
259 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
260 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
264 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
266 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
270 %files -f %{name}.lang
271 %defattr(644,root,root,755)
272 %doc README* NEWS TODO configs/
273 %dir %{_sysconfdir}/%{name}
274 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
275 %attr(755,root,root) %{_bindir}/*
276 %dir %{_libdir}/%{name}
277 %attr(755,root,root) %{_libdir}/%{name}/*
278 %{_mandir}/man1/%{name}*
279 %lang(pl) %{_mandir}/pl/man1/%{name}*
280 %{_infodir}/poldek.info*
283 %defattr(644,root,root,755)
284 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
287 %defattr(644,root,root,755)
288 %attr(755,root,root) %{_libdir}/lib*.so
293 %defattr(644,root,root,755)