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)
11 %define ver_rpm 4.5-71
14 Summary: RPM packages management helper tool
15 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
16 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
21 Group: Applications/System
22 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
23 Source0: http://carme.pld-linux.org/~megabajt/releases/poldek/%{name}-%{version}.tar.xz
24 # Source0-md5: e569c8454df0932df53b09cee9998927
26 Source2: %{name}-multilib.conf
27 Source5: %{name}-aliases.conf
28 Source6: %{name}.desktop
30 Patch0: %{name}-size-type.patch
31 Patch1: %{name}-config.patch
32 URL: http://poldek.pld-linux.org/
33 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
34 BuildRequires: autoconf
35 BuildRequires: automake >= 1:1.11
36 BuildRequires: bzip2-devel
37 BuildRequires: check-devel
38 BuildRequires: docbook-dtd412-xml
39 BuildRequires: gettext-devel
40 BuildRequires: libtool
41 BuildRequires: libxml2-devel
42 BuildRequires: neon-devel
43 BuildRequires: openssl-devel >= 0.9.7d
44 BuildRequires: pcre-devel
45 BuildRequires: pkgconfig
46 BuildRequires: popt-devel
47 %{?with_python:BuildRequires: python-devel}
48 BuildRequires: readline-devel >= 5.0
49 BuildRequires: rpm-devel >= %{ver_rpm}
50 %{?with_python:BuildRequires: rpm-pythonprov}
51 BuildRequires: swig-python
52 BuildRequires: tar >= 1:1.22
55 BuildRequires: zlib-devel
57 BuildRequires: %{db_pkg}-static >= %{ver_db}-%{ver_db_rel}
58 BuildRequires: bzip2-static
59 BuildRequires: glibc-static
60 BuildRequires: libxml2-static
61 BuildRequires: ncurses-static
62 BuildRequires: openssl-static
63 BuildRequires: pcre-static
64 BuildRequires: popt-static
65 BuildRequires: readline-static
66 BuildRequires: rpm-static
67 BuildRequires: zlib-static
69 Requires(triggerpostun): awk
70 Requires(triggerpostun): sed >= 4.0
71 Requires: %{db_pkg} >= %{ver_db}-%{ver_db_rel}
72 Requires: %{name}-libs = %{version}-%{release}
73 Requires: rpm >= %{ver_rpm}
74 Requires: rpm-db-ver = %{ver_db}
75 #Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
76 Requires: rpm-lib >= %{ver_rpm}
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 %define _libexecdir %{_prefix}/lib/%{name}
84 poldek is an RPM package management tool which allows you to easily
85 perform package verification, installation (including system
86 installation from scratch), upgrading, and removal.
88 Program can be used in batch (like apt-get from Debian's APT) or
89 interactive mode. The interactive mode puts you into a readline
90 interface with command line autocompletion and history, similar to the
91 shell mode of Perl's CPAN.
93 %{?with_static:This version is statically linked.}
95 %{!?with_imode:This version hasn't got interactive mode.}
98 %description -l hu.UTF-8
99 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
100 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
101 nulláról), frissítést és eltávolítást.
103 A program használható parancssorból (mint a Debian apt-get programja)
104 vagy interaktív módban. Az interaktív mód egy readline környezetet
105 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
108 %{?with_static:Ez a verzió statikusan linkelt.}
110 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
112 %description -l pl.UTF-8
113 poldek jest narzędziem linii poleceń służącym do weryfikacji,
114 instalacji (włączając instalację systemu od zera), aktualizacji i
117 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
118 interaktywnym. Tryb interaktywny posiada interfejs readline z
119 dopełnianiem komend i historią, podobny do trybu shell perlowego
122 %{?with_static:Ta wersja jest konsolidowana statycznie.}
124 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
127 Summary: poldek libraries
128 Summary(hu.UTF-8): A poldek könyvtárai
129 Summary(pl.UTF-8): Biblioteki poldka
135 %description libs -l hu.UTF-8
138 %description libs -l pl.UTF-8
142 Summary: Header files for poldek libraries
143 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
144 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
145 Group: Development/Libraries
146 Requires: %{name}-libs = %{version}-%{release}
147 Requires: rpm-devel >= %{ver_rpm}
150 Header files for poldek libraries.
152 %description devel -l hu.UTF-8
153 A poldek könyvtár fejlesztői fájljai.
155 %description devel -l pl.UTF-8
156 Pliki nagłówkowe bibliotek poldka.
159 Summary: poldek static libraries
160 Summary(hu.UTF-8): poldek statikus könyvtárak
161 Summary(pl.UTF-8): Biblioteki statyczne poldka
162 Group: Development/Libraries
163 Requires: %{name}-devel = %{version}-%{release}
166 poldek static libraries.
168 %description static -l hu.UTF-8
169 poldek statikus könyvtárak.
171 %description static -l pl.UTF-8
172 Biblioteki statyczne poldka.
174 %package -n python-poldek
175 Summary: Python modules for poldek
176 Summary(hu.UTF-8): Python modulok poldek-hez
177 Summary(pl.UTF-8): Moduły języka Python dla poldka
178 Group: Libraries/Python
179 Requires: %{name}-libs = %{version}-%{release}
180 Requires: python-libs
182 %description -n python-poldek
183 Python modules for poldek.
185 %description -n python-poldek -l hu.UTF-8
186 Python modulok poldek-hez.
188 %description -n python-poldek -l pl.UTF-8
189 Moduły języka Python dla poldka.
196 %{__rm} m4/libtool.m4 m4/lt*.m4
198 # cleanup backups after patching
199 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
200 chmod u+x ./configure ./doc/conf-xml2.sh
223 CPPFLAGS="%{rpmcppflags} -std=gnu99 -fgnu89-inline"
225 %{?with_static:--enable-static --disable-shared} \
226 %{!?with_imode:--disable-imode} \
227 --with-pkglibdir=%{_libexecdir} \
229 %{?with_python:--with-python}
234 rm -rf $RPM_BUILD_ROOT
235 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
237 %{__make} install -j1 \
238 DESTDIR=$RPM_BUILD_ROOT
241 %{__make} -C python -j1 install \
242 DESTDIR=$RPM_BUILD_ROOT \
246 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
249 %define _ftp_arch %{_target_cpu}
252 %define _ftp_arch x86_64
253 %define _ftp_alt_arch i686
255 %ifarch pentium2 pentium3 pentium4
256 %define _ftp_arch i686
259 %define tld_conf %{SOURCE1}
262 %define tld_multilib_conf %{SOURCE2}
265 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
267 %if 0%{?tld_multilib_conf:1}
268 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
271 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
274 # add desktop file and icon
275 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
276 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
277 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
280 # sources we don't package
281 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.conf
282 # include them in %doc
285 %{__rm} -f configs/Makefile*
289 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
295 rm -rf $RPM_BUILD_ROOT
298 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
299 if [ "$1" = "1" ]; then
300 # remove ignore = vserver-packages inside vserver on first install
303 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
304 done </proc/self/status
306 if [ -z "$ctx" -o "$ctx" = "0" ]; then
311 if [ "$VSERVER" = "yes" ]; then
312 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
316 %postun -p /sbin/postshell
317 -/usr/sbin/fix-info-dir -c %{_infodir}
319 %post libs -p /sbin/ldconfig
320 %postun libs -p /sbin/ldconfig
322 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
323 if [ -f /etc/poldek.conf.rpmsave ]; then
332 if (sub(",noauto", "", name)) {
337 if (match(name, /,pri=[0-9]+/)) {
338 pri = substr(name, RSTART + 5, RLENGTH - 5);
339 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
342 # skip ac sources. already in new config.
343 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
346 print "name = " name;
347 print "type = " type;
348 print "path = " path;
349 print "auto = " auto;
350 print "autoup = " autoup;
356 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
357 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
360 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
362 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
366 %triggerpostun -- poldek < 0.30-0.20080225.00.1
367 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
368 %{__sed} -i -e '/^%%include source.conf/{
370 a# /etc/poldek/repos.d/*.conf
371 a%%includedir repos.d
372 }' %{_sysconfdir}/%{name}/poldek.conf
375 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
376 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
378 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
379 cp -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
380 cp -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
384 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
385 cp -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
386 cp -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
390 %files -f %{name}.lang
391 %defattr(644,root,root,755)
392 %doc ChangeLog README* NEWS TODO configs
393 %dir %{_sysconfdir}/%{name}
394 %dir %{_sysconfdir}/%{name}/repos.d
395 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
397 %attr(755,root,root) %{_bindir}/ipoldek
398 %attr(755,root,root) %{_bindir}/poldek
399 %attr(755,root,root) %{_bindir}/rpmvercmp
401 %attr(755,root,root) %{_libexecdir}/*
402 %{_mandir}/man1/%{name}*.1*
403 %lang(pl) %{_mandir}/pl/man1/%{name}*
404 %{_infodir}/poldek.info*
406 %{_desktopdir}/%{name}.desktop
407 %{_pixmapsdir}/%{name}.png
409 %dir /var/cache/%{name}
411 %if %{without static}
413 %defattr(644,root,root,755)
414 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
416 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
417 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
418 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
419 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
420 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
421 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
422 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
423 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
427 %defattr(644,root,root,755)
428 %if %{without static}
429 %attr(755,root,root) %{_libdir}/libpoclidek.so
430 %attr(755,root,root) %{_libdir}/libpoldek.so
431 %attr(755,root,root) %{_libdir}/libtndb.so
432 %attr(755,root,root) %{_libdir}/libtrurl.so
433 %attr(755,root,root) %{_libdir}/libvfile.so
435 %{_libdir}/libpoclidek.la
436 %{_libdir}/libpoldek.la
437 %{_libdir}/libtndb.la
438 %{_libdir}/libtrurl.la
439 %{_libdir}/libvfile.la
440 %{_includedir}/poldek
444 %{_pkgconfigdir}/tndb.pc
445 %{_pkgconfigdir}/trurlib.pc
448 %defattr(644,root,root,755)
450 %{_libdir}/libtrurl.a
453 %files -n python-poldek
454 %defattr(644,root,root,755)
455 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
456 %{py_sitescriptdir}/poldek.py[co]
457 %{py_sitescriptdir}/poldekmod.py[co]