]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- added -reversed-prompt.patch (fixes #92)
[packages/poldek.git] / poldek.spec
CommitLineData
7638abfc 1#
de1099c4 2# Conditional build:
9fe14a3f 3%bcond_with static # don't use shared libraries
4%bcond_without imode # don't build interactive mode
58c31de0 5%bcond_without python # don't build python bindings
7638abfc 6#
373c6f03 7# required versions (forced to avoid SEGV with mixed db used by rpm and poldek)
5486bf2e
ER
8%define ver_db 4.3.27-1
9%define ver_rpm 4.4.9-1
10#
78b0cd64 11%define snap 20070703.00
8f76a487 12%define rel 14
b44549bf 13Summary: RPM packages management helper tool
9faf625a 14Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 15Name: poldek
bbc50e33 16Version: 0.21
78b0cd64 17Release: 0.%{snap}.%{rel}
9f931ada 18License: GPL v2
8efee472 19Group: Applications/System
78b0cd64 20Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
3dd29dc2 21# Source0-md5: dae23dec560fad954abf157fd250e4c3
911a8560 22Source1: %{name}.conf
b25cb9a7
JB
23Source2: %{name}-multilib.conf
24Source3: %{name}-aliases.conf
9e6ff4ef 25%if %{with imode}
26Source4: %{name}.desktop
27Source5: %{name}.png
28%endif
13aa6434
AM
29Patch1: %{name}-vserver-packages.patch
30Patch2: %{name}-config.patch
31Patch3: %{name}-multilib.patch
3fb676f2 32Patch4: %{name}-ndie_fix.patch
aee8a249 33Patch5: %{name}-uri-escape-fix.patch
f4531e03 34Patch6: %{name}-install-dist.patch
53e37858 35Patch7: %{name}-nohold-fix.patch
749b3447 36Patch8: %{name}-dir-dot.patch
683fa045 37Patch9: %{name}-suggests-one-package.patch
8f76a487 38Patch10: %{name}-reversed-prompt.patch
39ca2371 39URL: http://poldek.pld-linux.org/
a4268952 40BuildRequires: autoconf
b25cb9a7 41BuildRequires: automake
373c6f03 42BuildRequires: bzip2-devel
b25cb9a7 43BuildRequires: check
b1928c7a 44BuildRequires: db-devel >= %{ver_db}
c0d8905a 45BuildRequires: gettext-autopoint
b25cb9a7
JB
46BuildRequires: libtool
47BuildRequires: libxml2-devel
cbc6f56b 48BuildRequires: openssl-devel >= 0.9.7d
13fd950e 49BuildRequires: pcre-devel
f373d903 50BuildRequires: perl-tools-pod
b3ea4b51 51BuildRequires: pkgconfig
13fd950e 52BuildRequires: popt-devel
58c31de0 53%{?with_python:BuildRequires: python-devel}
b25cb9a7 54BuildRequires: readline-devel >= 5.0
373c6f03 55BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 56%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 57BuildRequires: xmlto
96475e5e 58BuildRequires: zlib-devel
373c6f03
JB
59%if %{with static}
60BuildRequires: bzip2-static
b1928c7a 61BuildRequires: db-static >= %{ver_db}
2fac0b02 62BuildRequires: glibc-static
acb26797 63BuildRequires: libselinux-static
b25cb9a7 64BuildRequires: libxml2-static
373c6f03
JB
65BuildRequires: ncurses-static
66BuildRequires: openssl-static
67BuildRequires: pcre-static
68BuildRequires: popt-static
69BuildRequires: readline-static
70BuildRequires: rpm-static
71BuildRequires: zlib-static
373c6f03 72%endif
b25cb9a7 73Requires(triggerpostun): awk
168acc54 74Requires(triggerpostun): sed >= 4.0
09d4c571 75Requires: %{name}-libs = %{version}-%{release}
b1928c7a 76Requires: db >= %{ver_db}
373c6f03 77Requires: rpm >= %{ver_rpm}
78b0cd64 78Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
e202a52a
ER
79# vf* scripts use sed
80Requires: sed
b44549bf 81BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82
83%description
0fa0dc36 84poldek is an RPM package management tool which allows you to easily
85perform package verification, installation (including system
13fd950e 86installation from scratch), upgrading, and removal.
0fa0dc36 87
13fd950e
JB
88Program can be used in batch (like apt-get from Debian's APT) or
89interactive mode. The interactive mode puts you into a readline
90interface with command line autocompletion and history, similar to the
91shell mode of Perl's CPAN.
8efee472 92
9fe14a3f 93%{?with_static:This version is statically linked.}
d94b28a6 94
9fe14a3f 95%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 96#'vim
1f84648f 97
caed9b36
JR
98%description -l pl.UTF-8
99poldek jest narzędziem linii poleceń służącym do weryfikacji,
100instalacji (włączając instalację systemu od zera), aktualizacji i
101usuwania pakietów.
56e1ab51 102
caed9b36 103Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 104interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
105dopełnianiem komend i historią, podobny do trybu shell perlowego
106modułu CPAN.
8efee472 107
9fe14a3f 108%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 109
9fe14a3f 110%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 111
b25cb9a7 112%package libs
168acc54 113Summary: poldek libraries
9faf625a 114Summary(pl.UTF-8): Biblioteki poldka
168acc54 115Group: Libraries
b25cb9a7
JB
116
117%description libs
118poldek libraries.
119
caed9b36 120%description libs -l pl.UTF-8
b25cb9a7
JB
121Biblioteki poldka.
122
123%package devel
168acc54 124Summary: Header files for poldek libraries
9faf625a 125Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 126Group: Development/Libraries
09d4c571 127Requires: %{name}-libs = %{version}-%{release}
b25cb9a7
JB
128
129%description devel
130Header files for poldek libraries.
131
caed9b36
JR
132%description devel -l pl.UTF-8
133Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
134
135%package static
168acc54 136Summary: poldek static libraries
9faf625a 137Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 138Group: Development/Libraries
09d4c571 139Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
140
141%description static
142poldek static libraries.
143
caed9b36 144%description static -l pl.UTF-8
b25cb9a7
JB
145Biblioteki statyczne poldka.
146
58c31de0
JB
147%package -n python-poldek
148Summary: Python modules for poldek
9faf625a 149Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
150Group: Libraries/Python
151Requires: %{name}-libs = %{version}-%{release}
152%pyrequires_eq python-libs
153
154%description -n python-poldek
155Python modules for poldek.
156
caed9b36
JR
157%description -n python-poldek -l pl.UTF-8
158Moduły języka Python dla poldka.
58c31de0 159
03159b71 160%prep
78b0cd64 161%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
13aa6434
AM
162%patch1 -p1
163%patch2 -p1
3375120c 164%ifarch %{x8664}
13aa6434 165%patch3 -p1
3375120c 166%endif
3fb676f2 167%patch4 -p0
aee8a249 168%patch5 -p0
f4531e03 169%patch6 -p1
53e37858 170%patch7 -p1
749b3447 171%patch8 -p1
683fa045 172%patch9 -p1
8f76a487 173%patch10 -p1
b44549bf 174
0579f9b7
ER
175# cleanup backups after patching
176find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
177
b44549bf 178%build
df3bea74 179%{__autopoint}
21a83253
MM
180%{__aclocal} -I m4
181%{__autoconf}
182%{__automake}
63bd61a7 183cp -f config.sub trurlib
b25cb9a7 184
1f84648f 185%configure \
b25cb9a7 186 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 187 %{!?with_imode:--disable-imode} \
58c31de0
JB
188 --enable-nls \
189 %{?with_python:--with-python}
03159b71 190%{__make}
8efee472 191
b44549bf 192%install
193rm -rf $RPM_BUILD_ROOT
23749bce 194install -d $RPM_BUILD_ROOT%{_sysconfdir}
8efee472 195
c8f7d829 196%{__make} install \
197 DESTDIR=$RPM_BUILD_ROOT
de1099c4 198
58c31de0
JB
199%if %{with python}
200%{__make} -C python install \
201 DESTDIR=$RPM_BUILD_ROOT \
202 libdir=%{py_sitedir}
203%endif
204
9fe14a3f 205%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 206
9639596f 207%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 208%define _ftp_arch %{_target_cpu}
209%else
9639596f 210%ifarch %{x8664}
590302c4 211%define _ftp_arch x86_64
b25cb9a7
JB
212%define _ftp_alt_arch i686
213%else
9639596f
PS
214%ifarch i586
215%define _ftp_arch i486
a49836bb 216%else
217%ifarch pentium2 pentium3 pentium4
218%define _ftp_arch i686
219%else
220%ifarch sparcv9 sparc64
221%define _ftp_arch sparc
222%endif
223%endif
224%endif
225%endif
b25cb9a7 226%endif
a49836bb 227
b25cb9a7 228%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 229
7adf66ff
ER
230sed -e '
231 s|%%ARCH%%|%{_ftp_arch}|g
232' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-source.conf
b44549bf 233
590302c4 234%ifarch %{x8664}
7adf66ff
ER
235sed '
236 s|%%ARCH%%|%{_ftp_alt_arch}|g
237' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pld-multilib-source.conf
b25cb9a7
JB
238%endif
239
240install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/aliases.conf
241
9e6ff4ef 242%if %{with imode}
243# add desktop file and icon
244install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
245install %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
246install %{SOURCE5} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
247%endif
248
b25cb9a7
JB
249# get rid of non-pld sources
250rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,fedora}-source.conf
251# include them in %doc
252rm -rf configs
253cp -a conf configs
254rm -f configs/Makefile*
255
62e80071 256%if %{with python}
58c31de0
JB
257%py_postclean
258rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 259%endif
58c31de0 260
b25cb9a7 261%find_lang %{name}
f373d903 262
b44549bf 263%clean
264rm -rf $RPM_BUILD_ROOT
265
3896c8b1
ER
266%post -p /sbin/postshell
267-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7 268
3896c8b1
ER
269%postun -p /sbin/postshell
270-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
271
272%post libs -p /sbin/ldconfig
273%postun libs -p /sbin/ldconfig
274
b25cb9a7
JB
275%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
276if [ -f /etc/poldek.conf.rpmsave ]; then
277 awk '/^source/ {
278 name = $3;
279 path = $4;
280 auto = "yes";
281 autoup = "yes";
282 type = "pdir";
f154dd55 283 pri = "";
b25cb9a7
JB
284
285 if (sub(",noauto", "", name)) {
286 auto = "no";
287 }
288
f154dd55
ER
289 # process pri=\d+
290 if (match(name, /,pri=[0-9]+/)) {
291 pri = substr(name, RSTART + 5, RLENGTH - 5);
292 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
293 }
294
b25cb9a7
JB
295 # skip ac sources. already in new config.
296 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
297 print "";
298 print "[source]";
299 print "name = " name;
300 print "type = " type;
301 print "path = " path;
302 print "auto = " auto;
303 print "autoup = " autoup;
f154dd55
ER
304 if (pri) {
305 print "pri = " pri;
306 }
b25cb9a7
JB
307 }
308
309 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 310 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
311
312 # copy hold=
313 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
314 if [ "$hold" ]; then
315 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
316 fi
317fi
318
767366b0 319%files -f %{name}.lang
b44549bf 320%defattr(644,root,root,755)
b25cb9a7
JB
321%doc README* NEWS TODO configs/
322%dir %{_sysconfdir}/%{name}
168acc54 323%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
8efee472 324%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
325%dir %{_libdir}/%{name}
326%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 327%{_mandir}/man1/%{name}*
d8826405 328%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 329%{_infodir}/poldek.info*
9e6ff4ef 330%if %{with imode}
331%{_desktopdir}/%{name}.desktop
332%{_pixmapsdir}/%{name}.png
333%endif
b25cb9a7 334
f8c7c6b5 335%if !%{with static}
b25cb9a7
JB
336%files libs
337%defattr(644,root,root,755)
338%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
339%endif
340
341%files devel
342%defattr(644,root,root,755)
343%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
344%{_libdir}/lib*.la
345%{_includedir}/*
346
347%files static
348%defattr(644,root,root,755)
349%{_libdir}/lib*.a
58c31de0
JB
350
351%if %{with python}
352%files -n python-poldek
353%defattr(644,root,root,755)
354%attr(755,root,root) %{py_sitedir}/_poldekmod.so
355%{py_sitescriptdir}/poldek.py[co]
356%{py_sitescriptdir}/poldekmod.py[co]
357%endif
This page took 0.103307 seconds and 4 git commands to generate.