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)
8 %define ver_db 4.3.27-1
9 %define ver_rpm 4.4.9-1
11 %define _snap 20070703.00
13 Summary: RPM packages management helper tool
14 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
17 Release: 0.%{_snap}.%{_rel}
19 Group: Applications/System
20 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{_snap}.tar.bz2
21 # Source0-md5: dae23dec560fad954abf157fd250e4c3
23 Source2: %{name}-multilib.conf
24 Source3: %{name}-aliases.conf
26 Source4: %{name}.desktop
29 Patch1: %{name}-vserver-packages.patch
30 Patch2: %{name}-config.patch
31 Patch3: %{name}-multilib.patch
32 Patch4: %{name}-ndie_fix.patch
33 Patch5: %{name}-uri-escape-fix.patch
34 Patch6: %{name}-install-dist.patch
35 Patch7: %{name}-nohold-fix.patch
36 Patch8: %{name}-dir-dot.patch
37 Patch9: %{name}-suggests-one-package.patch
38 URL: http://poldek.pld-linux.org/
39 BuildRequires: autoconf
40 BuildRequires: automake
41 BuildRequires: bzip2-devel
43 BuildRequires: db-devel >= %{ver_db}
44 BuildRequires: gettext-autopoint
45 BuildRequires: libtool
46 BuildRequires: libxml2-devel
47 BuildRequires: openssl-devel >= 0.9.7d
48 BuildRequires: pcre-devel
49 BuildRequires: perl-tools-pod
50 BuildRequires: pkgconfig
51 BuildRequires: popt-devel
52 %{?with_python:BuildRequires: python-devel}
53 BuildRequires: readline-devel >= 5.0
54 BuildRequires: rpm-devel >= %{ver_rpm}
55 %{?with_python:BuildRequires: rpm-pythonprov}
57 BuildRequires: zlib-devel
59 BuildRequires: bzip2-static
60 BuildRequires: db-static >= %{ver_db}
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}
76 Requires: rpm >= %{ver_rpm}
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 poldek is an RPM package management tool which allows you to easily
83 perform package verification, installation (including system
84 installation from scratch), upgrading, and removal.
86 Program can be used in batch (like apt-get from Debian's APT) or
87 interactive mode. The interactive mode puts you into a readline
88 interface with command line autocompletion and history, similar to the
89 shell mode of Perl's CPAN.
91 %{?with_static:This version is statically linked.}
93 %{!?with_imode:This version hasn't got interactive mode.}
96 %description -l pl.UTF-8
97 poldek jest narzędziem linii poleceń służącym do weryfikacji,
98 instalacji (włączając instalację systemu od zera), aktualizacji i
101 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
102 interaktywnym. Tryb interaktywny posiada interfejs readline z
103 dopełnianiem komend i historią, podobny do trybu shell perlowego
106 %{?with_static:Ta wersja jest konsolidowana statycznie.}
108 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
111 Summary: poldek libraries
112 Summary(pl.UTF-8): Biblioteki poldka
118 %description libs -l pl.UTF-8
122 Summary: Header files for poldek libraries
123 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
124 Group: Development/Libraries
125 Requires: %{name}-libs = %{version}-%{release}
128 Header files for poldek libraries.
130 %description devel -l pl.UTF-8
131 Pliki nagłówkowe bibliotek poldka.
134 Summary: poldek static libraries
135 Summary(pl.UTF-8): Biblioteki statyczne poldka
136 Group: Development/Libraries
137 Requires: %{name}-devel = %{version}-%{release}
140 poldek static libraries.
142 %description static -l pl.UTF-8
143 Biblioteki statyczne poldka.
145 %package -n python-poldek
146 Summary: Python modules for poldek
147 Summary(pl.UTF-8): Moduły języka Python dla poldka
148 Group: Libraries/Python
149 Requires: %{name}-libs = %{version}-%{release}
150 %pyrequires_eq python-libs
152 %description -n python-poldek
153 Python modules for poldek.
155 %description -n python-poldek -l pl.UTF-8
156 Moduły języka Python dla poldka.
159 %setup -q -n %{name}-%{version}%{?_snap:-cvs%{_snap}}
172 # cleanup backups after patching
173 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
180 cp -f config.sub trurlib
183 %{?with_static:--enable-static --disable-shared} \
184 %{!?with_imode:--disable-imode} \
186 %{?with_python:--with-python}
190 rm -rf $RPM_BUILD_ROOT
191 install -d $RPM_BUILD_ROOT%{_sysconfdir}
194 DESTDIR=$RPM_BUILD_ROOT
197 %{__make} -C python install \
198 DESTDIR=$RPM_BUILD_ROOT \
202 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
204 %ifarch i486 i686 ppc sparc alpha athlon
205 %define _ftp_arch %{_target_cpu}
208 %define _ftp_arch x86_64
209 %define _ftp_alt_arch i686
212 %define _ftp_arch i486
214 %ifarch pentium2 pentium3 pentium4
215 %define _ftp_arch i686
217 %ifarch sparcv9 sparc64
218 %define _ftp_arch sparc
225 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
228 s|%%ARCH%%|%{_ftp_arch}|g
229 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
233 s|%%ARCH%%|%{_ftp_alt_arch}|g
234 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
237 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
240 # add desktop file and icon
241 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
242 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
243 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
246 # get rid of non-pld sources
247 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
248 # include them in %doc
251 rm -f configs/Makefile*
255 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
261 rm -rf $RPM_BUILD_ROOT
264 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
267 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
269 %post libs -p /sbin/ldconfig
270 %postun libs -p /sbin/ldconfig
272 %triggerpostun -- poldek <= 0.18.3-5
273 if [ -f /etc/poldek.conf ]; then
274 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
277 # otherwise don't touch
278 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
279 %triggerpostun -- poldek <= 0.18.7-1
280 if [ -f /etc/poldek.conf ]; then
281 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
285 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
286 if [ -f /etc/poldek.conf.rpmsave ]; then
295 if (sub(",noauto", "", name)) {
300 if (match(name, /,pri=[0-9]+/)) {
301 pri = substr(name, RSTART + 5, RLENGTH - 5);
302 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
305 # skip ac sources. already in new config.
306 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
309 print "name = " name;
310 print "type = " type;
311 print "path = " path;
312 print "auto = " auto;
313 print "autoup = " autoup;
319 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
320 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
323 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
325 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
329 %files -f %{name}.lang
330 %defattr(644,root,root,755)
331 %doc README* NEWS TODO configs/
332 %dir %{_sysconfdir}/%{name}
333 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
334 %attr(755,root,root) %{_bindir}/*
335 %dir %{_libdir}/%{name}
336 %attr(755,root,root) %{_libdir}/%{name}/*
337 %{_mandir}/man1/%{name}*
338 %lang(pl) %{_mandir}/pl/man1/%{name}*
339 %{_infodir}/poldek.info*
341 %{_desktopdir}/%{name}.desktop
342 %{_pixmapsdir}/%{name}.png
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
352 %defattr(644,root,root,755)
353 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
358 %defattr(644,root,root,755)
362 %files -n python-poldek
363 %defattr(644,root,root,755)
364 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
365 %{py_sitescriptdir}/poldek.py[co]
366 %{py_sitescriptdir}/poldekmod.py[co]