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 Patch10: %{name}-reversed-prompt.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}
58 BuildRequires: zlib-devel
60 BuildRequires: bzip2-static
61 BuildRequires: db-static >= %{ver_db}
62 BuildRequires: glibc-static
63 BuildRequires: libselinux-static
64 BuildRequires: libxml2-static
65 BuildRequires: ncurses-static
66 BuildRequires: openssl-static
67 BuildRequires: pcre-static
68 BuildRequires: popt-static
69 BuildRequires: readline-static
70 BuildRequires: rpm-static
71 BuildRequires: zlib-static
73 Requires(triggerpostun): awk
74 Requires(triggerpostun): sed >= 4.0
75 Requires: %{name}-libs = %{version}-%{release}
76 Requires: db >= %{ver_db}
77 Requires: rpm >= %{ver_rpm}
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 pl.UTF-8
99 poldek jest narzędziem linii poleceń służącym do weryfikacji,
100 instalacji (włączając instalację systemu od zera), aktualizacji i
103 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
104 interaktywnym. Tryb interaktywny posiada interfejs readline z
105 dopełnianiem komend i historią, podobny do trybu shell perlowego
108 %{?with_static:Ta wersja jest konsolidowana statycznie.}
110 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
113 Summary: poldek libraries
114 Summary(pl.UTF-8): Biblioteki poldka
120 %description libs -l pl.UTF-8
124 Summary: Header files for poldek libraries
125 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
126 Group: Development/Libraries
127 Requires: %{name}-libs = %{version}-%{release}
130 Header files for poldek libraries.
132 %description devel -l pl.UTF-8
133 Pliki nagłówkowe bibliotek poldka.
136 Summary: poldek static libraries
137 Summary(pl.UTF-8): Biblioteki statyczne poldka
138 Group: Development/Libraries
139 Requires: %{name}-devel = %{version}-%{release}
142 poldek static libraries.
144 %description static -l pl.UTF-8
145 Biblioteki statyczne poldka.
147 %package -n python-poldek
148 Summary: Python modules for poldek
149 Summary(pl.UTF-8): Moduły języka Python dla poldka
150 Group: Libraries/Python
151 Requires: %{name}-libs = %{version}-%{release}
152 %pyrequires_eq python-libs
154 %description -n python-poldek
155 Python modules for poldek.
157 %description -n python-poldek -l pl.UTF-8
158 Moduły języka Python dla poldka.
161 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
175 # cleanup backups after patching
176 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
183 cp -f config.sub trurlib
186 %{?with_static:--enable-static --disable-shared} \
187 %{!?with_imode:--disable-imode} \
189 %{?with_python:--with-python}
193 rm -rf $RPM_BUILD_ROOT
194 install -d $RPM_BUILD_ROOT%{_sysconfdir}
197 DESTDIR=$RPM_BUILD_ROOT
200 %{__make} -C python install \
201 DESTDIR=$RPM_BUILD_ROOT \
205 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
207 %ifarch i486 i686 ppc sparc alpha athlon
208 %define _ftp_arch %{_target_cpu}
211 %define _ftp_arch x86_64
212 %define _ftp_alt_arch i686
215 %define _ftp_arch i486
217 %ifarch pentium2 pentium3 pentium4
218 %define _ftp_arch i686
220 %ifarch sparcv9 sparc64
221 %define _ftp_arch sparc
228 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
231 s|%%ARCH%%|%{_ftp_arch}|g
232 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
236 s|%%ARCH%%|%{_ftp_alt_arch}|g
237 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
240 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
243 # add desktop file and icon
244 install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
245 install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
246 install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
249 # get rid of non-pld sources
250 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
251 # include them in %doc
254 rm -f configs/Makefile*
258 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
264 rm -rf $RPM_BUILD_ROOT
266 %post -p /sbin/postshell
267 -/usr/sbin/fix-info-dir -c %{_infodir}
269 %postun -p /sbin/postshell
270 -/usr/sbin/fix-info-dir -c %{_infodir}
272 %post libs -p /sbin/ldconfig
273 %postun libs -p /sbin/ldconfig
275 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
276 if [ -f /etc/poldek.conf.rpmsave ]; then
285 if (sub(",noauto", "", name)) {
290 if (match(name, /,pri=[0-9]+/)) {
291 pri = substr(name, RSTART + 5, RLENGTH - 5);
292 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
295 # skip ac sources. already in new config.
296 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
299 print "name = " name;
300 print "type = " type;
301 print "path = " path;
302 print "auto = " auto;
303 print "autoup = " autoup;
309 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
310 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
313 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
315 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
319 %files -f %{name}.lang
320 %defattr(644,root,root,755)
321 %doc README* NEWS TODO configs/
322 %dir %{_sysconfdir}/%{name}
323 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
324 %attr(755,root,root) %{_bindir}/*
325 %dir %{_libdir}/%{name}
326 %attr(755,root,root) %{_libdir}/%{name}/*
327 %{_mandir}/man1/%{name}*
328 %lang(pl) %{_mandir}/pl/man1/%{name}*
329 %{_infodir}/poldek.info*
331 %{_desktopdir}/%{name}.desktop
332 %{_pixmapsdir}/%{name}.png
337 %defattr(644,root,root,755)
338 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
342 %defattr(644,root,root,755)
343 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
348 %defattr(644,root,root,755)
352 %files -n python-poldek
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
355 %{py_sitescriptdir}/poldek.py[co]
356 %{py_sitescriptdir}/poldekmod.py[co]