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.3
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 URL: http://poldek.pld-linux.org/
27 BuildRequires: autoconf
28 BuildRequires: automake
29 BuildRequires: bzip2-devel
31 BuildRequires: db-devel >= %{ver_db}
32 BuildRequires: gettext-autopoint
33 BuildRequires: libtool
34 BuildRequires: libxml2-devel
35 BuildRequires: openssl-devel >= 0.9.7d
36 BuildRequires: pcre-devel
37 BuildRequires: perl-tools-pod
38 BuildRequires: popt-devel
39 %{?with_python:BuildRequires: python-devel}
40 BuildRequires: readline-devel >= 5.0
41 BuildRequires: rpm-devel >= %{ver_rpm}
43 BuildRequires: zlib-devel
45 BuildRequires: bzip2-static
46 BuildRequires: db-static >= %{ver_db}
47 BuildRequires: glibc-static
48 BuildRequires: libselinux-static
49 BuildRequires: libxml2-static
50 BuildRequires: ncurses-static
51 BuildRequires: openssl-static
52 BuildRequires: pcre-static
53 BuildRequires: popt-static
54 BuildRequires: readline-static
55 BuildRequires: rpm-static
56 BuildRequires: zlib-static
58 Requires(triggerpostun): awk
59 Requires(triggerpostun): sed >= 4.0
60 Requires: %{name}-libs = %{version}-%{release}
61 Requires: db >= %{ver_db}
62 Requires: rpm >= %{ver_rpm}
64 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 poldek is an RPM package management tool which allows you to easily
68 perform package verification, installation (including system
69 installation from scratch), upgrading, and removal.
71 Program can be used in batch (like apt-get from Debian's APT) or
72 interactive mode. The interactive mode puts you into a readline
73 interface with command line autocompletion and history, similar to the
74 shell mode of Perl's CPAN.
76 %{?with_static:This version is statically linked.}
78 %{!?with_imode:This version hasn't got interactive mode.}
81 %description -l pl.UTF-8
82 poldek jest narzędziem linii poleceń służącym do weryfikacji,
83 instalacji (włączając instalację systemu od zera), aktualizacji i
86 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
87 interaktywnym. Tryb interaktywny posiada interfejs readline z
88 dopełnianiem komend i historią, podobny do trybu shell perlowego
91 %{?with_static:Ta wersja jest konsolidowana statycznie.}
93 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
96 Summary: poldek libraries
97 Summary(pl.UTF-8): Biblioteki poldka
103 %description libs -l pl.UTF-8
107 Summary: Header files for poldek libraries
108 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
109 Group: Development/Libraries
110 Requires: %{name}-libs = %{version}-%{release}
113 Header files for poldek libraries.
115 %description devel -l pl.UTF-8
116 Pliki nagłówkowe bibliotek poldka.
119 Summary: poldek static libraries
120 Summary(pl.UTF-8): Biblioteki statyczne poldka
121 Group: Development/Libraries
122 Requires: %{name}-devel = %{version}-%{release}
125 poldek static libraries.
127 %description static -l pl.UTF-8
128 Biblioteki statyczne poldka.
130 %package -n python-poldek
131 Summary: Python modules for poldek
132 Summary(pl.UTF-8): Moduły języka Python dla poldka
133 Group: Libraries/Python
134 Requires: %{name}-libs = %{version}-%{release}
135 %pyrequires_eq python-libs
137 %description -n python-poldek
138 Python modules for poldek.
140 %description -n python-poldek -l pl.UTF-8
141 Moduły języka Python dla poldka.
144 %setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
156 cp -f config.sub trurlib
159 %{?with_static:--enable-static --disable-shared} \
160 %{!?with_imode:--disable-imode} \
162 %{?with_python:--with-python}
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT%{_sysconfdir}
170 DESTDIR=$RPM_BUILD_ROOT
173 %{__make} -C python install \
174 DESTDIR=$RPM_BUILD_ROOT \
178 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
180 %ifarch i486 i686 ppc sparc alpha athlon
181 %define _ftp_arch %{_target_cpu}
184 %define _ftp_arch x86_64
185 %define _ftp_alt_arch i686
188 %define _ftp_arch i486
190 %ifarch pentium2 pentium3 pentium4
191 %define _ftp_arch i686
193 %ifarch sparcv9 sparc64
194 %define _ftp_arch sparc
201 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
204 s|%%ARCH%%|%{_ftp_arch}|g
205 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
209 s|%%ARCH%%|%{_ftp_alt_arch}|g
210 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
213 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
215 # get rid of non-pld sources
216 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
217 # include them in %doc
220 rm -f configs/Makefile*
224 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
230 rm -rf $RPM_BUILD_ROOT
233 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
236 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
238 %post libs -p /sbin/ldconfig
239 %postun libs -p /sbin/ldconfig
241 %triggerpostun -- poldek <= 0.18.3-5
242 if [ -f /etc/poldek.conf ]; then
243 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
246 # otherwise don't touch
247 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
248 %triggerpostun -- poldek <= 0.18.7-1
249 if [ -f /etc/poldek.conf ]; then
250 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
254 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
255 if [ -f /etc/poldek.conf.rpmsave ]; then
264 if (sub(",noauto", "", name)) {
269 if (match(name, /,pri=[0-9]+/)) {
270 pri = substr(name, RSTART + 5, RLENGTH - 5);
271 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
274 # skip ac sources. already in new config.
275 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
278 print "name = " name;
279 print "type = " type;
280 print "path = " path;
281 print "auto = " auto;
282 print "autoup = " autoup;
288 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
289 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
292 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
294 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
298 %files -f %{name}.lang
299 %defattr(644,root,root,755)
300 %doc README* NEWS TODO configs/
301 %dir %{_sysconfdir}/%{name}
302 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
303 %attr(755,root,root) %{_bindir}/*
304 %dir %{_libdir}/%{name}
305 %attr(755,root,root) %{_libdir}/%{name}/*
306 %{_mandir}/man1/%{name}*
307 %lang(pl) %{_mandir}/pl/man1/%{name}*
308 %{_infodir}/poldek.info*
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
317 %defattr(644,root,root,755)
318 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
323 %defattr(644,root,root,755)
327 %files -n python-poldek
328 %defattr(644,root,root,755)
329 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
330 %{py_sitescriptdir}/poldek.py[co]
331 %{py_sitescriptdir}/poldekmod.py[co]