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 20050613.22
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: d529239d781c3d9e36577305d46d1a37
20 Source2: %{name}-multilib.conf
21 Patch0: %{name}-prereq.patch
22 Patch1: %{name}-endian.patch
23 URL: http://team.pld.org.pl/~mis/poldek/
24 BuildRequires: automake
25 BuildRequires: autoconf
26 BuildRequires: bzip2-devel
27 BuildRequires: db-devel >= %{ver_db}
28 BuildRequires: gettext-autopoint
29 BuildRequires: home-etc-devel
30 BuildRequires: libtool
31 BuildRequires: openssl-devel >= 0.9.7d
32 BuildRequires: pcre-devel
33 BuildRequires: perl-tools-pod
34 BuildRequires: popt-devel
35 BuildRequires: readline-devel
36 BuildRequires: rpm-devel >= %{ver_rpm}
37 BuildRequires: zlib-devel
39 BuildRequires: bzip2-static
40 BuildRequires: db-static >= %{ver_db}
41 BuildRequires: glibc-static
42 BuildRequires: libselinux-static
43 BuildRequires: ncurses-static
44 BuildRequires: openssl-static
45 BuildRequires: pcre-static
46 BuildRequires: popt-static
47 BuildRequires: readline-static
48 BuildRequires: rpm-static
49 BuildRequires: zlib-static
51 Requires(triggerpostun): sed >= 4.0
52 Requires(triggerpostun): awk
53 Requires: db >= %{ver_db}
54 Requires: openssl >= 0.9.7d
55 Requires: rpm >= %{ver_rpm}
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 poldek is an RPM package management tool which allows you to easily
61 perform package verification, installation (including system
62 installation from scratch), upgrading, and removal.
64 Program can be used in batch (like apt-get from Debian's APT) or
65 interactive mode. The interactive mode puts you into a readline
66 interface with command line autocompletion and history, similar to the
67 shell mode of Perl's CPAN.
69 %{?with_static:This version is statically linked.}
71 %{!?with_imode:This version hasn't got interactive mode.}
76 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
77 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
80 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
81 interaktywnym. Tryb interaktywny posiada interfejs readline z
82 dope³nianiem komend i histori±, podobny do trybu shell perlowego
85 %{?with_static:Ta wersja jest konsolidowana statycznie.}
87 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
90 Summary: poldek library
91 Summary(pl): Biblioteki poldka
97 %description libs -l pl
101 Summary: Header files for poldek libraries
102 Summary(pl): Pliki nag³ówkowe bibliotek poldka
103 Group: Development/Libraries
104 Requires: %{name}-libs = %{version}-%{release}
107 Header files for poldek libraries.
109 %description devel -l pl
110 Pliki nag³ówkowe bibliotek poldka.
113 Summary: poldek static libraries
114 Summary(pl): Biblioteki statyczne poldka
115 Group: Development/Libraries
116 Requires: %{name}-devel = %{version}-%{release}
119 poldek static libraries.
121 %description static -l pl
122 Biblioteki statyczne poldka.
125 %setup -q -n %{name}-%{version}-cvs%{snap}
134 cp -f config.sub trurlib
135 # glibc 2.3.5 workaround (to be removed when new snap come)
136 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
139 %{?with_static:--enable-static} \
140 %{!?with_imode:--disable-imode} \
145 rm -rf $RPM_BUILD_ROOT
146 install -d $RPM_BUILD_ROOT%{_sysconfdir}
149 DESTDIR=$RPM_BUILD_ROOT
151 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
154 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
156 %ifarch i386 i586 i686 ppc sparc alpha athlon
157 %define _ftp_arch %{_target_cpu}
160 %define _ftp_arch %{_target_cpu}
161 %define _ftp_alt_arch i686
164 %define _ftp_arch i386
166 %ifarch pentium2 pentium3 pentium4
167 %define _ftp_arch i686
169 %ifarch sparcv9 sparc64
170 %define _ftp_arch sparc
177 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
179 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
181 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
183 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
186 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
189 # get rid of non-pld sources
190 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
191 # include them in %doc
194 rm -f configs/Makefile*
199 rm -rf $RPM_BUILD_ROOT
202 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
205 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
207 %post libs -p /sbin/ldconfig
208 %postun libs -p /sbin/ldconfig
210 %triggerpostun -- poldek <= 0.18.3-5
211 if [ -f /etc/poldek.conf ]; then
212 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
215 # otherwise don't touch
216 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
217 %triggerpostun -- poldek <= 0.18.7-1
218 if [ -f /etc/poldek.conf ]; then
219 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
223 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
224 if [ -f /etc/poldek.conf.rpmsave ]; then
232 if (sub(",noauto", "", name)) {
236 # skip ac sources. already in new config.
237 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
239 print "name = " name;
240 print "type = " type;
241 print "path = " path;
242 print "auto = " auto;
243 print "autoup = " autoup;
247 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
248 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
250 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
251 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
252 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
256 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
258 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
262 %files -f %{name}.lang
263 %defattr(644,root,root,755)
264 %doc README* NEWS TODO configs/
265 %dir %{_sysconfdir}/%{name}
266 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
267 %attr(755,root,root) %{_bindir}/*
268 %dir %{_libdir}/%{name}
269 %attr(755,root,root) %{_libdir}/%{name}/*
270 %{_mandir}/man1/%{name}*
271 %lang(pl) %{_mandir}/pl/man1/%{name}*
272 %{_infodir}/poldek.info*
275 %defattr(644,root,root,755)
276 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
279 %defattr(644,root,root,755)
280 %attr(755,root,root) %{_libdir}/lib*.so
285 %defattr(644,root,root,755)