3 %bcond_with static # don't use shared libraries
4 %bcond_without imode # don't build interactive mode
5 %bcond_with curl # link with curl
6 %bcond_with distver # enable distversion patch
8 # required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
9 %define ver_db 4.2.50-1
10 %define ver_rpm 4.3-0.20040107.34
11 Summary: RPM packages management helper tool
12 Summary(pl): Pomocnicze narzêdzie do zarz±dzania pakietami RPM
15 Release: 6%{?with_distver:+distver}
17 Group: Applications/System
18 Source0: http://team.pld.org.pl/~mis/poldek/download/%{name}-%{version}.tar.bz2
19 # Source0-md5: 42830ed55809e41059771b87131a84fd
21 Patch0: %{name}-etc_dir.patch
22 Patch1: %{name}-retr_term.patch
23 Patch2: %{name}-simplestatic.patch
24 Patch3: %{name}-po.patch
25 Patch4: %{name}-n_free.patch
26 Patch5: %{name}-transfer_rate.patch
27 Patch6: %{name}-capreq.patch
28 Patch7: %{name}-fix_ls_output.patch
29 Patch8: %{name}-depfix-pkgdrags.patch
30 Patch12: %{name}-distver.patch
31 URL: http://team.pld.org.pl/~mis/poldek/
32 BuildRequires: automake
33 BuildRequires: autoconf
34 BuildRequires: bzip2-devel
35 %{?with_curl:BuildRequires: curl-devel >= 7.8}
36 BuildRequires: db-devel >= %{ver_db}
37 BuildRequires: gettext-autopoint
38 BuildRequires: openssl-devel >= 0.9.7d
39 BuildRequires: pcre-devel
40 BuildRequires: popt-devel
41 BuildRequires: readline-devel
42 BuildRequires: rpm-devel >= %{ver_rpm}
43 BuildRequires: zlib-devel
44 BuildRequires: perl-tools-pod
46 BuildRequires: bzip2-static
47 %{?with_curl:BuildRequires: curl-static}
48 BuildRequires: db-static >= %{ver_db}
49 BuildRequires: glibc-static
50 BuildRequires: libselinux-static
51 BuildRequires: ncurses-static
52 BuildRequires: openssl-static
53 BuildRequires: pcre-static
54 BuildRequires: popt-static
55 BuildRequires: readline-static
56 BuildRequires: rpm-static
57 BuildRequires: zlib-static
59 Requires: db >= %{ver_db}
61 Requires: rpm >= %{ver_rpm}
62 %{?with_distver:Requires: rpm-lib(distver)}
64 Requires: openssl >= 0.9.7c
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68 poldek is an RPM package management tool which allows you to easily
69 perform package verification, installation (including system
70 installation from scratch), upgrading, and removal.
72 Program can be used in batch (like apt-get from Debian's APT) or
73 interactive mode. The interactive mode puts you into a readline
74 interface with command line autocompletion and history, similar to the
75 shell mode of Perl's CPAN.
77 %{?with_static:This version is statically linked.}
79 %{!?with_imode:This version hasn't got interactive mode.}
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.}
106 %{?with_distver:%patch12 -p1}
113 cp -f config.sub trurlib
115 %{?with_static:--enable-static} \
116 %{!?with_imode:--disable-imode} \
117 %{?with_curl:--with-curl}
121 rm -rf $RPM_BUILD_ROOT
122 install -d $RPM_BUILD_ROOT%{_sysconfdir}
125 DESTDIR=$RPM_BUILD_ROOT
127 %{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
130 # CHANGE IT WHEN SWITCHING poldek.conf FROM AC TO TH !!!
132 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
133 %define _ftp_arch %{_target_cpu}
136 %define _ftp_arch i386
138 %ifarch pentium2 pentium3 pentium4
139 %define _ftp_arch i686
141 %ifarch sparcv9 sparc64
142 %define _ftp_arch sparc
148 sed "s|%%ARCH%%|%{_ftp_arch}|g" < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
153 rm -rf $RPM_BUILD_ROOT
155 %triggerpostun -- poldek <= 0.18.3-5
156 if grep -q '^promoteepoch.*yes' %{_sysconfdir}/poldek.conf ; then
157 echo -e ',s:^promoteepoch:# promoteepoch:g\n,w' | ed -s %{_sysconfdir}/poldek.conf
160 # otherwise don't touch
161 %ifarch i386 i586 i686 ppc sparc alpha amd64 athlon
162 %triggerpostun -- poldek <= 0.18.7-1
163 echo -e ',s://ftp.pld-linux.org://ftp.%{_target_cpu}.ac.pld-linux.org:g\n,w' |\
164 ed -s /etc/poldek.conf ||:
167 %files -f %{name}.lang
168 %defattr(644,root,root,755)
169 %doc README* NEWS TODO *sample* conf/poldekrc*
170 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/%{name}.conf
171 %attr(755,root,root) %{_bindir}/*
172 %{_mandir}/man1/%{name}*
173 %lang(pl) %{_mandir}/pl/man1/%{name}*