]> git.pld-linux.org Git - packages/poldek.git/blame - poldek.spec
- no use of kernel pkgs on multilib by default
[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)
4d7ffb0a 8%if "%{pld_release}" == "ti"
530c8c41 9%define ver_db 4.5.20
473ce98d 10%define ver_db_rel 8
4d7ffb0a 11%else
530c8c41 12%define ver_db 4.7.25
473ce98d 13%define ver_db_rel 1
4d7ffb0a 14%endif
2b6db74f 15%define ver_rpm 4.5-5
5486bf2e 16#
04a91ad3 17%define snap 20080820.23
66375104 18%define rel 31
b44549bf 19Summary: RPM packages management helper tool
9faf625a 20Summary(pl.UTF-8): Pomocnicze narzędzie do zarządzania pakietami RPM
b44549bf 21Name: poldek
24ad8b8d 22Version: 0.30
40ae4011 23Release: 0.%{snap}.%{rel}
9f931ada 24License: GPL v2
8efee472 25Group: Applications/System
85398bac 26#Source0: http://poldek.pld-linux.org/download/snapshots/%{name}-%{version}-cvs%{snap}.tar.bz2
c0898992 27Source0: http://carme.pld-linux.org/~megabajt/snaps/poldek/%{name}-%{version}-cvs%{snap}.tar.bz2
04a91ad3 28# Source0-md5: 2738eb3996f1cdf1e5d74b913d6e7414
911a8560 29Source1: %{name}.conf
b25cb9a7 30Source2: %{name}-multilib.conf
2ccd5d66 31Source3: %{name}-ti.conf
32Source4: %{name}-multilib-ti.conf
33Source5: %{name}-aliases.conf
34Source6: %{name}.desktop
35Source7: %{name}.png
171e07f6 36Source8: %{name}-debuginfo.conf
652b5bc5 37Source9: %{name}-aidath.conf
38Source10: %{name}-multilib-aidath.conf
85398bac
MB
39Patch0: %{name}-vserver-packages.patch
40Patch1: %{name}-config.patch
41Patch2: %{name}-abort-on-upgrade.patch
04a91ad3
MB
42Patch3: %{name}-inline.patch
43Patch4: %{name}-ls-llu.patch
44Patch5: %{name}-op-ldalldesc.patch
25838a54 45Patch6: %{name}-nocolor-upgrade.patch
f4114128
ER
46Patch7: %{name}-upgrade-dist.patch
47Patch8: %{name}-keep-reinstalled-provides.patch
bf43a3ac 48Patch9: %{name}-dont-ask-for-suggests-on-errors.patch
c7d7bdf5 49Patch10: %{name}-crash-on-invalid-locale.patch
149abeda 50Patch11: %{name}-noutf8.patch
f031015c 51Patch12: %{name}-dont-suggests-required-packages.patch
05e22a22 52Patch13: %{name}-tty-for-erasures.patch
c756c410 53Patch14: %{name}-both_langs.patch
20ff11b6 54Patch15: %{name}-317130.patch
d0d294bd 55Patch16: %{name}-321546.patch
f76d4526
PZ
56Patch17: %{name}-size-type.patch
57Patch18: %{name}-no-inlines.patch
a483213a 58Patch19: %{name}-export-missing-symbol.patch
fb2a8800 59Patch20: %{name}-skip-suggests-on-upgrade.patch
8f2fba8c 60Patch21: %{name}-po.patch
b9baa977 61Patch22: %{name}-refcnt.patch
20b92beb 62Patch23: %{name}-assertion-failed.patch
3e69de12 63Patch24: %{name}-unescape-urlencoded-strings.patch
39ca2371 64URL: http://poldek.pld-linux.org/
a4268952 65BuildRequires: autoconf
b25cb9a7 66BuildRequires: automake
373c6f03 67BuildRequires: bzip2-devel
b25cb9a7 68BuildRequires: check
530c8c41 69BuildRequires: db-devel >= %{ver_db}-%{ver_db_rel}
c0d8905a 70BuildRequires: gettext-autopoint
b25cb9a7
JB
71BuildRequires: libtool
72BuildRequires: libxml2-devel
cbc6f56b 73BuildRequires: openssl-devel >= 0.9.7d
13fd950e 74BuildRequires: pcre-devel
f373d903 75BuildRequires: perl-tools-pod
b3ea4b51 76BuildRequires: pkgconfig
13fd950e 77BuildRequires: popt-devel
58c31de0 78%{?with_python:BuildRequires: python-devel}
b25cb9a7 79BuildRequires: readline-devel >= 5.0
373c6f03 80BuildRequires: rpm-devel >= %{ver_rpm}
300927eb 81%{?with_python:BuildRequires: rpm-pythonprov}
282cfaec 82BuildRequires: xmlto
96475e5e 83BuildRequires: zlib-devel
373c6f03
JB
84%if %{with static}
85BuildRequires: bzip2-static
530c8c41 86BuildRequires: db-static >= %{ver_db}-%{ver_db_rel}
2fac0b02 87BuildRequires: glibc-static
acb26797 88BuildRequires: libselinux-static
b25cb9a7 89BuildRequires: libxml2-static
373c6f03
JB
90BuildRequires: ncurses-static
91BuildRequires: openssl-static
92BuildRequires: pcre-static
93BuildRequires: popt-static
94BuildRequires: readline-static
95BuildRequires: rpm-static
96BuildRequires: zlib-static
373c6f03 97%endif
b25cb9a7 98Requires(triggerpostun): awk
168acc54 99Requires(triggerpostun): sed >= 4.0
09d4c571 100Requires: %{name}-libs = %{version}-%{release}
530c8c41 101Requires: db >= %{ver_db}-%{ver_db_rel}
373c6f03 102Requires: rpm >= %{ver_rpm}
530c8c41 103Requires: rpm-db-ver = %{ver_db}
78b0cd64 104Requires: rpm-lib = %(rpm -q --qf '%{V}' rpm-lib)
e202a52a
ER
105# vf* scripts use sed
106Requires: sed
b44549bf 107BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
108
109%description
0fa0dc36 110poldek is an RPM package management tool which allows you to easily
111perform package verification, installation (including system
13fd950e 112installation from scratch), upgrading, and removal.
0fa0dc36 113
13fd950e
JB
114Program can be used in batch (like apt-get from Debian's APT) or
115interactive mode. The interactive mode puts you into a readline
116interface with command line autocompletion and history, similar to the
117shell mode of Perl's CPAN.
8efee472 118
9fe14a3f 119%{?with_static:This version is statically linked.}
d94b28a6 120
9fe14a3f 121%{!?with_imode:This version hasn't got interactive mode.}
7f07e487 122#'vim
1f84648f 123
caed9b36
JR
124%description -l pl.UTF-8
125poldek jest narzędziem linii poleceń służącym do weryfikacji,
126instalacji (włączając instalację systemu od zera), aktualizacji i
127usuwania pakietów.
56e1ab51 128
caed9b36 129Program może być używany w trybie wsadowym (jak debianowy apt-get) lub
d82a9cb2 130interaktywnym. Tryb interaktywny posiada interfejs readline z
caed9b36
JR
131dopełnianiem komend i historią, podobny do trybu shell perlowego
132modułu CPAN.
8efee472 133
9fe14a3f 134%{?with_static:Ta wersja jest konsolidowana statycznie.}
a611e0bc 135
9fe14a3f 136%{!?with_imode:Ta wersja nie posiada trybu interaktywnego.}
b44549bf 137
b25cb9a7 138%package libs
168acc54 139Summary: poldek libraries
9faf625a 140Summary(pl.UTF-8): Biblioteki poldka
168acc54 141Group: Libraries
b25cb9a7
JB
142
143%description libs
144poldek libraries.
145
caed9b36 146%description libs -l pl.UTF-8
b25cb9a7
JB
147Biblioteki poldka.
148
149%package devel
168acc54 150Summary: Header files for poldek libraries
9faf625a 151Summary(pl.UTF-8): Pliki nagłówkowe bibliotek poldka
168acc54 152Group: Development/Libraries
09d4c571 153Requires: %{name}-libs = %{version}-%{release}
b980560b 154Requires: rpm-devel >= %{ver_rpm}
b25cb9a7
JB
155
156%description devel
157Header files for poldek libraries.
158
caed9b36
JR
159%description devel -l pl.UTF-8
160Pliki nagłówkowe bibliotek poldka.
b25cb9a7
JB
161
162%package static
168acc54 163Summary: poldek static libraries
9faf625a 164Summary(pl.UTF-8): Biblioteki statyczne poldka
168acc54 165Group: Development/Libraries
09d4c571 166Requires: %{name}-devel = %{version}-%{release}
b25cb9a7
JB
167
168%description static
169poldek static libraries.
170
caed9b36 171%description static -l pl.UTF-8
b25cb9a7
JB
172Biblioteki statyczne poldka.
173
58c31de0
JB
174%package -n python-poldek
175Summary: Python modules for poldek
9faf625a 176Summary(pl.UTF-8): Moduły języka Python dla poldka
58c31de0
JB
177Group: Libraries/Python
178Requires: %{name}-libs = %{version}-%{release}
179%pyrequires_eq python-libs
180
181%description -n python-poldek
182Python modules for poldek.
183
caed9b36
JR
184%description -n python-poldek -l pl.UTF-8
185Moduły języka Python dla poldka.
58c31de0 186
03159b71 187%prep
78b0cd64 188%setup -q -n %{name}-%{version}%{?snap:-cvs%{snap}}
85398bac 189%patch0 -p1
13aa6434
AM
190%patch1 -p1
191%patch2 -p1
04a91ad3 192%patch3 -p1
2a61c5d4 193%patch4 -p1
c826891f 194%patch5 -p1
25838a54 195%patch6 -p0
f4114128
ER
196%patch7 -p0
197%patch8 -p0
bf43a3ac 198%patch9 -p0
c7d7bdf5 199%patch10 -p1
22858076 200%patch11 -p1
f031015c 201%patch12 -p1
05e22a22 202%patch13 -p1
c756c410 203%patch14 -p1
20ff11b6 204%patch15 -p1
d0d294bd 205%patch16 -p1
f76d4526
PZ
206%patch17 -p1
207%patch18 -p1
a483213a 208%patch19 -p0
fb2a8800 209%patch20 -p1
8f2fba8c 210%patch21 -p1
b9baa977 211%patch22 -p0
20b92beb 212%patch23 -p1
3e69de12 213%patch24 -p1
b44549bf 214
0579f9b7
ER
215# cleanup backups after patching
216find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
217
b44549bf 218%build
bef9d2a3 219%{__libtoolize}
21a83253
MM
220%{__aclocal} -I m4
221%{__autoconf}
222%{__automake}
63bd61a7 223cp -f config.sub trurlib
b25cb9a7 224
97ecf213 225CPPFLAGS="-std=gnu99"
1f84648f 226%configure \
b25cb9a7 227 %{?with_static:--enable-static --disable-shared} \
9fe14a3f 228 %{!?with_imode:--disable-imode} \
58c31de0
JB
229 --enable-nls \
230 %{?with_python:--with-python}
03159b71 231%{__make}
8efee472 232
b44549bf 233%install
234rm -rf $RPM_BUILD_ROOT
08335479 235install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d
8efee472 236
c8f7d829 237%{__make} install \
238 DESTDIR=$RPM_BUILD_ROOT
de1099c4 239
58c31de0
JB
240%if %{with python}
241%{__make} -C python install \
242 DESTDIR=$RPM_BUILD_ROOT \
243 libdir=%{py_sitedir}
244%endif
245
9fe14a3f 246%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
a49836bb 247
9639596f 248%ifarch i486 i686 ppc sparc alpha athlon
a49836bb 249%define _ftp_arch %{_target_cpu}
36004ea3 250%endif
9639596f 251%ifarch %{x8664}
590302c4 252%define _ftp_arch x86_64
b25cb9a7 253%define _ftp_alt_arch i686
36004ea3 254%endif
9639596f 255%ifarch i586
58820d9b 256%if "%{pld_release}" == "ti"
257%define _ftp_arch i586
258%else
9639596f 259%define _ftp_arch i486
36004ea3 260%endif
58820d9b 261%endif
a49836bb 262%ifarch pentium2 pentium3 pentium4
263%define _ftp_arch i686
36004ea3 264%endif
a49836bb 265%ifarch sparcv9 sparc64
266%define _ftp_arch sparc
652b5bc5 267%if "%{pld_release}" == "th"
268%define _ftp_arch %{_target_cpu}
269%ifarch sparc64
270%define _ftp_alt_arch sparcv9
271%endif
272%endif
a49836bb 273%endif
a49836bb 274
b25cb9a7 275%{?with_static:rm -f $RPM_BUILD_ROOT%{_bindir}/rpmvercmp}
32697bd0 276
2ccd5d66 277%if "%{pld_release}" == "ti"
278sed -e '
279 s|%%ARCH%%|%{_ftp_arch}|g
280' < %{SOURCE3} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
281
282%ifarch %{x8664}
283sed '
284 s|%%ARCH%%|%{_ftp_alt_arch}|g
285' < %{SOURCE4} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
286%endif
287%else
171e07f6 288# pld_release = th
652b5bc5 289%ifarch sparcv9 sparc64
290sed -e '
291 s|%%ARCH%%|%{_ftp_arch}|g
292' < %{SOURCE9} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
293
294%ifarch sparc64
295sed '
296 s|%%ARCH%%|%{_ftp_alt_arch}|g
297' < %{SOURCE10} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
298%endif
299
300%else
7adf66ff
ER
301sed -e '
302 s|%%ARCH%%|%{_ftp_arch}|g
b43abde7 303' < %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld.conf
171e07f6
ER
304sed -e '
305 s|%%ARCH%%|%{_ftp_arch}|g
306' < %{SOURCE8} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-debuginfo.conf
b44549bf 307
590302c4 308%ifarch %{x8664}
7adf66ff
ER
309sed '
310 s|%%ARCH%%|%{_ftp_alt_arch}|g
b43abde7 311' < %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b25cb9a7 312%endif
2ccd5d66 313%endif
652b5bc5 314%endif
b25cb9a7 315
480fc3c0 316install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/cli.conf
b25cb9a7 317
9e6ff4ef 318%if %{with imode}
319# add desktop file and icon
320install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir}}
2ccd5d66 321install %{SOURCE6} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
322install %{SOURCE7} $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
9e6ff4ef 323%endif
324
b43abde7
ER
325# sources we don't package
326rm -f $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/{rh,pld,fedora,centos}-source.conf
b25cb9a7
JB
327# include them in %doc
328rm -rf configs
329cp -a conf configs
330rm -f configs/Makefile*
331
62e80071 332%if %{with python}
58c31de0
JB
333%py_postclean
334rm -f $RPM_BUILD_ROOT%{py_sitedir}/_poldekmod.la
62e80071 335%endif
58c31de0 336
b25cb9a7 337%find_lang %{name}
f373d903 338
b44549bf 339%clean
340rm -rf $RPM_BUILD_ROOT
341
daf0e7ce
ER
342%post
343[ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1
344if [ "$1" = "1" ]; then
345 # remove ignore = vserver-packages inside vserver on first install
346 {
347 while read f ctx; do
348 [ "$f" = "VxID:" -o "$f" = "s_context:" ] && break
349 done </proc/self/status
350 } 2>/dev/null
351 if [ -z "$ctx" -o "$ctx" = "0" ]; then
352 VSERVER=no
353 else
354 VSERVER=yes
355 fi
356 if [ "$VSERVER" = "yes" ]; then
357 %{__sed} -i -e '/^ignore/s/vserver-packages//' %{_sysconfdir}/%{name}/poldek.conf
358 fi
359fi
b25cb9a7 360
3896c8b1
ER
361%postun -p /sbin/postshell
362-/usr/sbin/fix-info-dir -c %{_infodir}
b25cb9a7
JB
363
364%post libs -p /sbin/ldconfig
365%postun libs -p /sbin/ldconfig
366
b25cb9a7
JB
367%triggerpostun -- poldek < 0.19.0-1.20050613.22.0
368if [ -f /etc/poldek.conf.rpmsave ]; then
369 awk '/^source/ {
370 name = $3;
371 path = $4;
372 auto = "yes";
373 autoup = "yes";
374 type = "pdir";
f154dd55 375 pri = "";
b25cb9a7
JB
376
377 if (sub(",noauto", "", name)) {
378 auto = "no";
379 }
380
f154dd55
ER
381 # process pri=\d+
382 if (match(name, /,pri=[0-9]+/)) {
383 pri = substr(name, RSTART + 5, RLENGTH - 5);
384 name = substr(name, 1, RSTART - 1) substr(name, RSTART + RLENGTH);
385 }
386
b25cb9a7
JB
387 # skip ac sources. already in new config.
388 if (name !~ /^ac(-(ready|test|supported|updates-(general|security)))?$/) {
389 print "";
390 print "[source]";
391 print "name = " name;
392 print "type = " type;
393 print "path = " path;
394 print "auto = " auto;
395 print "autoup = " autoup;
f154dd55
ER
396 if (pri) {
397 print "pri = " pri;
398 }
b25cb9a7
JB
399 }
400
401 }' < /etc/poldek.conf.rpmsave >> /etc/poldek/source.conf
19cae196 402 echo "Converted old custom sources from /etc/poldek.conf.rpmsave to new poldek format in /etc/poldek/source.conf"
b25cb9a7
JB
403
404 # copy hold=
405 hold=$(grep ^hold /etc/poldek.conf.rpmsave)
406 if [ "$hold" ]; then
407 sed -i -e "/^#hold =/s/^.*/$hold/" /etc/poldek/poldek.conf
408 fi
409fi
410
b43abde7
ER
411%triggerpostun -- poldek < 0.30-0.20080225.00.1
412if ! grep -q '^%%includedir repos.d' %{_sysconfdir}/%{name}/poldek.conf; then
413 %{__sed} -i -e '/^%%include source.conf/{
414 a
415 a# /etc/poldek/repos.d/*.conf
416 a%%includedir repos.d
417 }' %{_sysconfdir}/%{name}/poldek.conf
418fi
419
420%{__sed} -i -e '/%%include %%{_distro}-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
421%{__sed} -i -e '/%%include %%{_distro}-multilib-source.conf/d' %{_sysconfdir}/%{name}/poldek.conf
422
423if [ -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave ]; then
424 cp -f %{_sysconfdir}/%{name}/repos.d/pld.conf{,.rpmnew}
478b6a69 425 cp -f %{_sysconfdir}/%{name}/pld-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld.conf
b43abde7
ER
426fi
427
428%ifarch %{x8664}
429if [ -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave ]; then
430 cp -f %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf{,.rpmnew}
478b6a69 431 cp -f %{_sysconfdir}/%{name}/pld-multilib-source.conf.rpmsave %{_sysconfdir}/%{name}/repos.d/pld-multilib.conf
b43abde7
ER
432fi
433%endif
434
767366b0 435%files -f %{name}.lang
b44549bf 436%defattr(644,root,root,755)
b43abde7 437%doc README* NEWS TODO configs
b25cb9a7 438%dir %{_sysconfdir}/%{name}
08335479 439%dir %{_sysconfdir}/%{name}/repos.d
168acc54 440%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
b43abde7 441%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/repos.d/*.conf
8efee472 442%attr(755,root,root) %{_bindir}/*
b25cb9a7
JB
443%dir %{_libdir}/%{name}
444%attr(755,root,root) %{_libdir}/%{name}/*
b44549bf 445%{_mandir}/man1/%{name}*
d8826405 446%lang(pl) %{_mandir}/pl/man1/%{name}*
b25cb9a7 447%{_infodir}/poldek.info*
9e6ff4ef 448%if %{with imode}
449%{_desktopdir}/%{name}.desktop
450%{_pixmapsdir}/%{name}.png
451%endif
b25cb9a7 452
b43abde7 453%if %{without static}
b25cb9a7
JB
454%files libs
455%defattr(644,root,root,755)
d8aeff9a
MB
456%attr(755,root,root) %{_libdir}/libpoclidek.so.*.*.*
457%attr(755,root,root) %{_libdir}/libpoldek.so.*.*.*
458%attr(755,root,root) %{_libdir}/libtndb.so.*.*.*
459%attr(755,root,root) %{_libdir}/libtrurl.so.*.*.*
460%attr(755,root,root) %{_libdir}/libvfile.so.*.*.*
461%attr(755,root,root) %ghost %{_libdir}/libpoclidek.so.0
462%attr(755,root,root) %ghost %{_libdir}/libpoldek.so.2
463%attr(755,root,root) %ghost %{_libdir}/libtndb.so.0
464%attr(755,root,root) %ghost %{_libdir}/libtrurl.so.0
465%attr(755,root,root) %ghost %{_libdir}/libvfile.so.0
b25cb9a7
JB
466%endif
467
468%files devel
469%defattr(644,root,root,755)
470%{!?with_static:%attr(755,root,root) %{_libdir}/lib*.so}
471%{_libdir}/lib*.la
472%{_includedir}/*
473
474%files static
475%defattr(644,root,root,755)
476%{_libdir}/lib*.a
58c31de0
JB
477
478%if %{with python}
479%files -n python-poldek
480%defattr(644,root,root,755)
481%attr(755,root,root) %{py_sitedir}/_poldekmod.so
482%{py_sitescriptdir}/poldek.py[co]
483%{py_sitescriptdir}/poldekmod.py[co]
484%endif
This page took 0.4613 seconds and 4 git commands to generate.