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)
13 Summary: RPM packages management helper tool
14 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
15 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
18 Release: 1.%{snap}.%{rel}
20 Group: Applications/System
21 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
22 Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
23 # Source0-md5: 4b528ad356b02efdd72b81f1ecaceb83
25 Source2: %{name}-multilib.conf
26 Source5: %{name}-aliases.conf
27 Source6: %{name}.desktop
29 Patch0: %{name}-vserver-packages.patch
30 Patch1: %{name}-config.patch
31 Patch2: %{name}-size-type.patch
32 Patch3: %{name}-Os-fail-workaround.patch
33 Patch4: %{name}-link-rpmio.patch
34 Patch5: %{name}-vrpmlog.patch
35 Patch6: %{name}-git.patch
36 URL: http://poldek.pld-linux.org/
37 BuildRequires: autoconf
38 BuildRequires: automake
39 BuildRequires: bzip2-devel
40 BuildRequires: check-devel
41 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
42 BuildRequires: docbook-dtd412-xml
43 BuildRequires: gettext-devel
44 BuildRequires: libtool
45 BuildRequires: libxml2-devel
46 BuildRequires: neon-devel
47 BuildRequires: openssl-devel >= 0.9.7d
48 BuildRequires: pcre-devel
49 BuildRequires: pkgconfig
50 BuildRequires: popt-devel
51 %{?with_python:BuildRequires: python-devel}
52 BuildRequires: readline-devel >= 5.0
53 BuildRequires: rpm-devel >= %{ver_rpm}
54 %{?with_python:BuildRequires: rpm-pythonprov}
55 BuildRequires: swig-python
57 BuildRequires: zlib-devel
59 BuildRequires: bzip2-static
60 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
61 BuildRequires: glibc-static
62 BuildRequires: libselinux-static
63 BuildRequires: libxml2-static
64 BuildRequires: ncurses-static
65 BuildRequires: openssl-static
66 BuildRequires: pcre-static
67 BuildRequires: popt-static
68 BuildRequires: readline-static
69 BuildRequires: rpm-static
70 BuildRequires: zlib-static
72 Requires(triggerpostun): awk
73 Requires(triggerpostun): sed >= 4.0
74 Requires: %{name}-libs = %{version}-%{release}
75 Requires: db >= %{ver_db}-%{ver_db_rel}
76 Requires: rpm >= %{ver_rpm}
77 Requires: rpm-db-ver = %{ver_db}
78 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
81 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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 %pyrequires_eq 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.
201 %{__rm} m4/libtool.m4 m4/lt*.m4
203 # cleanup backups after patching
204 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
205 chmod u+x ./configure ./doc/conf-xml2.sh
227 CPPFLAGS="%{rpmcppflags} -std=gnu99"
229 %{?with_static:--enable-static --disable-shared} \
230 %{!?with_imode:--disable-imode} \
232 %{?with_python:--with-python}
237 rm -rf $RPM_BUILD_ROOT
238 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
240 %{__make} install -j1 \
241 DESTDIR=$RPM_BUILD_ROOT
244 %{__make} -C python -j1 install \
245 DESTDIR=$RPM_BUILD_ROOT \
249 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
251 %ifarch i586 i686 ppc sparc alpha athlon
252 %define _ftp_arch %{_target_cpu}
255 %define _ftp_arch x86_64
256 %define _ftp_alt_arch i686
259 %define _ftp_arch i586
261 %ifarch pentium2 pentium3 pentium4
262 %define _ftp_arch i686
265 %define tld_conf %{SOURCE1}
268 %define tld_multilib_conf %{SOURCE2}
271 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
273 %if 0%{?tld_multilib_conf:1}
274 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
277 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
280 # add desktop file and icon
281 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
282 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
283 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
286 # sources we don't package
287 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.conf
288 # include them in %doc
291 %{__rm} -f configs/Makefile*
295 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
301 rm -rf $RPM_BUILD_ROOT
304 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
305 if [ "$1" = "1" ]; then
306 # remove ignore = vserver-packages inside vserver on first install
309 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
310 done </proc/self/status
312 if [ -z "$ctx" -o "$ctx" = "0" ]; then
317 if [ "$VSERVER" = "yes" ]; then
318 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
322 %postun -p /sbin/postshell
323 -/usr/sbin/fix-info-dir -c %{_infodir}
325 %post libs -p /sbin/ldconfig
326 %postun libs -p /sbin/ldconfig
328 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
329 if [ -f /etc/poldek.conf.rpmsave ]; then
338 if (sub(",noauto", "", name)) {
343 if (match(name, /,pri=[0-9]+/)) {
344 pri = substr(name, RSTART + 5, RLENGTH - 5);
345 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
348 # skip ac sources. already in new config.
349 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
352 print "name = " name;
353 print "type = " type;
354 print "path = " path;
355 print "auto = " auto;
356 print "autoup = " autoup;
362 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
363 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
366 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
368 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
372 %triggerpostun -- poldek < 0.30-0.20080225.00.1
373 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
374 %{__sed} -i -e '/^%%include source.conf/{
376 a# /etc/poldek/repos.d/*.conf
377 a%%includedir repos.d
378 }' %{_sysconfdir}/%{name}/poldek.conf
381 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
382 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
384 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
385 cp -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
386 cp -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
390 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
391 cp -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
392 cp -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
396 %files -f %{name}.lang
397 %defattr(644,root,root,755)
398 %doc ChangeLog README* NEWS TODO configs
399 %dir %{_sysconfdir}/%{name}
400 %dir %{_sysconfdir}/%{name}/repos.d
401 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
402 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
403 %attr(755,root,root) %{_bindir}/ipoldek
404 %attr(755,root,root) %{_bindir}/poldek
405 %attr(755,root,root) %{_bindir}/rpmvercmp
406 %dir %{_libdir}/%{name}
407 %attr(755,root,root) %{_libdir}/%{name}/*
408 %{_mandir}/man1/%{name}*.1*
409 %lang(pl) %{_mandir}/pl/man1/%{name}*
410 %{_infodir}/poldek.info*
412 %{_desktopdir}/%{name}.desktop
413 %{_pixmapsdir}/%{name}.png
415 %dir /var/cache/%{name}
417 %if %{without static}
419 %defattr(644,root,root,755)
420 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
421 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
422 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
423 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
424 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
425 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
426 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
427 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
428 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
429 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
433 %defattr(644,root,root,755)
434 %if %{without static}
435 %attr(755,root,root) %{_libdir}/libpoclidek.so
436 %attr(755,root,root) %{_libdir}/libpoldek.so
437 %attr(755,root,root) %{_libdir}/libtndb.so
438 %attr(755,root,root) %{_libdir}/libtrurl.so
439 %attr(755,root,root) %{_libdir}/libvfile.so
441 %{_libdir}/libpoclidek.la
442 %{_libdir}/libpoldek.la
443 %{_libdir}/libtndb.la
444 %{_libdir}/libtrurl.la
445 %{_libdir}/libvfile.la
446 %{_includedir}/poldek
450 %{_pkgconfigdir}/tndb.pc
453 %defattr(644,root,root,755)
455 %{_libdir}/libtrurl.a
458 %files -n python-poldek
459 %defattr(644,root,root,755)
460 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
461 %{py_sitescriptdir}/poldek.py[co]
462 %{py_sitescriptdir}/poldekmod.py[co]