2 # - fails to build without poldek-devel - fix it !
5 %bcond_with static # don't use shared libraries
6 %bcond_without imode # don't build interactive mode
7 %bcond_without python # don't build python bindings
9 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
11 %define ver_rpm 4.5-49
15 Summary: RPM packages management helper tool
16 Summary(hu.UTF-8): RPM csomagkezelést segítő eszköz
17 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
20 Release: 1.%{snap}.%{rel}
22 Group: Applications/System
23 #Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
24 Source0: http://carme.pld-linux.org/~cactus/snaps/poldek/%{name}-%{version}%{snap}.tar.xz
25 # Source0-md5: ab89926c28cfb6b7d72497fc37c16ac4
27 Source2: %{name}-multilib.conf
28 Source5: %{name}-aliases.conf
29 Source6: %{name}.desktop
31 Patch100: %{name}-dirdeps.patch
32 Patch0: %{name}-vserver-packages.patch
33 Patch1: %{name}-config.patch
34 Patch2: %{name}-size-type.patch
35 Patch3: %{name}-Os-fail-workaround.patch
36 Patch4: %{name}-git.patch
37 Patch6: https://bugs.launchpad.net/poldek/+bug/1031767/+attachment/3252805/+files/%{name}-ls-space-lp1031767.patch
38 # Patch6-md5: 9ba0f7abdb2ba1051e1a396f9daec606
39 URL: http://poldek.pld-linux.org/
40 BuildRequires: autoconf
41 BuildRequires: automake
42 BuildRequires: bzip2-devel
43 BuildRequires: check-devel
44 BuildRequires: db-devel >= %{ver_db}
45 BuildRequires: gettext-autopoint
46 BuildRequires: gettext-devel
47 BuildRequires: libtool
48 BuildRequires: libxml2-devel
49 BuildRequires: openssl-devel >= 0.9.7d
50 BuildRequires: pcre-devel
51 BuildRequires: pkgconfig
52 BuildRequires: popt-devel
53 %{?with_python:BuildRequires: python-devel}
54 BuildRequires: readline-devel >= 5.0
55 BuildRequires: rpm-devel >= %{ver_rpm}
56 %{?with_python:BuildRequires: rpm-pythonprov}
57 BuildRequires: sed >= 4.0
58 BuildRequires: swig-python
60 BuildRequires: zlib-devel
62 BuildRequires: bzip2-static
63 BuildRequires: db-static >= %{ver_db}
64 BuildRequires: glibc-static
65 BuildRequires: libselinux-static
66 BuildRequires: libxml2-static
67 BuildRequires: ncurses-static
68 BuildRequires: openssl-static
69 BuildRequires: pcre-static
70 BuildRequires: popt-static
71 BuildRequires: readline-static
72 BuildRequires: rpm-static
73 BuildRequires: zlib-static
75 Requires(triggerpostun): awk
76 Requires(triggerpostun): sed >= 4.0
77 Requires: %{name}-libs = %{version}-%{release}
78 Requires: db >= %{ver_db}
79 Requires: openssl >= 0.9.7d
80 Requires: rpm >= %{ver_rpm}
81 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
84 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87 poldek is an RPM package management tool which allows you to easily
88 perform package verification, installation (including system
89 installation from scratch), upgrading, and removal.
91 Program can be used in batch (like apt-get from Debian's APT) or
92 interactive mode. The interactive mode puts you into a readline
93 interface with command line autocompletion and history, similar to the
94 shell mode of Perl's CPAN.
96 %{?with_static:This version is statically linked.}
98 %{!?with_imode:This version hasn't got interactive mode.}
101 %description -l hu.UTF-8
102 poldek egy RPM csomagkezelő eszköz, amely megkönnyíti a
103 csomagellenőrzést, telepítést (beleértve a rendszertelepítést a
104 nulláról), frissítést és eltávolítást.
106 A program használható parancssorból (mint a Debian apt-get programja)
107 vagy interaktív módban. Az interaktív mód egy readline környezetet
108 jelent, parancskiegészítéssel és előzményekkel, hasonlóan a Perl CPAN
111 %{?with_static:Ez a verzió statikusan linkelt.}
113 %{!?with_imode:Ennek a verziónak nincs interaktív módja.}
115 %description -l pl.UTF-8
116 poldek jest narzędziem linii poleceń służącym do weryfikacji,
117 instalacji (włączając instalację systemu od zera), aktualizacji i
120 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
121 interaktywnym. Tryb interaktywny posiada interfejs readline z
122 dopełnianiem komend i historią, podobny do trybu shell perlowego
125 %{?with_static:Ta wersja jest konsolidowana statycznie.}
127 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
130 Summary: poldek libraries
131 Summary(hu.UTF-8): A poldek könyvtárai
132 Summary(pl.UTF-8): Biblioteki poldka
138 %description libs -l hu.UTF-8
141 %description libs -l pl.UTF-8
145 Summary: Header files for poldek libraries
146 Summary(hu.UTF-8): A poldek könyvtár fejlesztői fájljai
147 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
148 Group: Development/Libraries
149 Requires: %{name}-libs = %{version}-%{release}
150 Requires: rpm-devel >= %{ver_rpm}
153 Header files for poldek libraries.
155 %description devel -l hu.UTF-8
156 A poldek könyvtár fejlesztői fájljai.
158 %description devel -l pl.UTF-8
159 Pliki nagłówkowe bibliotek poldka.
162 Summary: poldek static libraries
163 Summary(hu.UTF-8): poldek statikus könyvtárak
164 Summary(pl.UTF-8): Biblioteki statyczne poldka
165 Group: Development/Libraries
166 Requires: %{name}-devel = %{version}-%{release}
169 poldek static libraries.
171 %description static -l hu.UTF-8
172 poldek statikus könyvtárak.
174 %description static -l pl.UTF-8
175 Biblioteki statyczne poldka.
177 %package -n python-poldek
178 Summary: Python modules for poldek
179 Summary(hu.UTF-8): Python modulok poldek-hez
180 Summary(pl.UTF-8): Moduły języka Python dla poldka
181 Group: Libraries/Python
182 Requires: %{name}-libs = %{version}-%{release}
183 %pyrequires_eq python-libs
185 %description -n python-poldek
186 Python modules for poldek.
188 %description -n python-poldek -l hu.UTF-8
189 Python modulok poldek-hez.
191 %description -n python-poldek -l pl.UTF-8
192 Moduły języka Python dla poldka.
204 %{__rm} m4/libtool.m4 m4/lt*.m4
206 # cleanup backups after patching
207 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
208 chmod u+x ./configure ./doc/conf-xml2.sh
230 CPPFLAGS="%{rpmcppflags} -std=gnu99"
232 %{?with_static:--enable-static --disable-shared} \
233 %{!?with_imode:--disable-imode} \
235 %{?with_python:--with-python}
240 rm -rf $RPM_BUILD_ROOT
241 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}/repos.d,/var/cache/%{name}}
243 %{__make} install -j1 \
244 DESTDIR=$RPM_BUILD_ROOT
247 %{__make} -C python -j1 install \
248 DESTDIR=$RPM_BUILD_ROOT \
252 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
254 %ifarch i386 i586 i686 ppc sparc alpha athlon
255 %define _ftp_arch %{_target_cpu}
258 %define _ftp_arch amd64
259 %define _ftp_alt_arch i686
262 %define _ftp_arch i386
264 %ifarch pentium2 pentium3 pentium4
265 %define _ftp_arch i686
267 %ifarch sparcv9 sparc64
268 %define _ftp_arch sparc
271 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
274 s|%%ARCH%%|%{_ftp_arch}|g
275 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
279 s|%%ARCH%%|%{_ftp_alt_arch}|g
280 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
283 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
286 # add desktop file and icon
287 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
288 cp -p %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
289 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
292 # sources we don't package
293 %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
294 # include them in %doc
297 %{__rm} -f configs/Makefile*
301 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
307 rm -rf $RPM_BUILD_ROOT
310 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
311 if [ "$1" = "1" ]; then
312 # remove ignore = vserver-packages inside vserver on first install
315 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
316 done </proc/self/status
318 if [ -z "$ctx" -o "$ctx" = "0" ]; then
323 if [ "$VSERVER" = "yes" ]; then
324 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
328 %postun -p /sbin/postshell
329 -/usr/sbin/fix-info-dir -c %{_infodir}
331 %post libs -p /sbin/ldconfig
332 %postun libs -p /sbin/ldconfig
334 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
335 if [ -f /etc/poldek.conf.rpmsave ]; then
344 if (sub(",noauto", "", name)) {
349 if (match(name, /,pri=[0-9]+/)) {
350 pri = substr(name, RSTART + 5, RLENGTH - 5);
351 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
354 # skip ac sources. already in new config.
355 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
358 print "name = " name;
359 print "type = " type;
360 print "path = " path;
361 print "auto = " auto;
362 print "autoup = " autoup;
368 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
369 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
372 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
374 %{__sed} -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
378 %triggerpostun -- poldek < 0.30-0.20080225.00.1
379 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
380 %{__sed} -i -e '/^%%include source.conf/{
382 a# /etc/poldek/repos.d/*.conf
383 a%%includedir repos.d
384 }' %{_sysconfdir}/%{name}/poldek.conf
387 %{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
388 %{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
390 if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
391 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
392 mv -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
393 %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
394 %{_sysconfdir}/%{name}/repos.d/pld.conf
398 if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
399 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
400 mv -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
401 %{__sed} -i -e 's,_pld_arch,_arch,g;s,_ac_idxtype,_type,g;s,_pld_prefix,_prefix,g' \
402 %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
406 %files -f %{name}.lang
407 %defattr(644,root,root,755)
408 %doc ChangeLog README* NEWS TODO configs
409 %dir %{_sysconfdir}/%{name}
410 %dir %{_sysconfdir}/%{name}/repos.d
411 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
412 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
413 %attr(755,root,root) %{_bindir}/ipoldek
414 %attr(755,root,root) %{_bindir}/poldek
415 %attr(755,root,root) %{_bindir}/rpmvercmp
416 %dir %{_libdir}/%{name}
417 %attr(755,root,root) %{_libdir}/%{name}/*
418 %{_mandir}/man1/%{name}*.1*
419 %lang(pl) %{_mandir}/pl/man1/%{name}*
420 %{_infodir}/poldek.info*
422 %{_desktopdir}/%{name}.desktop
423 %{_pixmapsdir}/%{name}.png
425 %dir /var/cache/%{name}
427 %if %{without static}
429 %defattr(644,root,root,755)
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.*.*.*
435 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
436 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
437 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
438 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
439 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
443 %defattr(644,root,root,755)
444 %if %{without static}
445 %attr(755,root,root) %{_libdir}/libpoclidek.so
446 %attr(755,root,root) %{_libdir}/libpoldek.so
447 %attr(755,root,root) %{_libdir}/libtndb.so
448 %attr(755,root,root) %{_libdir}/libtrurl.so
449 %attr(755,root,root) %{_libdir}/libvfile.so
451 %{_libdir}/libpoclidek.la
452 %{_libdir}/libpoldek.la
453 %{_libdir}/libtndb.la
454 %{_libdir}/libtrurl.la
455 %{_libdir}/libvfile.la
456 %{_includedir}/poldek
460 %{_pkgconfigdir}/tndb.pc
463 %defattr(644,root,root,755)
465 %{_libdir}/libtrurl.a
468 %files -n python-poldek
469 %defattr(644,root,root,755)
470 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
471 %{py_sitescriptdir}/poldek.py[co]
472 %{py_sitescriptdir}/poldekmod.py[co]