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://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
22 # Source0-md5: 56ba9e7b709a99965f42e24e65eb2d7f
24 Source2: %{name}-multilib.conf
25 Source5: %{name}-aliases.conf
26 Source6: %{name}.desktop
28 Patch0: %{name}-vserver-packages.patch
29 Patch1: %{name}-config.patch
30 Patch2: %{name}-size-type.patch
31 Patch3: %{name}-Os-fail-workaround.patch
32 Patch4: %{name}-git.patch
33 URL: http://poldek.pld-linux.org/
34 BuildRequires: autoconf
35 BuildRequires: automake
36 BuildRequires: bzip2-devel
37 BuildRequires: check-devel
38 BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
39 BuildRequires: docbook-dtd412-xml
40 BuildRequires: gettext-devel
41 BuildRequires: libtool
42 BuildRequires: libxml2-devel
43 BuildRequires: neon-devel
44 BuildRequires: openssl-devel >= 0.9.7d
45 BuildRequires: pcre-devel
46 BuildRequires: pkgconfig
47 BuildRequires: popt-devel
48 %{?with_python:BuildRequires: python-devel}
49 BuildRequires: readline-devel >= 5.0
50 BuildRequires: rpm-devel >= %{ver_rpm}
51 %{?with_python:BuildRequires: rpm-pythonprov}
52 BuildRequires: swig-python
54 BuildRequires: zlib-devel
56 BuildRequires: bzip2-static
57 BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
58 BuildRequires: glibc-static
59 BuildRequires: libselinux-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: %{name}-libs = %{version}-%{release}
72 Requires: db >= %{ver_db}-%{ver_db_rel}
73 Requires: rpm >= %{ver_rpm}
74 Requires: rpm-db-ver = %{ver_db}
75 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 poldek is an RPM package management tool which allows you to easily
82 perform package verification, installation (including system
83 installation from scratch), upgrading, and removal.
85 Program can be used in batch (like apt-get from Debian's APT) or
86 interactive mode. The interactive mode puts you into a readline
87 interface with command line autocompletion and history, similar to the
88 shell mode of Perl's CPAN.
90 %{?with_static:This version is statically linked.}
92 %{!?with_imode:This version hasn't got interactive mode.}
95 %description -l hu.UTF-8
96 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
97 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
98 nulláról), frissítést és eltávolítást.
100 A program használható parancssorból (mint a Debian apt-get programja)
101 vagy interaktív módban. Az interaktív mód egy readline környezetet
102 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
105 %{?with_static:Ez a verzió statikusan linkelt.}
107 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
109 %description -l pl.UTF-8
110 poldek jest narzędziem linii poleceń służącym do weryfikacji,
111 instalacji (włączając instalację systemu od zera), aktualizacji i
114 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
115 interaktywnym. Tryb interaktywny posiada interfejs readline z
116 dopełnianiem komend i historią, podobny do trybu shell perlowego
119 %{?with_static:Ta wersja jest konsolidowana statycznie.}
121 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
124 Summary: poldek libraries
125 Summary(hu.UTF-8): A poldek könyvtárai
126 Summary(pl.UTF-8): Biblioteki poldka
132 %description libs -l hu.UTF-8
135 %description libs -l pl.UTF-8
139 Summary: Header files for poldek libraries
140 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
141 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
142 Group: Development/Libraries
143 Requires: %{name}-libs = %{version}-%{release}
144 Requires: rpm-devel >= %{ver_rpm}
147 Header files for poldek libraries.
149 %description devel -l hu.UTF-8
150 A poldek könyvtár fejlesztői fájljai.
152 %description devel -l pl.UTF-8
153 Pliki nagłówkowe bibliotek poldka.
156 Summary: poldek static libraries
157 Summary(hu.UTF-8): poldek statikus könyvtárak
158 Summary(pl.UTF-8): Biblioteki statyczne poldka
159 Group: Development/Libraries
160 Requires: %{name}-devel = %{version}-%{release}
163 poldek static libraries.
165 %description static -l hu.UTF-8
166 poldek statikus könyvtárak.
168 %description static -l pl.UTF-8
169 Biblioteki statyczne poldka.
171 %package -n python-poldek
172 Summary: Python modules for poldek
173 Summary(hu.UTF-8): Python modulok poldek-hez
174 Summary(pl.UTF-8): Moduły języka Python dla poldka
175 Group: Libraries/Python
176 Requires: %{name}-libs = %{version}-%{release}
177 %pyrequires_eq python-libs
179 %description -n python-poldek
180 Python modules for poldek.
182 %description -n python-poldek -l hu.UTF-8
183 Python modulok poldek-hez.
185 %description -n python-poldek -l pl.UTF-8
186 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
222 CPPFLAGS="%{rpmcppflags} -std=gnu99"
224 %{?with_static:--enable-static --disable-shared} \
225 %{!?with_imode:--disable-imode} \
227 %{?with_python:--with-python}
232 rm -rf $RPM_BUILD_ROOT
233 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
235 %{__make} install -j1 \
236 DESTDIR=$RPM_BUILD_ROOT
239 %{__make} -C python -j1 install \
240 DESTDIR=$RPM_BUILD_ROOT \
244 %{?with_static:%{__rm} $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
246 %ifarch i586 i686 ppc sparc alpha athlon
247 %define _ftp_arch %{_target_cpu}
250 %define _ftp_arch x86_64
251 %define _ftp_alt_arch i686
254 %define _ftp_arch i586
256 %ifarch pentium2 pentium3 pentium4
257 %define _ftp_arch i686
260 %define tld_conf %{SOURCE1}
263 %define tld_multilib_conf %{SOURCE2}
266 %{__sed} -e 's|%%ARCH%%|%{_ftp_arch}|g' < %{tld_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld.conf
268 %if 0%{?tld_multilib_conf:1}
269 %{__sed} 's|%%ARCH%%|%{_ftp_alt_arch}|g' < %{tld_multilib_conf} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
272 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
275 # add desktop file and icon
276 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
277 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
278 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
281 # sources we don't package
282 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{{rh,fedora,centos}-source,repos.d/pld}.conf
283 # include them in %doc
286 %{__rm} -f configs/Makefile*
290 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
296 rm -rf $RPM_BUILD_ROOT
299 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
300 if [ "$1" = "1" ]; then
301 # remove ignore = vserver-packages inside vserver on first install
304 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
305 done </proc/self/status
307 if [ -z "$ctx" -o "$ctx" = "0" ]; then
312 if [ "$VSERVER" = "yes" ]; then
313 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
317 %postun -p /sbin/postshell
318 -/usr/sbin/fix-info-dir -c %{_infodir}
320 %post libs -p /sbin/ldconfig
321 %postun libs -p /sbin/ldconfig
323 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
324 if [ -f /etc/poldek.conf.rpmsave ]; then
333 if (sub(",noauto", "", name)) {
338 if (match(name, /,pri=[0-9]+/)) {
339 pri = substr(name, RSTART + 5, RLENGTH - 5);
340 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
343 # skip ac sources. already in new config.
344 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
347 print "name = " name;
348 print "type = " type;
349 print "path = " path;
350 print "auto = " auto;
351 print "autoup = " autoup;
357 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
358 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
361 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
363 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
367 %triggerpostun -- poldek < 0.30-0.20080225.00.1
368 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
369 %{__sed} -i -e '/^%%include source.conf/{
371 a# /etc/poldek/repos.d/*.conf
372 a%%includedir repos.d
373 }' %{_sysconfdir}/%{name}/poldek.conf
376 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
377 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
379 if [ -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave ]; then
380 cp -f %{_sysconfdir}/%{name}/repos.d/tld.conf{,.rpmnew}
381 cp -f %{_sysconfdir}/%{name}/tld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld.conf
385 if [ -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave ]; then
386 cp -f %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf{,.rpmnew}
387 cp -f %{_sysconfdir}/%{name}/tld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/tld-multilib.conf
391 %files -f %{name}.lang
392 %defattr(644,root,root,755)
393 %doc ChangeLog README* NEWS TODO configs
394 %dir %{_sysconfdir}/%{name}
395 %dir %{_sysconfdir}/%{name}/repos.d
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
397 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
398 %attr(755,root,root) %{_bindir}/ipoldek
399 %attr(755,root,root) %{_bindir}/poldek
400 %attr(755,root,root) %{_bindir}/rpmvercmp
401 %dir %{_libdir}/%{name}
402 %attr(755,root,root) %{_libdir}/%{name}/*
403 %{_mandir}/man1/%{name}*.1*
404 %lang(pl) %{_mandir}/pl/man1/%{name}*
405 %{_infodir}/poldek.info*
407 %{_desktopdir}/%{name}.desktop
408 %{_pixmapsdir}/%{name}.png
410 %dir /var/cache/%{name}
412 %if %{without static}
414 %defattr(644,root,root,755)
415 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
416 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
417 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
418 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
419 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
420 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
421 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
422 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
423 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
424 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
428 %defattr(644,root,root,755)
429 %if %{without static}
430 %attr(755,root,root) %{_libdir}/libpoclidek.so
431 %attr(755,root,root) %{_libdir}/libpoldek.so
432 %attr(755,root,root) %{_libdir}/libtndb.so
433 %attr(755,root,root) %{_libdir}/libtrurl.so
434 %attr(755,root,root) %{_libdir}/libvfile.so
436 %{_libdir}/libpoclidek.la
437 %{_libdir}/libpoldek.la
438 %{_libdir}/libtndb.la
439 %{_libdir}/libtrurl.la
440 %{_libdir}/libvfile.la
441 %{_includedir}/poldek
445 %{_pkgconfigdir}/tndb.pc
446 %{_pkgconfigdir}/trurlib.pc
449 %defattr(644,root,root,755)
451 %{_libdir}/libtrurl.a
454 %files -n python-poldek
455 %defattr(644,root,root,755)
456 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
457 %{py_sitescriptdir}/poldek.py[co]
458 %{py_sitescriptdir}/poldekmod.py[co]