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 URL: http://team.pld.org.pl/~mis/poldek/
23 BuildRequires: automake
24 BuildRequires: autoconf
25 BuildRequires: bzip2-devel
26 BuildRequires: db-devel >= %{ver_db}
27 BuildRequires: gettext-autopoint
28 BuildRequires: home-etc-devel
29 BuildRequires: libtool
30 BuildRequires: openssl-devel >= 0.9.7d
31 BuildRequires: pcre-devel
32 BuildRequires: perl-tools-pod
33 BuildRequires: popt-devel
34 BuildRequires: readline-devel
35 BuildRequires: rpm-devel >= %{ver_rpm}
36 BuildRequires: zlib-devel
38 BuildRequires: bzip2-static
39 BuildRequires: db-static >= %{ver_db}
40 BuildRequires: glibc-static
41 BuildRequires: libselinux-static
42 BuildRequires: ncurses-static
43 BuildRequires: openssl-static
44 BuildRequires: pcre-static
45 BuildRequires: popt-static
46 BuildRequires: readline-static
47 BuildRequires: rpm-static
48 BuildRequires: zlib-static
50 Requires(triggerpostun): sed >= 4.0
51 Requires(triggerpostun): awk
52 Requires: db >= %{ver_db}
53 Requires: openssl >= 0.9.7d
54 Requires: rpm >= %{ver_rpm}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59 poldek is an RPM package management tool which allows you to easily
60 perform package verification, installation (including system
61 installation from scratch), upgrading, and removal.
63 Program can be used in batch (like apt-get from Debian's APT) or
64 interactive mode. The interactive mode puts you into a readline
65 interface with command line autocompletion and history, similar to the
66 shell mode of Perl's CPAN.
68 %{?with_static:This version is statically linked.}
70 %{!?with_imode:This version hasn't got interactive mode.}
75 poldek jest narzêdziem linii poleceñ s³u¿±cym do weryfikacji,
76 instalacji (w³±czaj±c instalacjê systemu od zera), aktualizacji i
79 Program mo¿e byæ u¿ywany w trybie wsadowym (jak debianowy apt-get) lub
80 interaktywnym. Tryb interaktywny posiada interfejs readline z
81 dope³nianiem komend i histori±, podobny do trybu shell perlowego
84 %{?with_static:Ta wersja jest konsolidowana statycznie.}
86 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
89 Summary: poldek library
90 Summary(pl): Biblioteki poldka
96 %description libs -l pl
100 Summary: Header files for poldek libraries
101 Summary(pl): Pliki nag³ówkowe bibliotek poldka
102 Group: Development/Libraries
103 Requires: %{name}-libs = %{version}-%{release}
106 Header files for poldek libraries.
108 %description devel -l pl
109 Pliki nag³ówkowe bibliotek poldka.
112 Summary: poldek static libraries
113 Summary(pl): Biblioteki statyczne poldka
114 Group: Development/Libraries
115 Requires: %{name}-devel = %{version}-%{release}
118 poldek static libraries.
120 %description static -l pl
121 Biblioteki statyczne poldka.
124 %setup -q -n %{name}-%{version}-cvs%{snap}
132 cp -f config.sub trurlib
133 # glibc 2.3.5 workaround (to be removed when new snap come)
134 perl -pi -e 's|HAVE_FOPENCOOKIE|HAVE_FOPENCOOKIE_XXX|g' trurlib/nstream.c
137 %{?with_static:--enable-static} \
138 %{!?with_imode:--disable-imode} \
143 rm -rf $RPM_BUILD_ROOT
144 install -d $RPM_BUILD_ROOT%{_sysconfdir}
147 DESTDIR=$RPM_BUILD_ROOT
149 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
152 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
154 %ifarch i386 i586 i686 ppc sparc alpha athlon
155 %define _ftp_arch %{_target_cpu}
158 %define _ftp_arch %{_target_cpu}
159 %define _ftp_alt_arch i686
162 %define _ftp_arch i386
164 %ifarch pentium2 pentium3 pentium4
165 %define _ftp_arch i686
167 %ifarch sparcv9 sparc64
168 %define _ftp_arch sparc
175 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
177 sed -e "s|%%ARCH%%|%{_ftp_arch}|g" \
179 -e "s|%%ALT_ARCH%%|%{_ftp_alt_arch}|g" \
181 < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
184 sed "s|%%ARCH%%|%{_ftp_alt_arch}|g" < %{SOURCE2} >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
187 # get rid of non-pld sources
188 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
189 # include them in %doc
192 rm -f configs/Makefile*
197 rm -rf $RPM_BUILD_ROOT
200 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
203 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
205 %post libs -p /sbin/ldconfig
206 %postun libs -p /sbin/ldconfig
208 %triggerpostun -- poldek <= 0.18.3-5
209 if [ -f /etc/poldek.conf ]; then
210 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
213 # otherwise don't touch
214 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
215 %triggerpostun -- poldek <= 0.18.7-1
216 if [ -f /etc/poldek.conf ]; then
217 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
221 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
222 if [ -f /etc/poldek.conf.rpmsave ]; then
230 if (sub(",noauto", "", name)) {
234 # skip ac sources. already in new config.
235 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
237 print "name = " name;
238 print "type = " type;
239 print "path = " path;
240 print "auto = " auto;
241 print "autoup = " autoup;
245 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
246 echo "Converted old custom sources (non-ac dist ones) from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
248 # propagate use_sudo to new config. only works for untouched poldek.conf and that's intentional.
249 if grep -q '^use_sudo.*=.*yes' /etc/poldek.conf.rpmsave; then
250 sed -i -e '/^#use sudo = no/s/^.*/use sudo = yes/' /etc/poldek/poldek.conf
254 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
256 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
260 %files -f %{name}.lang
261 %defattr(644,root,root,755)
262 %doc README* NEWS TODO configs/
263 %dir %{_sysconfdir}/%{name}
264 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}/*.conf
265 %attr(755,root,root) %{_bindir}/*
266 %dir %{_libdir}/%{name}
267 %attr(755,root,root) %{_libdir}/%{name}/*
268 %{_mandir}/man1/%{name}*
269 %lang(pl) %{_mandir}/pl/man1/%{name}*
270 %{_infodir}/poldek.info*
273 %defattr(644,root,root,755)
274 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
277 %defattr(644,root,root,755)
278 %attr(755,root,root) %{_libdir}/lib*.so
283 %defattr(644,root,root,755)