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
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 Patch1: %{name}-vserver-packages.patch
24 Patch2: %{name}-config.patch
25 Patch3: %{name}-multilib.patch
26 Patch4: %{name}-ndie_fix.patch
27 Patch5: %{name}-uri-escape-fix.patch
28 Patch6: %{name}-install-dist.patch
29 Patch7: %{name}-nohold-fix.patch
30 Patch8: %{name}-dir-dot.patch
31 Patch9: %{name}-suggests-one-package.patch
32 Patch10: %{name}-dirdeps.patch
33 URL: http://poldek.pld-linux.org/
34 BuildRequires: autoconf
35 BuildRequires: automake
36 BuildRequires: bzip2-devel
38 BuildRequires: db-devel >= %{ver_db}
39 BuildRequires: gettext-autopoint
40 BuildRequires: libtool
41 BuildRequires: libxml2-devel
42 BuildRequires: openssl-devel >= 0.9.7d
43 BuildRequires: pcre-devel
44 BuildRequires: perl-tools-pod
45 BuildRequires: pkgconfig
46 BuildRequires: popt-devel
47 %{?with_python:BuildRequires: python-devel}
48 BuildRequires: readline-devel >= 5.0
49 BuildRequires: rpm-devel >= %{ver_rpm}
50 %{?with_python:BuildRequires: rpm-pythonprov}
51 BuildRequires: sed >= 4.0
53 BuildRequires: zlib-devel
55 BuildRequires: bzip2-static
56 BuildRequires: db-static >= %{ver_db}
57 BuildRequires: glibc-static
58 BuildRequires: libselinux-static
59 BuildRequires: libxml2-static
60 BuildRequires: ncurses-static
61 BuildRequires: openssl-static
62 BuildRequires: pcre-static
63 BuildRequires: popt-static
64 BuildRequires: readline-static
65 BuildRequires: rpm-static
66 BuildRequires: zlib-static
68 Requires(triggerpostun): awk
69 Requires(triggerpostun): sed >= 4.0
70 Requires: %{name}-libs = %{version}-%{release}
71 Requires: db >= %{ver_db}
72 Requires: openssl >= 0.9.7d
73 Requires: rpm >= %{ver_rpm}
74 Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
77 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 poldek is an RPM package management tool which allows you to easily
81 perform package verification, installation (including system
82 installation from scratch), upgrading, and removal.
84 Program can be used in batch (like apt-get from Debian's APT) or
85 interactive mode. The interactive mode puts you into a readline
86 interface with command line autocompletion and history, similar to the
87 shell mode of Perl's CPAN.
89 %{?with_static:This version is statically linked.}
91 %{!?with_imode:This version hasn't got interactive mode.}
94 %description -l pl.UTF-8
95 poldek jest narzędziem linii poleceń służącym do weryfikacji,
96 instalacji (włączając instalację systemu od zera), aktualizacji i
99 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
100 interaktywnym. Tryb interaktywny posiada interfejs readline z
101 dopełnianiem komend i historią, podobny do trybu shell perlowego
104 %{?with_static:Ta wersja jest konsolidowana statycznie.}
106 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
109 Summary: poldek libraries
110 Summary(pl.UTF-8): Biblioteki poldka
116 %description libs -l pl.UTF-8
120 Summary: Header files for poldek libraries
121 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
122 Group: Development/Libraries
123 Requires: %{name}-libs = %{version}-%{release}
126 Header files for poldek libraries.
128 %description devel -l pl.UTF-8
129 Pliki nagłówkowe bibliotek poldka.
132 Summary: poldek static libraries
133 Summary(pl.UTF-8): Biblioteki statyczne poldka
134 Group: Development/Libraries
135 Requires: %{name}-devel = %{version}-%{release}
138 poldek static libraries.
140 %description static -l pl.UTF-8
141 Biblioteki statyczne poldka.
143 %package -n python-poldek
144 Summary: Python modules for poldek
145 Summary(pl.UTF-8): Moduły języka Python dla poldka
146 Group: Libraries/Python
147 Requires: %{name}-libs = %{version}-%{release}
148 %pyrequires_eq python-libs
150 %description -n python-poldek
151 Python modules for poldek.
153 %description -n python-poldek -l pl.UTF-8
154 Moduły języka Python dla poldka.
157 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
171 # cleanup backups after patching
172 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
179 cp -f config.sub trurlib
182 %{?with_static:--enable-static --disable-shared} \
183 %{!?with_imode:--disable-imode} \
185 %{?with_python:--with-python}
189 rm -rf $RPM_BUILD_ROOT
190 install -d $RPM_BUILD_ROOT%{_sysconfdir}
193 DESTDIR=$RPM_BUILD_ROOT
196 %{__make} -C python install \
197 DESTDIR=$RPM_BUILD_ROOT \
201 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
203 %ifarch i386 i586 i686 ppc sparc alpha athlon
204 %define _ftp_arch %{_target_cpu}
207 %define _ftp_arch amd64
208 %define _ftp_alt_arch i686
211 %define _ftp_arch i386
213 %ifarch pentium2 pentium3 pentium4
214 %define _ftp_arch i686
216 %ifarch sparcv9 sparc64
217 %define _ftp_arch sparc
224 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
227 s|%%ARCH%%|%{_ftp_arch}|g
228 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
232 s|%%ARCH%%|%{_ftp_alt_arch}|g
233 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
236 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
238 # get rid of non-pld sources
239 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
240 # include them in %doc
243 rm -f configs/Makefile*
247 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
253 rm -rf $RPM_BUILD_ROOT
256 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
259 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
261 %post libs -p /sbin/ldconfig
262 %postun libs -p /sbin/ldconfig
264 %triggerpostun -- poldek <= 0.18.3-5
265 if [ -f /etc/poldek.conf ]; then
266 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
269 # otherwise don't touch
270 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
271 %triggerpostun -- poldek <= 0.18.7-1
272 if [ -f /etc/poldek.conf ]; then
273 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
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 %files -f %{name}.lang
322 %defattr(644,root,root,755)
323 %doc README* NEWS TODO configs/
324 %dir %{_sysconfdir}/%{name}
325 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
326 %attr(755,root,root) %{_bindir}/*
327 %dir %{_libdir}/%{name}
328 %attr(755,root,root) %{_libdir}/%{name}/*
329 %{_mandir}/man1/%{name}*
330 %lang(pl) %{_mandir}/pl/man1/%{name}*
331 %{_infodir}/poldek.info*
335 %defattr(644,root,root,755)
336 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
340 %defattr(644,root,root,755)
341 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
346 %defattr(644,root,root,755)
350 %files -n python-poldek
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
353 %{py_sitescriptdir}/poldek.py[co]
354 %{py_sitescriptdir}/poldekmod.py[co]