3 %bcond_with static # don't use shared libraries
4 %bcond_without imode # don't build interactive mode
5 %bcond_without python # don't build python bindings
7 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
8 %define ver_db 4.3.27-1
10 %define snap 20060823.21
11 Summary: RPM packages management helper tool
12 Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
17 Group: Applications/System
18 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5: 71e595d47ccfd239180117ffc07c59c2
21 Source2: %{name}-multilib.conf
22 Source3: %{name}-aliases.conf
23 Patch1: %{name}-vserver-packages.patch
24 Patch2: %{name}-config.patch
25 Patch3: %{name}-multilib.patch
26 Patch4: %{name}-cvs20070105.patch
27 URL: http://poldek.pld-linux.org/
28 BuildRequires: autoconf
29 BuildRequires: automake
30 BuildRequires: bzip2-devel
32 BuildRequires: db-devel >= %{ver_db}
33 BuildRequires: gettext-autopoint
34 BuildRequires: libtool
35 BuildRequires: libxml2-devel
36 BuildRequires: openssl-devel >= 0.9.7d
37 BuildRequires: pcre-devel
38 BuildRequires: perl-tools-pod
39 BuildRequires: popt-devel
40 %{?with_python:BuildRequires: python-devel}
41 BuildRequires: readline-devel >= 5.0
42 BuildRequires: rpm-devel >= %{ver_rpm}
44 BuildRequires: zlib-devel
46 BuildRequires: bzip2-static
47 BuildRequires: db-static >= %{ver_db}
48 BuildRequires: glibc-static
49 BuildRequires: libselinux-static
50 BuildRequires: libxml2-static
51 BuildRequires: ncurses-static
52 BuildRequires: openssl-static
53 BuildRequires: pcre-static
54 BuildRequires: popt-static
55 BuildRequires: readline-static
56 BuildRequires: rpm-static
57 BuildRequires: zlib-static
59 Requires(triggerpostun): awk
60 Requires(triggerpostun): sed >= 4.0
61 Requires: %{name}-libs = %{version}-%{release}
62 Requires: db >= %{ver_db}
63 Requires: rpm >= %{ver_rpm}
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 poldek is an RPM package management tool which allows you to easily
69 perform package verification, installation (including system
70 installation from scratch), upgrading, and removal.
72 Program can be used in batch (like apt-get from Debian's APT) or
73 interactive mode. The interactive mode puts you into a readline
74 interface with command line autocompletion and history, similar to the
75 shell mode of Perl's CPAN.
77 %{?with_static:This version is statically linked.}
79 %{!?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.
131 %package -n python-poldek
132 Summary: Python modules for poldek
133 Summary(pl): Modu³y jêzyka Python dla poldka
134 Group: Libraries/Python
135 Requires: %{name}-libs = %{version}-%{release}
136 %pyrequires_eq python-libs
138 %description -n python-poldek
139 Python modules for poldek.
141 %description -n python-poldek -l pl
142 Modu³y jêzyka Python dla poldka.
145 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
158 cp -f config.sub trurlib
161 %{?with_static:--enable-static --disable-shared} \
162 %{!?with_imode:--disable-imode} \
164 %{?with_python:--with-python}
168 rm -rf $RPM_BUILD_ROOT
169 install -d $RPM_BUILD_ROOT%{_sysconfdir}
172 DESTDIR=$RPM_BUILD_ROOT
175 %{__make} -C python install \
176 DESTDIR=$RPM_BUILD_ROOT \
180 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
182 %ifarch i486 i686 ppc sparc alpha athlon
183 %define _ftp_arch %{_target_cpu}
186 %define _ftp_arch x86_64
187 %define _ftp_alt_arch i686
190 %define _ftp_arch i486
192 %ifarch pentium2 pentium3 pentium4
193 %define _ftp_arch i686
195 %ifarch sparcv9 sparc64
196 %define _ftp_arch sparc
203 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
206 s|%%ARCH%%|%{_ftp_arch}|g
207 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
211 s|%%ARCH%%|%{_ftp_alt_arch}|g
212 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
215 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
217 # get rid of non-pld sources
218 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
219 # include them in %doc
222 rm -f configs/Makefile*
226 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
232 rm -rf $RPM_BUILD_ROOT
235 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
238 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
240 %post libs -p /sbin/ldconfig
241 %postun libs -p /sbin/ldconfig
243 %triggerpostun -- poldek <= 0.18.3-5
244 if [ -f /etc/poldek.conf ]; then
245 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
248 # otherwise don't touch
249 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
250 %triggerpostun -- poldek <= 0.18.7-1
251 if [ -f /etc/poldek.conf ]; then
252 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
256 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
257 if [ -f /etc/poldek.conf.rpmsave ]; then
266 if (sub(",noauto", "", name)) {
271 if (match(name, /,pri=[0-9]+/)) {
272 pri = substr(name, RSTART + 5, RLENGTH - 5);
273 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
276 # skip ac sources. already in new config.
277 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
280 print "name = " name;
281 print "type = " type;
282 print "path = " path;
283 print "auto = " auto;
284 print "autoup = " autoup;
290 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
291 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
294 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
296 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
300 %files -f %{name}.lang
301 %defattr(644,root,root,755)
302 %doc README* NEWS TODO configs/
303 %dir %{_sysconfdir}/%{name}
304 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
305 %attr(755,root,root) %{_bindir}/*
306 %dir %{_libdir}/%{name}
307 %attr(755,root,root) %{_libdir}/%{name}/*
308 %{_mandir}/man1/%{name}*
309 %lang(pl) %{_mandir}/pl/man1/%{name}*
310 %{_infodir}/poldek.info*
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
319 %defattr(644,root,root,755)
320 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
325 %defattr(644,root,root,755)
329 %files -n python-poldek
330 %defattr(644,root,root,755)
331 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
332 %{py_sitescriptdir}/poldek.py[co]
333 %{py_sitescriptdir}/poldekmod.py[co]