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 Patch3: %{name}-compare.patch
26 Patch4: %{name}-split64.patch
27 URL: http://team.pld.org.pl/~mis/poldek/
28 BuildRequires: automake
29 BuildRequires: autoconf
30 BuildRequires: bzip2-devel
31 BuildRequires: db-devel >= %{ver_db}
33 BuildRequires: gettext-autopoint
34 BuildRequires: home-etc-devel
35 BuildRequires: libtool
36 BuildRequires: libxml2-devel
37 BuildRequires: openssl-devel >= 0.9.7d
38 BuildRequires: pcre-devel
39 BuildRequires: perl-tools-pod
40 BuildRequires: popt-devel
41 BuildRequires: readline-devel >= 5.0
42 BuildRequires: rpm-devel >= %{ver_rpm}
43 BuildRequires: zlib-devel
45 BuildRequires: bzip2-static
46 BuildRequires: db-static >= %{ver_db}
47 BuildRequires: glibc-static
48 BuildRequires: libselinux-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.
132 %setup -q -n %{name}-%{version}-cvs%{snap}
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} \
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*
289 %defattr(644,root,root,755)
290 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
293 %defattr(644,root,root,755)
294 %attr(755,root,root) %{_libdir}/lib*.so
299 %defattr(644,root,root,755)