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 20051027.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: 68c37ed068b62ee7a98f4a942b0dcab9
20 Source2: %{name}-multilib.conf
21 Source3: %{name}-aliases.conf
22 URL: http://team.pld.org.pl/~mis/poldek/
23 BuildRequires: automake
24 BuildRequires: autoconf
25 BuildRequires: bzip2-devel
26 BuildRequires: db-devel >= %{ver_db}
28 BuildRequires: gettext-autopoint
29 BuildRequires: home-etc-devel
30 BuildRequires: libtool
31 BuildRequires: libxml2-devel
32 BuildRequires: openssl-devel >= 0.9.7d
33 BuildRequires: pcre-devel
34 BuildRequires: perl-tools-pod
35 BuildRequires: popt-devel
36 BuildRequires: readline-devel >= 5.0
37 BuildRequires: rpm-devel >= %{ver_rpm}
38 BuildRequires: zlib-devel
40 BuildRequires: bzip2-static
41 BuildRequires: db-static >= %{ver_db}
42 BuildRequires: glibc-static
43 BuildRequires: libselinux-static
44 BuildRequires: libxml2-static
45 BuildRequires: ncurses-static
46 BuildRequires: openssl-static
47 BuildRequires: pcre-static
48 BuildRequires: popt-static
49 BuildRequires: readline-static
50 BuildRequires: rpm-static
51 BuildRequires: zlib-static
53 Requires(triggerpostun): sed >= 4.0
54 Requires(triggerpostun): awk
55 Requires: %{name}-libs = %{version}-%{release}
56 Requires: db >= %{ver_db}
57 Requires: openssl >= 0.9.7d
58 Requires: rpm >= %{ver_rpm}
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63 poldek is an RPM package management tool which allows you to easily
64 perform package verification, installation (including system
65 installation from scratch), upgrading, and removal.
67 Program can be used in batch (like apt-get from Debian's APT) or
68 interactive mode. The interactive mode puts you into a readline
69 interface with command line autocompletion and history, similar to the
70 shell mode of Perl's CPAN.
72 %{?with_static:This version is statically linked.}
74 %{!?with_imode:This version hasn't got interactive mode.}
79 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
80 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
83 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
84 interaktywnym. Tryb interaktywny posiada interfejs readline z
85 dope³nianiem komend i histori±, podobny do trybu shell perlowego
88 %{?with_static:Ta wersja jest konsolidowana statycznie.}
90 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
94 Summary: poldek libraries
95 Summary(pl): Biblioteki poldka
101 %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}
137 cp -f config.sub trurlib
138 # glibc 2.3.5 workaround (to be removed when new snap come)
139 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
142 %{?with_static:--enable-static --disable-shared} \
143 %{!?with_imode:--disable-imode} \
148 rm -rf $RPM_BUILD_ROOT
149 install -d $RPM_BUILD_ROOT%{_sysconfdir}
152 DESTDIR=$RPM_BUILD_ROOT
154 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
157 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
159 %ifarch i386 i586 i686 ppc sparc alpha athlon
160 %define _ftp_arch %{_target_cpu}
163 %define _ftp_arch %{_target_cpu}
164 %define _ftp_alt_arch i686
167 %define _ftp_arch i386
169 %ifarch pentium2 pentium3 pentium4
170 %define _ftp_arch i686
172 %ifarch sparcv9 sparc64
173 %define _ftp_arch sparc
180 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
182 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
184 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
186 -e '/%%ALT_ARCH%%/d' \
188 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
191 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
194 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
196 # get rid of non-pld sources
197 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
198 # include them in %doc
201 rm -f configs/Makefile*
206 rm -rf $RPM_BUILD_ROOT
209 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
212 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
214 %if %{without static}
215 %post libs -p /sbin/ldconfig
216 %postun libs -p /sbin/ldconfig
219 %triggerpostun -- poldek <= 0.18.3-5
220 if [ -f /etc/poldek.conf ]; then
221 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
224 # otherwise don't touch
225 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
226 %triggerpostun -- poldek <= 0.18.7-1
227 if [ -f /etc/poldek.conf ]; then
228 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
232 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
233 if [ -f /etc/poldek.conf.rpmsave ]; then
241 if (sub(",noauto", "", name)) {
245 # skip ac sources. already in new config.
246 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
249 print "name = " name;
250 print "type = " type;
251 print "path = " path;
252 print "auto = " auto;
253 print "autoup = " autoup;
256 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
257 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
259 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
260 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
261 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
265 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
267 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
271 %files -f %{name}.lang
272 %defattr(644,root,root,755)
273 %doc README* NEWS TODO configs/
274 %dir %{_sysconfdir}/%{name}
275 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
276 %attr(755,root,root) %{_bindir}/*
277 %dir %{_libdir}/%{name}
278 %attr(755,root,root) %{_libdir}/%{name}/*
279 %{_mandir}/man1/%{name}*
280 %lang(pl) %{_mandir}/pl/man1/%{name}*
281 %{_infodir}/poldek.info*
283 %if %{without static}
285 %defattr(644,root,root,755)
286 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
290 %defattr(644,root,root,755)
291 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
296 %defattr(644,root,root,755)