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
10 %define snap 20070108.22
11 Summary: RPM packages management helper tool
12 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
15 Release: 0.20070108.1.4
17 Group: Applications/System
18 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
19 # Source0-md5: 47025233d8ebb7082567cbf1392cf16f
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}-configure_in.patch
27 Patch5: %{name}-rpm-4.4.8.patch
28 URL: http://poldek.pld-linux.org/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: bzip2-devel
33 BuildRequires: db-devel >= %{ver_db}
34 BuildRequires: gettext-autopoint
35 BuildRequires: libtool
36 BuildRequires: libxml2-devel
37 BuildRequires: openssl-devel >= 0.9.7d
38 BuildRequires: pcre-devel
39 BuildRequires: perl-tools-pod
40 BuildRequires: popt-devel
41 %{?with_python:BuildRequires: python-devel}
42 BuildRequires: readline-devel >= 5.0
43 BuildRequires: rpm-devel >= %{ver_rpm}
45 BuildRequires: zlib-devel
47 BuildRequires: bzip2-static
48 BuildRequires: db-static >= %{ver_db}
49 BuildRequires: glibc-static
50 BuildRequires: libselinux-static
51 BuildRequires: libxml2-static
52 BuildRequires: ncurses-static
53 BuildRequires: openssl-static
54 BuildRequires: pcre-static
55 BuildRequires: popt-static
56 BuildRequires: readline-static
57 BuildRequires: rpm-static
58 BuildRequires: zlib-static
60 Requires(triggerpostun): awk
61 Requires(triggerpostun): sed >= 4.0
62 Requires: %{name}-libs = %{version}-%{release}
63 Requires: db >= %{ver_db}
64 Requires: rpm >= %{ver_rpm}
66 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
69 poldek is an RPM package management tool which allows you to easily
70 perform package verification, installation (including system
71 installation from scratch), upgrading, and removal.
73 Program can be used in batch (like apt-get from Debian's APT) or
74 interactive mode. The interactive mode puts you into a readline
75 interface with command line autocompletion and history, similar to the
76 shell mode of Perl's CPAN.
78 %{?with_static:This version is statically linked.}
80 %{!?with_imode:This version hasn't got interactive mode.}
83 %description -l pl.UTF-8
84 poldek jest narzędziem linii poleceń służącym do weryfikacji,
85 instalacji (włączając instalację systemu od zera), aktualizacji i
88 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
89 interaktywnym. Tryb interaktywny posiada interfejs readline z
90 dopełnianiem komend i historią, podobny do trybu shell perlowego
93 %{?with_static:Ta wersja jest konsolidowana statycznie.}
95 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
98 Summary: poldek libraries
99 Summary(pl.UTF-8): Biblioteki poldka
105 %description libs -l pl.UTF-8
109 Summary: Header files for poldek libraries
110 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
111 Group: Development/Libraries
112 Requires: %{name}-libs = %{version}-%{release}
115 Header files for poldek libraries.
117 %description devel -l pl.UTF-8
118 Pliki nagłówkowe bibliotek poldka.
121 Summary: poldek static libraries
122 Summary(pl.UTF-8): Biblioteki statyczne poldka
123 Group: Development/Libraries
124 Requires: %{name}-devel = %{version}-%{release}
127 poldek static libraries.
129 %description static -l pl.UTF-8
130 Biblioteki statyczne poldka.
132 %package -n python-poldek
133 Summary: Python modules for poldek
134 Summary(pl.UTF-8): Moduły języka Python dla poldka
135 Group: Libraries/Python
136 Requires: %{name}-libs = %{version}-%{release}
137 %pyrequires_eq python-libs
139 %description -n python-poldek
140 Python modules for poldek.
142 %description -n python-poldek -l pl.UTF-8
143 Moduły języka Python dla poldka.
146 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
160 cp -f config.sub trurlib
163 %{?with_static:--enable-static --disable-shared} \
164 %{!?with_imode:--disable-imode} \
166 %{?with_python:--with-python}
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT%{_sysconfdir}
174 DESTDIR=$RPM_BUILD_ROOT
177 %{__make} -C python install \
178 DESTDIR=$RPM_BUILD_ROOT \
182 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
184 %ifarch i486 i686 ppc sparc alpha athlon
185 %define _ftp_arch %{_target_cpu}
188 %define _ftp_arch x86_64
189 %define _ftp_alt_arch i686
192 %define _ftp_arch i486
194 %ifarch pentium2 pentium3 pentium4
195 %define _ftp_arch i686
197 %ifarch sparcv9 sparc64
198 %define _ftp_arch sparc
205 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
208 s|%%ARCH%%|%{_ftp_arch}|g
209 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
213 s|%%ARCH%%|%{_ftp_alt_arch}|g
214 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
217 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
219 # get rid of non-pld sources
220 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
221 # include them in %doc
224 rm -f configs/Makefile*
228 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
234 rm -rf $RPM_BUILD_ROOT
237 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
240 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
242 %post libs -p /sbin/ldconfig
243 %postun libs -p /sbin/ldconfig
245 %triggerpostun -- poldek <= 0.18.3-5
246 if [ -f /etc/poldek.conf ]; then
247 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
250 # otherwise don't touch
251 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
252 %triggerpostun -- poldek <= 0.18.7-1
253 if [ -f /etc/poldek.conf ]; then
254 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
258 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
259 if [ -f /etc/poldek.conf.rpmsave ]; then
268 if (sub(",noauto", "", name)) {
273 if (match(name, /,pri=[0-9]+/)) {
274 pri = substr(name, RSTART + 5, RLENGTH - 5);
275 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
278 # skip ac sources. already in new config.
279 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
282 print "name = " name;
283 print "type = " type;
284 print "path = " path;
285 print "auto = " auto;
286 print "autoup = " autoup;
292 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
293 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
296 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
298 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
302 %files -f %{name}.lang
303 %defattr(644,root,root,755)
304 %doc README* NEWS TODO configs/
305 %dir %{_sysconfdir}/%{name}
306 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
307 %attr(755,root,root) %{_bindir}/*
308 %dir %{_libdir}/%{name}
309 %attr(755,root,root) %{_libdir}/%{name}/*
310 %{_mandir}/man1/%{name}*
311 %lang(pl) %{_mandir}/pl/man1/%{name}*
312 %{_infodir}/poldek.info*
316 %defattr(644,root,root,755)
317 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
321 %defattr(644,root,root,755)
322 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
327 %defattr(644,root,root,755)
331 %files -n python-poldek
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
334 %{py_sitescriptdir}/poldek.py[co]
335 %{py_sitescriptdir}/poldekmod.py[co]