2 %bcond_with static # don't use shared libraries
3 %bcond_without imode # don't build interactive mode
4 %bcond_without python # don't build python bindings
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 20070703.00
10 Summary: RPM packages management helper tool
11 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
16 Group: Applications/System
17 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{_snap}.tar.bz2
18 # Source0-md5: dae23dec560fad954abf157fd250e4c3
20 Source2: %{name}-multilib.conf
21 Source3: %{name}-aliases.conf
22 Patch1: %{name}-vserver-packages.patch
23 Patch2: %{name}-config.patch
24 Patch3: %{name}-multilib.patch
25 Patch4: %{name}-ndie_fix.patch
26 Patch5: %{name}-uri-escape-fix.patch
27 Patch6: %{name}-install-dist.patch
28 Patch7: %{name}-nohold-fix.patch
29 Patch8: %{name}-dir-dot.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}
48 BuildRequires: sed >= 4.0
50 BuildRequires: zlib-devel
52 BuildRequires: bzip2-static
53 BuildRequires: db-static >= %{ver_db}
54 BuildRequires: glibc-static
55 BuildRequires: libselinux-static
56 BuildRequires: libxml2-static
57 BuildRequires: ncurses-static
58 BuildRequires: openssl-static
59 BuildRequires: pcre-static
60 BuildRequires: popt-static
61 BuildRequires: readline-static
62 BuildRequires: rpm-static
63 BuildRequires: zlib-static
65 Requires(triggerpostun): awk
66 Requires(triggerpostun): sed >= 4.0
67 Requires: %{name}-libs = %{version}-%{release}
68 Requires: db >= %{ver_db}
69 Requires: openssl >= 0.9.7d
70 Requires: rpm >= %{ver_rpm}
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 poldek is an RPM package management tool which allows you to easily
77 perform package verification, installation (including system
78 installation from scratch), upgrading, and removal.
80 Program can be used in batch (like apt-get from Debian's APT) or
81 interactive mode. The interactive mode puts you into a readline
82 interface with command line autocompletion and history, similar to the
83 shell mode of Perl's CPAN.
85 %{?with_static:This version is statically linked.}
87 %{!?with_imode:This version hasn't got interactive mode.}
90 %description -l pl.UTF-8
91 poldek jest narzędziem linii poleceń służącym do weryfikacji,
92 instalacji (włączając instalację systemu od zera), aktualizacji i
95 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
96 interaktywnym. Tryb interaktywny posiada interfejs readline z
97 dopełnianiem komend i historią, podobny do trybu shell perlowego
100 %{?with_static:Ta wersja jest konsolidowana statycznie.}
102 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
105 Summary: poldek libraries
106 Summary(pl.UTF-8): Biblioteki poldka
112 %description libs -l pl.UTF-8
116 Summary: Header files for poldek libraries
117 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
118 Group: Development/Libraries
119 Requires: %{name}-libs = %{version}-%{release}
122 Header files for poldek libraries.
124 %description devel -l pl.UTF-8
125 Pliki nagłówkowe bibliotek poldka.
128 Summary: poldek static libraries
129 Summary(pl.UTF-8): Biblioteki statyczne poldka
130 Group: Development/Libraries
131 Requires: %{name}-devel = %{version}-%{release}
134 poldek static libraries.
136 %description static -l pl.UTF-8
137 Biblioteki statyczne poldka.
139 %package -n python-poldek
140 Summary: Python modules for poldek
141 Summary(pl.UTF-8): Moduły języka Python dla poldka
142 Group: Libraries/Python
143 Requires: %{name}-libs = %{version}-%{release}
144 %pyrequires_eq python-libs
146 %description -n python-poldek
147 Python modules for poldek.
149 %description -n python-poldek -l pl.UTF-8
150 Moduły języka Python dla poldka.
153 %setup -q -n %{name}-%{version}%{?_snap:-cvs%{_snap}}
165 # cleanup backups after patching
166 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
173 cp -f config.sub trurlib
176 %{?with_static:--enable-static --disable-shared} \
177 %{!?with_imode:--disable-imode} \
179 %{?with_python:--with-python}
183 rm -rf $RPM_BUILD_ROOT
184 install -d $RPM_BUILD_ROOT%{_sysconfdir}
187 DESTDIR=$RPM_BUILD_ROOT
190 %{__make} -C python install \
191 DESTDIR=$RPM_BUILD_ROOT \
195 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
197 %ifarch i386 i586 i686 ppc sparc alpha athlon
198 %define _ftp_arch %{_target_cpu}
201 %define _ftp_arch amd64
202 %define _ftp_alt_arch i686
205 %define _ftp_arch i386
207 %ifarch pentium2 pentium3 pentium4
208 %define _ftp_arch i686
210 %ifarch sparcv9 sparc64
211 %define _ftp_arch sparc
218 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
221 s|%%ARCH%%|%{_ftp_arch}|g
222 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
226 s|%%ARCH%%|%{_ftp_alt_arch}|g
227 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
230 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
232 # get rid of non-pld sources
233 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
234 # include them in %doc
237 rm -f configs/Makefile*
241 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
247 rm -rf $RPM_BUILD_ROOT
250 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
253 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
255 %post libs -p /sbin/ldconfig
256 %postun libs -p /sbin/ldconfig
258 %triggerpostun -- poldek <= 0.18.3-5
259 if [ -f /etc/poldek.conf ]; then
260 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
263 # otherwise don't touch
264 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
265 %triggerpostun -- poldek <= 0.18.7-1
266 if [ -f /etc/poldek.conf ]; then
267 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
271 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
272 if [ -f /etc/poldek.conf.rpmsave ]; then
281 if (sub(",noauto", "", name)) {
286 if (match(name, /,pri=[0-9]+/)) {
287 pri = substr(name, RSTART + 5, RLENGTH - 5);
288 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
291 # skip ac sources. already in new config.
292 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
295 print "name = " name;
296 print "type = " type;
297 print "path = " path;
298 print "auto = " auto;
299 print "autoup = " autoup;
305 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
306 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
309 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
311 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
315 %files -f %{name}.lang
316 %defattr(644,root,root,755)
317 %doc README* NEWS TODO configs/
318 %dir %{_sysconfdir}/%{name}
319 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
320 %attr(755,root,root) %{_bindir}/*
321 %dir %{_libdir}/%{name}
322 %attr(755,root,root) %{_libdir}/%{name}/*
323 %{_mandir}/man1/%{name}*
324 %lang(pl) %{_mandir}/pl/man1/%{name}*
325 %{_infodir}/poldek.info*
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
334 %defattr(644,root,root,755)
335 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
340 %defattr(644,root,root,755)
344 %files -n python-poldek
345 %defattr(644,root,root,755)
346 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
347 %{py_sitescriptdir}/poldek.py[co]
348 %{py_sitescriptdir}/poldekmod.py[co]