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