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
9 %define ver_rpm 4.4.9-1
11 %define snap 20070703.00
12 Summary: RPM packages management helper tool
13 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
18 Group: Applications/System
19 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
20 # Source0-md5: dae23dec560fad954abf157fd250e4c3
22 Source2: %{name}-multilib.conf
23 Source3: %{name}-aliases.conf
24 Patch1: %{name}-vserver-packages.patch
25 Patch2: %{name}-config.patch
26 Patch3: %{name}-multilib.patch
27 Patch4: %{name}-ndie_fix.patch
28 Patch5: %{name}-uri-escape-fix.patch
29 Patch6: %{name}-install-dist.patch
30 URL: http://poldek.pld-linux.org/
31 BuildRequires: autoconf
32 BuildRequires: automake
33 BuildRequires: bzip2-devel
35 BuildRequires: db-devel >= %{ver_db}
36 BuildRequires: gettext-autopoint
37 BuildRequires: libtool
38 BuildRequires: libxml2-devel
39 BuildRequires: openssl-devel >= 0.9.7d
40 BuildRequires: pcre-devel
41 BuildRequires: perl-tools-pod
42 BuildRequires: pkgconfig
43 BuildRequires: popt-devel
44 %{?with_python:BuildRequires: python-devel}
45 BuildRequires: readline-devel >= 5.0
46 BuildRequires: rpm-devel >= %{ver_rpm}
47 %{?with_python:BuildRequires: rpm-pythonprov}
49 BuildRequires: zlib-devel
51 BuildRequires: bzip2-static
52 BuildRequires: db-static >= %{ver_db}
53 BuildRequires: glibc-static
54 BuildRequires: libselinux-static
55 BuildRequires: libxml2-static
56 BuildRequires: ncurses-static
57 BuildRequires: openssl-static
58 BuildRequires: pcre-static
59 BuildRequires: popt-static
60 BuildRequires: readline-static
61 BuildRequires: rpm-static
62 BuildRequires: zlib-static
64 Requires(triggerpostun): awk
65 Requires(triggerpostun): sed >= 4.0
66 Requires: %{name}-libs = %{version}-%{release}
67 Requires: db >= %{ver_db}
68 Requires: rpm >= %{ver_rpm}
71 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 poldek is an RPM package management tool which allows you to easily
75 perform package verification, installation (including system
76 installation from scratch), upgrading, and removal.
78 Program can be used in batch (like apt-get from Debian's APT) or
79 interactive mode. The interactive mode puts you into a readline
80 interface with command line autocompletion and history, similar to the
81 shell mode of Perl's CPAN.
83 %{?with_static:This version is statically linked.}
85 %{!?with_imode:This version hasn't got interactive mode.}
88 %description -l pl.UTF-8
89 poldek jest narzędziem linii poleceń służącym do weryfikacji,
90 instalacji (włączając instalację systemu od zera), aktualizacji i
93 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
94 interaktywnym. Tryb interaktywny posiada interfejs readline z
95 dopełnianiem komend i historią, podobny do trybu shell perlowego
98 %{?with_static:Ta wersja jest konsolidowana statycznie.}
100 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
103 Summary: poldek libraries
104 Summary(pl.UTF-8): Biblioteki poldka
110 %description libs -l pl.UTF-8
114 Summary: Header files for poldek libraries
115 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
116 Group: Development/Libraries
117 Requires: %{name}-libs = %{version}-%{release}
120 Header files for poldek libraries.
122 %description devel -l pl.UTF-8
123 Pliki nagłówkowe bibliotek poldka.
126 Summary: poldek static libraries
127 Summary(pl.UTF-8): Biblioteki statyczne poldka
128 Group: Development/Libraries
129 Requires: %{name}-devel = %{version}-%{release}
132 poldek static libraries.
134 %description static -l pl.UTF-8
135 Biblioteki statyczne poldka.
137 %package -n python-poldek
138 Summary: Python modules for poldek
139 Summary(pl.UTF-8): Moduły języka Python dla poldka
140 Group: Libraries/Python
141 Requires: %{name}-libs = %{version}-%{release}
142 %pyrequires_eq python-libs
144 %description -n python-poldek
145 Python modules for poldek.
147 %description -n python-poldek -l pl.UTF-8
148 Moduły języka Python dla poldka.
151 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
161 # cleanup backups after patching
162 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
169 cp -f config.sub trurlib
172 %{?with_static:--enable-static --disable-shared} \
173 %{!?with_imode:--disable-imode} \
175 %{?with_python:--with-python}
179 rm -rf $RPM_BUILD_ROOT
180 install -d $RPM_BUILD_ROOT%{_sysconfdir}
183 DESTDIR=$RPM_BUILD_ROOT
186 %{__make} -C python install \
187 DESTDIR=$RPM_BUILD_ROOT \
191 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
193 %ifarch i486 i686 ppc sparc alpha athlon
194 %define _ftp_arch %{_target_cpu}
197 %define _ftp_arch x86_64
198 %define _ftp_alt_arch i686
201 %define _ftp_arch i486
203 %ifarch pentium2 pentium3 pentium4
204 %define _ftp_arch i686
206 %ifarch sparcv9 sparc64
207 %define _ftp_arch sparc
214 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
217 s|%%ARCH%%|%{_ftp_arch}|g
218 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
222 s|%%ARCH%%|%{_ftp_alt_arch}|g
223 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
226 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
228 # get rid of non-pld sources
229 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
230 # include them in %doc
233 rm -f configs/Makefile*
237 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
243 rm -rf $RPM_BUILD_ROOT
246 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
249 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
251 %post libs -p /sbin/ldconfig
252 %postun libs -p /sbin/ldconfig
254 %triggerpostun -- poldek <= 0.18.3-5
255 if [ -f /etc/poldek.conf ]; then
256 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
259 # otherwise don't touch
260 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
261 %triggerpostun -- poldek <= 0.18.7-1
262 if [ -f /etc/poldek.conf ]; then
263 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
267 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
268 if [ -f /etc/poldek.conf.rpmsave ]; then
277 if (sub(",noauto", "", name)) {
282 if (match(name, /,pri=[0-9]+/)) {
283 pri = substr(name, RSTART + 5, RLENGTH - 5);
284 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
287 # skip ac sources. already in new config.
288 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
291 print "name = " name;
292 print "type = " type;
293 print "path = " path;
294 print "auto = " auto;
295 print "autoup = " autoup;
301 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
302 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
305 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
307 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
311 %files -f %{name}.lang
312 %defattr(644,root,root,755)
313 %doc README* NEWS TODO configs/
314 %dir %{_sysconfdir}/%{name}
315 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
316 %attr(755,root,root) %{_bindir}/*
317 %dir %{_libdir}/%{name}
318 %attr(755,root,root) %{_libdir}/%{name}/*
319 %{_mandir}/man1/%{name}*
320 %lang(pl) %{_mandir}/pl/man1/%{name}*
321 %{_infodir}/poldek.info*
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
330 %defattr(644,root,root,755)
331 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
336 %defattr(644,root,root,755)
340 %files -n python-poldek
341 %defattr(644,root,root,755)
342 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
343 %{py_sitescriptdir}/poldek.py[co]
344 %{py_sitescriptdir}/poldekmod.py[co]