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)
7 %define ver_db 4.2.50-1
8 %define ver_rpm 4.4.9-31
9 %define snap 20070703.00
11 Summary: RPM packages management helper tool
12 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
15 Release: 0.%{snap}.%{rel}
17 Group: Applications/System
18 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5: dae23dec560fad954abf157fd250e4c3
21 Source2: %{name}-multilib.conf
22 Source3: %{name}-aliases.conf
23 Source4: %{name}.desktop
25 Patch0: %{name}-dirdeps.patch
26 Patch1: %{name}-vserver-packages.patch
27 Patch2: %{name}-config.patch
28 Patch3: %{name}-multilib.patch
29 Patch4: %{name}-ndie_fix.patch
30 Patch5: %{name}-uri-escape-fix.patch
31 Patch6: %{name}-install-dist.patch
32 Patch7: %{name}-nohold-fix.patch
33 Patch8: %{name}-dir-dot.patch
34 Patch9: %{name}-suggests-one-package.patch
35 Patch10: %{name}-reversed-prompt.patch
36 Patch11: %{name}-abort-on-upgrade.patch
37 Patch12: %{name}-nonoorder.patch
38 Patch13: %{name}-bug-79.patch
39 URL: http://poldek.pld-linux.org/
40 BuildRequires: autoconf
41 BuildRequires: automake
42 BuildRequires: bzip2-devel
44 BuildRequires: db-devel >= %{ver_db}
45 BuildRequires: gettext-autopoint
46 BuildRequires: libtool
47 BuildRequires: libxml2-devel
48 BuildRequires: openssl-devel >= 0.9.7d
49 BuildRequires: pcre-devel
50 BuildRequires: perl-tools-pod
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
59 BuildRequires: zlib-devel
61 BuildRequires: bzip2-static
62 BuildRequires: db-static >= %{ver_db}
63 BuildRequires: glibc-static
64 BuildRequires: libselinux-static
65 BuildRequires: libxml2-static
66 BuildRequires: ncurses-static
67 BuildRequires: openssl-static
68 BuildRequires: pcre-static
69 BuildRequires: popt-static
70 BuildRequires: readline-static
71 BuildRequires: rpm-static
72 BuildRequires: zlib-static
74 Requires(triggerpostun): awk
75 Requires(triggerpostun): sed >= 4.0
76 Requires: %{name}-libs = %{version}-%{release}
77 Requires: db >= %{ver_db}
78 Requires: openssl >= 0.9.7d
79 Requires: rpm >= %{ver_rpm}
80 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
83 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86 poldek is an RPM package management tool which allows you to easily
87 perform package verification, installation (including system
88 installation from scratch), upgrading, and removal.
90 Program can be used in batch (like apt-get from Debian's APT) or
91 interactive mode. The interactive mode puts you into a readline
92 interface with command line autocompletion and history, similar to the
93 shell mode of Perl's CPAN.
95 %{?with_static:This version is statically linked.}
97 %{!?with_imode:This version hasn't got interactive mode.}
100 %description -l pl.UTF-8
101 poldek jest narzędziem linii poleceń służącym do weryfikacji,
102 instalacji (włączając instalację systemu od zera), aktualizacji i
105 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
106 interaktywnym. Tryb interaktywny posiada interfejs readline z
107 dopełnianiem komend i historią, podobny do trybu shell perlowego
110 %{?with_static:Ta wersja jest konsolidowana statycznie.}
112 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
115 Summary: poldek libraries
116 Summary(pl.UTF-8): Biblioteki poldka
122 %description libs -l pl.UTF-8
126 Summary: Header files for poldek libraries
127 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
128 Group: Development/Libraries
129 Requires: %{name}-libs = %{version}-%{release}
132 Header files for poldek libraries.
134 %description devel -l pl.UTF-8
135 Pliki nagłówkowe bibliotek poldka.
138 Summary: poldek static libraries
139 Summary(pl.UTF-8): Biblioteki statyczne poldka
140 Group: Development/Libraries
141 Requires: %{name}-devel = %{version}-%{release}
144 poldek static libraries.
146 %description static -l pl.UTF-8
147 Biblioteki statyczne poldka.
149 %package -n python-poldek
150 Summary: Python modules for poldek
151 Summary(pl.UTF-8): Moduły języka Python dla poldka
152 Group: Libraries/Python
153 Requires: %{name}-libs = %{version}-%{release}
154 %pyrequires_eq python-libs
156 %description -n python-poldek
157 Python modules for poldek.
159 %description -n python-poldek -l pl.UTF-8
160 Moduły języka Python dla poldka.
163 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
181 # cleanup backups after patching
182 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
189 cp -f config.sub trurlib
192 %{?with_static:--enable-static --disable-shared} \
193 %{!?with_imode:--disable-imode} \
195 %{?with_python:--with-python}
199 rm -rf $RPM_BUILD_ROOT
200 install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
203 DESTDIR=$RPM_BUILD_ROOT
206 %{__make} -C python install \
207 DESTDIR=$RPM_BUILD_ROOT \
211 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
213 %ifarch i386 i586 i686 ppc sparc alpha athlon
214 %define _ftp_arch %{_target_cpu}
217 %define _ftp_arch amd64
218 %define _ftp_alt_arch i686
221 %define _ftp_arch i386
223 %ifarch pentium2 pentium3 pentium4
224 %define _ftp_arch i686
226 %ifarch sparcv9 sparc64
227 %define _ftp_arch sparc
230 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
233 s|%%ARCH%%|%{_ftp_arch}|g
234 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
238 s|%%ARCH%%|%{_ftp_alt_arch}|g
239 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
242 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
245 # add desktop file and icon
246 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
247 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
248 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
251 # get rid of non-pld sources
252 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora,centos}-source.conf
253 # include them in %doc
256 rm -f configs/Makefile*
260 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
266 rm -rf $RPM_BUILD_ROOT
268 %post -p /sbin/postshell
269 -/usr/sbin/fix-info-dir -c %{_infodir}
271 %postun -p /sbin/postshell
272 -/usr/sbin/fix-info-dir -c %{_infodir}
274 %post libs -p /sbin/ldconfig
275 %postun libs -p /sbin/ldconfig
277 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
278 if [ -f /etc/poldek.conf.rpmsave ]; then
287 if (sub(",noauto", "", name)) {
292 if (match(name, /,pri=[0-9]+/)) {
293 pri = substr(name, RSTART + 5, RLENGTH - 5);
294 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
297 # skip ac sources. already in new config.
298 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
301 print "name = " name;
302 print "type = " type;
303 print "path = " path;
304 print "auto = " auto;
305 print "autoup = " autoup;
311 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
312 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
315 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
317 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
321 %triggerpostun -- poldek < 0.21-0.20070703.00.15.7
322 if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
323 %{__sed} -i -e '/^%%include %%{_distro}-source.conf/{
325 a# /etc/poldek/repos.d/*.conf
326 a%%includedir repos.d
327 }' %{_sysconfdir}/%{name}/poldek.conf
330 %files -f %{name}.lang
331 %defattr(644,root,root,755)
332 %doc README* NEWS TODO configs/
333 %dir %{_sysconfdir}/%{name}
334 %dir %{_sysconfdir}/%{name}/repos.d
335 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
336 %attr(755,root,root) %{_bindir}/*
337 %dir %{_libdir}/%{name}
338 %attr(755,root,root) %{_libdir}/%{name}/*
339 %{_mandir}/man1/%{name}*
340 %lang(pl) %{_mandir}/pl/man1/%{name}*
341 %{_infodir}/poldek.info*
343 %{_desktopdir}/%{name}.desktop
344 %{_pixmapsdir}/%{name}.png
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
351 %attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
352 %attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
353 %attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
354 %attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
355 %attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
356 %attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
357 %attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
358 %attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
359 %attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
363 %defattr(644,root,root,755)
364 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
369 %defattr(644,root,root,755)
373 %files -n python-poldek
374 %defattr(644,root,root,755)
375 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
376 %{py_sitescriptdir}/poldek.py[co]
377 %{py_sitescriptdir}/poldekmod.py[co]