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
10 Summary: RPM packages management helper tool
11 Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
16 Group: Applications/System
17 Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{_snap}.tar.bz2
18 # Source0-md5: dae23dec560fad954abf157fd250e4c3
20 Source2: %{name}-multilib.conf
21 Source3: %{name}-aliases.conf
22 Patch1: %{name}-vserver-packages.patch
23 Patch2: %{name}-config.patch
24 Patch3: %{name}-multilib.patch
25 Patch4: %{name}-ndie_fix.patch
26 Patch5: %{name}-uri-escape-fix.patch
27 Patch6: %{name}-install-dist.patch
28 Patch7: %{name}-nohold-fix.patch
29 Patch8: %{name}-dir-dot.patch
30 Patch9: %{name}-suggests-one-package.patch
31 URL: http://poldek.pld-linux.org/
32 BuildRequires: autoconf
33 BuildRequires: automake
34 BuildRequires: bzip2-devel
36 BuildRequires: db-devel >= %{ver_db}
37 BuildRequires: gettext-autopoint
38 BuildRequires: libtool
39 BuildRequires: libxml2-devel
40 BuildRequires: openssl-devel >= 0.9.7d
41 BuildRequires: pcre-devel
42 BuildRequires: perl-tools-pod
43 BuildRequires: pkgconfig
44 BuildRequires: popt-devel
45 %{?with_python:BuildRequires: python-devel}
46 BuildRequires: readline-devel >= 5.0
47 BuildRequires: rpm-devel >= %{ver_rpm}
48 %{?with_python:BuildRequires: rpm-pythonprov}
49 BuildRequires: sed >= 4.0
51 BuildRequires: zlib-devel
53 BuildRequires: bzip2-static
54 BuildRequires: db-static >= %{ver_db}
55 BuildRequires: glibc-static
56 BuildRequires: libselinux-static
57 BuildRequires: libxml2-static
58 BuildRequires: ncurses-static
59 BuildRequires: openssl-static
60 BuildRequires: pcre-static
61 BuildRequires: popt-static
62 BuildRequires: readline-static
63 BuildRequires: rpm-static
64 BuildRequires: zlib-static
66 Requires(triggerpostun): awk
67 Requires(triggerpostun): sed >= 4.0
68 Requires: %{name}-libs = %{version}-%{release}
69 Requires: db >= %{ver_db}
70 Requires: openssl >= 0.9.7d
71 Requires: rpm >= %{ver_rpm}
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
77 poldek is an RPM package management tool which allows you to easily
78 perform package verification, installation (including system
79 installation from scratch), upgrading, and removal.
81 Program can be used in batch (like apt-get from Debian's APT) or
82 interactive mode. The interactive mode puts you into a readline
83 interface with command line autocompletion and history, similar to the
84 shell mode of Perl's CPAN.
86 %{?with_static:This version is statically linked.}
88 %{!?with_imode:This version hasn't got interactive mode.}
91 %description -l pl.UTF-8
92 poldek jest narzędziem linii poleceń służącym do weryfikacji,
93 instalacji (włączając instalację systemu od zera), aktualizacji i
96 Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
97 interaktywnym. Tryb interaktywny posiada interfejs readline z
98 dopełnianiem komend i historią, podobny do trybu shell perlowego
101 %{?with_static:Ta wersja jest konsolidowana statycznie.}
103 %{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
106 Summary: poldek libraries
107 Summary(pl.UTF-8): Biblioteki poldka
113 %description libs -l pl.UTF-8
117 Summary: Header files for poldek libraries
118 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
119 Group: Development/Libraries
120 Requires: %{name}-libs = %{version}-%{release}
123 Header files for poldek libraries.
125 %description devel -l pl.UTF-8
126 Pliki nagłówkowe bibliotek poldka.
129 Summary: poldek static libraries
130 Summary(pl.UTF-8): Biblioteki statyczne poldka
131 Group: Development/Libraries
132 Requires: %{name}-devel = %{version}-%{release}
135 poldek static libraries.
137 %description static -l pl.UTF-8
138 Biblioteki statyczne poldka.
140 %package -n python-poldek
141 Summary: Python modules for poldek
142 Summary(pl.UTF-8): Moduły języka Python dla poldka
143 Group: Libraries/Python
144 Requires: %{name}-libs = %{version}-%{release}
145 %pyrequires_eq python-libs
147 %description -n python-poldek
148 Python modules for poldek.
150 %description -n python-poldek -l pl.UTF-8
151 Moduły języka Python dla poldka.
154 %setup -q -n %{name}-%{version}%{?_snap:-cvs%{_snap}}
167 # cleanup backups after patching
168 find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
175 cp -f config.sub trurlib
178 %{?with_static:--enable-static --disable-shared} \
179 %{!?with_imode:--disable-imode} \
181 %{?with_python:--with-python}
185 rm -rf $RPM_BUILD_ROOT
186 install -d $RPM_BUILD_ROOT%{_sysconfdir}
189 DESTDIR=$RPM_BUILD_ROOT
192 %{__make} -C python install \
193 DESTDIR=$RPM_BUILD_ROOT \
197 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
199 %ifarch i386 i586 i686 ppc sparc alpha athlon
200 %define _ftp_arch %{_target_cpu}
203 %define _ftp_arch amd64
204 %define _ftp_alt_arch i686
207 %define _ftp_arch i386
209 %ifarch pentium2 pentium3 pentium4
210 %define _ftp_arch i686
212 %ifarch sparcv9 sparc64
213 %define _ftp_arch sparc
220 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
223 s|%%ARCH%%|%{_ftp_arch}|g
224 ' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
228 s|%%ARCH%%|%{_ftp_alt_arch}|g
229 ' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
232 install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
234 # get rid of non-pld sources
235 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
236 # include them in %doc
239 rm -f configs/Makefile*
243 rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
249 rm -rf $RPM_BUILD_ROOT
252 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
255 [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
257 %post libs -p /sbin/ldconfig
258 %postun libs -p /sbin/ldconfig
260 %triggerpostun -- poldek <= 0.18.3-5
261 if [ -f /etc/poldek.conf ]; then
262 sed -i -e '/^promoteepoch:.*yes/s/^/#/' /etc/poldek.conf
265 # otherwise don't touch
266 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
267 %triggerpostun -- poldek <= 0.18.7-1
268 if [ -f /etc/poldek.conf ]; then
269 sed -i -e 's://ftp.pld-linux.org://ftp.ac.pld-linux.org:g' /etc/poldek.conf
273 %triggerpostun -- poldek < 0.19.0-1.20050613.22.0
274 if [ -f /etc/poldek.conf.rpmsave ]; then
283 if (sub(",noauto", "", name)) {
288 if (match(name, /,pri=[0-9]+/)) {
289 pri = substr(name, RSTART + 5, RLENGTH - 5);
290 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
293 # skip ac sources. already in new config.
294 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
297 print "name = " name;
298 print "type = " type;
299 print "path = " path;
300 print "auto = " auto;
301 print "autoup = " autoup;
307 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
308 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
311 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
313 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
317 %files -f %{name}.lang
318 %defattr(644,root,root,755)
319 %doc README* NEWS TODO configs/
320 %dir %{_sysconfdir}/%{name}
321 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
322 %attr(755,root,root) %{_bindir}/*
323 %dir %{_libdir}/%{name}
324 %attr(755,root,root) %{_libdir}/%{name}/*
325 %{_mandir}/man1/%{name}*
326 %lang(pl) %{_mandir}/pl/man1/%{name}*
327 %{_infodir}/poldek.info*
331 %defattr(644,root,root,755)
332 %attr(755,root,root) %{_libdir}/lib*.so.*.*.*
336 %defattr(644,root,root,755)
337 %{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
342 %defattr(644,root,root,755)
346 %files -n python-poldek
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{py_sitedir}/_poldekmod.so
349 %{py_sitescriptdir}/poldek.py[co]
350 %{py_sitescriptdir}/poldekmod.py[co]