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
25 Patch1: %{name}-vserver-packages.patch
26 Patch2: %{name}-config.patch
27 Patch3: %{name}-multilib.patch
28 Patch4: %{name}-ndie_fix.patch
29 Patch5: %{name}-uri-escape-fix.patch
30 Patch6: %{name}-install-dist.patch
31 Patch7: %{name}-nohold-fix.patch
32 Patch8: %{name}-dir-dot.patch
33 Patch9: %{name}-suggests-one-package.patch
34 URL: http://poldek.pld-linux.org/
35 BuildRequires: autoconf
36 BuildRequires: automake
37 BuildRequires: bzip2-devel
39 BuildRequires: db-devel >= %{ver_db}
40 BuildRequires: gettext-autopoint
41 BuildRequires: libtool
42 BuildRequires: libxml2-devel
43 BuildRequires: openssl-devel >= 0.9.7d
44 BuildRequires: pcre-devel
45 BuildRequires: perl-tools-pod
46 BuildRequires: pkgconfig
47 BuildRequires: popt-devel
48 %{?with_python:BuildRequires: python-devel}
49 BuildRequires: readline-devel >= 5.0
50 BuildRequires: rpm-devel >= %{ver_rpm}
51 %{?with_python:BuildRequires: rpm-pythonprov}
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: rpm >= %{ver_rpm}
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 poldek is an RPM package management tool which allows you to easily
79 perform package verification, installation (including system
80 installation from scratch), upgrading, and removal.
82 Program can be used in batch (like apt-get from Debian's APT) or
83 interactive mode. The interactive mode puts you into a readline
84 interface with command line autocompletion and history, similar to the
85 shell mode of Perl's CPAN.
87 %{?with_static:This version is statically linked.}
89 %{!?with_imode:This version hasn't got interactive mode.}
92 %description -l pl.UTF-8
93 poldek jest narzędziem linii poleceń służącym do weryfikacji,
94 instalacji (włączając instalację systemu od zera), aktualizacji i
97 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
98 interaktywnym. Tryb interaktywny posiada interfejs readline z
99 dopełnianiem komend i historią, podobny do trybu shell perlowego
102 %{?with_static:Ta wersja jest konsolidowana statycznie.}
104 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
107 Summary: poldek libraries
108 Summary(pl.UTF-8): Biblioteki poldka
114 %description libs -l pl.UTF-8
118 Summary: Header files for poldek libraries
119 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
120 Group: Development/Libraries
121 Requires: %{name}-libs = %{version}-%{release}
124 Header files for poldek libraries.
126 %description devel -l pl.UTF-8
127 Pliki nagłówkowe bibliotek poldka.
130 Summary: poldek static libraries
131 Summary(pl.UTF-8): Biblioteki statyczne poldka
132 Group: Development/Libraries
133 Requires: %{name}-devel = %{version}-%{release}
136 poldek static libraries.
138 %description static -l pl.UTF-8
139 Biblioteki statyczne poldka.
141 %package -n python-poldek
142 Summary: Python modules for poldek
143 Summary(pl.UTF-8): Moduły języka Python dla poldka
144 Group: Libraries/Python
145 Requires: %{name}-libs = %{version}-%{release}
146 %pyrequires_eq python-libs
148 %description -n python-poldek
149 Python modules for poldek.
151 %description -n python-poldek -l pl.UTF-8
152 Moduły języka Python dla poldka.
155 %setup -q -n %{name}-%{version}%{?_snap:-cvs%{_snap}}
168 # cleanup backups after patching
169 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
176 cp -f config.sub trurlib
179 %{?with_static:--enable-static --disable-shared} \
180 %{!?with_imode:--disable-imode} \
182 %{?with_python:--with-python}
186 rm -rf $RPM_BUILD_ROOT
187 install -d $RPM_BUILD_ROOT%{_sysconfdir}
190 DESTDIR=$RPM_BUILD_ROOT
193 %{__make} -C python install \
194 DESTDIR=$RPM_BUILD_ROOT \
198 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
200 %ifarch i486 i686 ppc sparc alpha athlon
201 %define _ftp_arch %{_target_cpu}
204 %define _ftp_arch x86_64
205 %define _ftp_alt_arch i686
208 %define _ftp_arch i486
210 %ifarch pentium2 pentium3 pentium4
211 %define _ftp_arch i686
213 %ifarch sparcv9 sparc64
214 %define _ftp_arch sparc
221 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
224 s|%%ARCH%%|%{_ftp_arch}|g
225 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
229 s|%%ARCH%%|%{_ftp_alt_arch}|g
230 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
233 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
235 # get rid of non-pld sources
236 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
237 # include them in %doc
240 rm -f configs/Makefile*
244 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
250 rm -rf $RPM_BUILD_ROOT
253 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
256 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
258 %post libs -p /sbin/ldconfig
259 %postun libs -p /sbin/ldconfig
261 %triggerpostun -- poldek <= 0.18.3-5
262 if [ -f /etc/poldek.conf ]; then
263 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
266 # otherwise don't touch
267 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
268 %triggerpostun -- poldek <= 0.18.7-1
269 if [ -f /etc/poldek.conf ]; then
270 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
274 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
275 if [ -f /etc/poldek.conf.rpmsave ]; then
284 if (sub(",noauto", "", name)) {
289 if (match(name, /,pri=[0-9]+/)) {
290 pri = substr(name, RSTART + 5, RLENGTH - 5);
291 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
294 # skip ac sources. already in new config.
295 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
298 print "name = " name;
299 print "type = " type;
300 print "path = " path;
301 print "auto = " auto;
302 print "autoup = " autoup;
308 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
309 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
312 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
314 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
318 %files -f %{name}.lang
319 %defattr(644,root,root,755)
320 %doc README* NEWS TODO configs/
321 %dir %{_sysconfdir}/%{name}
322 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
323 %attr(755,root,root) %{_bindir}/*
324 %dir %{_libdir}/%{name}
325 %attr(755,root,root) %{_libdir}/%{name}/*
326 %{_mandir}/man1/%{name}*
327 %lang(pl) %{_mandir}/pl/man1/%{name}*
328 %{_infodir}/poldek.info*
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
337 %defattr(644,root,root,755)
338 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
343 %defattr(644,root,root,755)
347 %files -n python-poldek
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
350 %{py_sitescriptdir}/poldek.py[co]
351 %{py_sitescriptdir}/poldekmod.py[co]