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)
9 %define ver_db 4.5.20-2
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}
233 rm -rf $RPM_BUILD_ROOT
234 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
236 %{__make} install -j1 \
237 DESTDIR=$RPM_BUILD_ROOT
240 %{__make} -C python -j1 install \
241 DESTDIR=$RPM_BUILD_ROOT \
245 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
248 %define _ftp_arch %{_target_cpu}
251 %define _ftp_arch x86_64
252 %define _ftp_alt_arch i686
254 %ifarch pentium2 pentium3 pentium4
255 %define _ftp_arch i686
258 %define tld_conf %{SOURCE1}
261 %define tld_multilib_conf %{SOURCE2}
264 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
266 %if 0%{?tld_multilib_conf:1}
267 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
270 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
273 # add desktop file and icon
274 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
275 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
276 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
279 # sources we don't package
280 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.conf
281 # include them in %doc
284 %{__rm} -f configs/Makefile*
288 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
294 rm -rf $RPM_BUILD_ROOT
297 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
298 if [ "$1" = "1" ]; then
299 # remove ignore = vserver-packages inside vserver on first install
302 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
303 done </proc/self/status
305 if [ -z "$ctx" -o "$ctx" = "0" ]; then
310 if [ "$VSERVER" = "yes" ]; then
311 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
315 %postun -p /sbin/postshell
316 -/usr/sbin/fix-info-dir -c %{_infodir}
318 %post libs -p /sbin/ldconfig
319 %postun libs -p /sbin/ldconfig
321 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
322 if [ -f /etc/poldek.conf.rpmsave ]; then
331 if (sub(",noauto", "", name)) {
336 if (match(name, /,pri=[0-9]+/)) {
337 pri = substr(name, RSTART + 5, RLENGTH - 5);
338 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
341 # skip ac sources. already in new config.
342 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
345 print "name = " name;
346 print "type = " type;
347 print "path = " path;
348 print "auto = " auto;
349 print "autoup = " autoup;
355 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
356 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
359 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
361 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
365 %triggerpostun -- poldek < 0.30-0.20080225.00.1
366 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
367 %{__sed} -i -e '/^%%include source.conf/{
369 a# /etc/poldek/repos.d/*.conf
370 a%%includedir repos.d
371 }' %{_sysconfdir}/%{name}/poldek.conf
374 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
375 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
377 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
378 cp -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
379 cp -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
383 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
384 cp -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
385 cp -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
389 %files -f %{name}.lang
390 %defattr(644,root,root,755)
391 %doc ChangeLog README* NEWS TODO configs
392 %dir %{_sysconfdir}/%{name}
393 %dir %{_sysconfdir}/%{name}/repos.d
394 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
395 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
396 %attr(755,root,root) %{_bindir}/ipoldek
397 %attr(755,root,root) %{_bindir}/poldek
398 %attr(755,root,root) %{_bindir}/rpmvercmp
400 %attr(755,root,root) %{_libexecdir}/*
401 %{_mandir}/man1/%{name}*.1*
402 %lang(pl) %{_mandir}/pl/man1/%{name}*
403 %{_infodir}/poldek.info*
405 %{_desktopdir}/%{name}.desktop
406 %{_pixmapsdir}/%{name}.png
408 %dir /var/cache/%{name}
410 %if %{without static}
412 %defattr(644,root,root,755)
413 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
414 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
415 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
416 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
417 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
418 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
419 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
420 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
421 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
422 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
426 %defattr(644,root,root,755)
427 %if %{without static}
428 %attr(755,root,root) %{_libdir}/libpoclidek.so
429 %attr(755,root,root) %{_libdir}/libpoldek.so
430 %attr(755,root,root) %{_libdir}/libtndb.so
431 %attr(755,root,root) %{_libdir}/libtrurl.so
432 %attr(755,root,root) %{_libdir}/libvfile.so
434 %{_libdir}/libpoclidek.la
435 %{_libdir}/libpoldek.la
436 %{_libdir}/libtndb.la
437 %{_libdir}/libtrurl.la
438 %{_libdir}/libvfile.la
439 %{_includedir}/poldek
443 %{_pkgconfigdir}/tndb.pc
444 %{_pkgconfigdir}/trurlib.pc
447 %defattr(644,root,root,755)
449 %{_libdir}/libtrurl.a
452 %files -n python-poldek
453 %defattr(644,root,root,755)
454 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
455 %{py_sitescriptdir}/poldek.py[co]
456 %{py_sitescriptdir}/poldekmod.py[co]